Skip to content

Preserve selected data server in movie frames - #9092

Merged
Esteban82 merged 2 commits into
masterfrom
fix_8209_Movie_Data-server
Sep 12, 2026
Merged

Preserve selected data server in movie frames#9092
Esteban82 merged 2 commits into
masterfrom
fix_8209_Movie_Data-server

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Done with Claude Sonnet 5

Fix #8209.

When running gmt movie, the selected GMT_DATA_SERVER was not consistently preserved inside the frame sessions. As a result, gmt --show-dataserver could report a different server in the movie script than the one configured in the parent session.

This PR ensures that the active data server setting is propagated correctly to movie frame sessions.

Fix: swapped the order at all 6 locations where scripts are generated (preflight, postflight, intro title-frame loop x2, main script x2), so cp -f gmt.conf . now runs before gmt begin.

Test

The issue can be reproduced with:

gmt set GMT_DATA_SERVER oceania
gmt --show-dataserver
cat << 'EOF' > main.sh
gmt begin
	gmt --show-dataserver
	gmt basemap -R-114/-103/35/40 -JM10c -Baf
gmt end
EOF
gmt movie main.sh -Chd -Nanim02 -T1 -Zs -Ml,png

Expected result: the same data server name should be printed twice (once in the terminal and once from inside the movie script). For example:

http://oceania.generic-mapping-tools.org
http://oceania.generic-mapping-tools.org

@Esteban82
Esteban82 requested review from a team, joa-quim and seisman July 7, 2026 21:19
@Esteban82 Esteban82 added add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Jul 7, 2026
@Esteban82

Copy link
Copy Markdown
Member Author

I see this errors for the movie tests. Is it safe to merge it?

Start 738: test/movie/trajectory2.sh
67/75 Test #738: test/movie/trajectory2.sh .............***Failed    0.88 sec
Set GMT_SESSION_NAME = 83801
/usr/bin/gm compare: image difference exceeds limit (0.00886259 > 0.003).
test/movie/trajectory2.ps: RMS Error = 0.0089 [FAIL]
memtrack errors: 0
exit status: 1

      Start 739: test/movie/trajectory3.sh
68/75 Test #739: test/movie/trajectory3.sh .............***Failed    0.91 sec
Set GMT_SESSION_NAME = 83877
/usr/bin/gm compare: image difference exceeds limit (0.00737297 > 0.003).
test/movie/trajectory3.ps: RMS Error = 0.0074 [FAIL]
memtrack errors: 0
exit status: 1

      Start 740: test/movie/trajectory5.sh
69/75 Test #740: test/movie/trajectory5.sh .............***Failed    0.91 sec
Set GMT_SESSION_NAME = 83953
/usr/bin/gm compare: image difference exceeds limit (0.0101027 > 0.003).
test/movie/trajectory5.ps: RMS Error = 0.0101 [FAIL]
memtrack errors: 0
exit status: 1

@joa-quim

joa-quim commented Jul 8, 2026

Copy link
Copy Markdown
Member

Hmm, need to look in what those differences consist.

Without an explicit unit, -Ar<dpu> falls back to the session's active
PROJ_LENGTH_UNIT, which now depends on the cp gmt.conf/gmt begin order
just fixed in movie.c. Pinning to cm keeps these tests matching the
existing baseline regardless of that order.
@Esteban82

Copy link
Copy Markdown
Member Author

The errors in the tests are because -Ar<dpu> falls back to the session's PROJ_LENGTH_UNIT, which now depends on the conf/begin order this PR swaps. Pinned trajectory2/3/5.sh to -Arc to match the existing baseline.

Maybe would be better to update the baselines, but I don't know very well how to do it.

@Esteban82

Copy link
Copy Markdown
Member Author

Now the tests for trajectory2/3/5.sh passed. I think I can merged it.

@Esteban82
Esteban82 merged commit f6039ec into master Sep 12, 2026
14 of 17 checks passed
@Esteban82
Esteban82 deleted the fix_8209_Movie_Data-server branch September 12, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Movie automatically changes the dataserver to Oceania (or static)?

2 participants