Skip to content

Changes to speed up Earth relief and regions tutorials - #868

Closed
willschlitzer wants to merge 4 commits into
GenericMappingTools:masterfrom
willschlitzer:speedier-tutorials
Closed

Changes to speed up Earth relief and regions tutorials#868
willschlitzer wants to merge 4 commits into
GenericMappingTools:masterfrom
willschlitzer:speedier-tutorials

Conversation

@willschlitzer

@willschlitzerwillschlitzer commented Feb 12, 2021

Copy link
Copy Markdown
Contributor

Makes the changes suggested for regions.py and earth-relief.py to reduce the time to generate the tutorials. This PR removes the internal national borders in regions.py and changes the land color to dark gray. It also changes the registration for the loaded Earth relief grid to "gridline" because that is the cached version.

Fixes#825

Reminders

  • Run make format and make check to make sure the code follows the style guide.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@willschlitzerwillschlitzer added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Feb 12, 2021
@willschlitzerwillschlitzer added this to the 0.3.0 milestone Feb 12, 2021
@willschlitzer

Copy link
Copy Markdown
ContributorAuthor
computation time summary:
- ../examples/tutorials/3d-perspective-image.py: 11.75 sec 0.0 MB
- ../examples/tutorials/regions.py: 10.57 sec 0.0 MB
- ../examples/tutorials/frames.py: 6.65 sec 0.0 MB
- ../examples/tutorials/lines.py: 6.62 sec 0.0 MB
- ../examples/tutorials/earth-relief.py: 6.43 sec 0.0 MB
- ../examples/gallery/grid/grdview_surface.py: 6.32 sec 0.0 MB
- ../examples/tutorials/text.py: 4.93 sec 0.0 MB
- ../examples/tutorials/contour-map.py: 4.61 sec 0.0 MB
- ../examples/tutorials/coastlines.py: 3.60 sec 0.0 MB

@seisman This doesn't appear to have changed the times to build the documentation; any ideas on how to improve it?

@weiji14

Copy link
Copy Markdown
Member

Might need to merge in the change from #866 first to use the cache properly.

@willschlitzer

Copy link
Copy Markdown
ContributorAuthor
computation time summary:
- ../examples/tutorials/3d-perspective-image.py: 10.86 sec 0.0 MB
- ../examples/tutorials/regions.py: 10.02 sec 0.0 MB
- ../examples/tutorials/frames.py: 6.39 sec 0.0 MB
- ../examples/tutorials/lines.py: 5.99 sec 0.0 MB
- ../examples/gallery/grid/grdview_surface.py: 5.84 sec 0.0 MB
- ../examples/tutorials/earth-relief.py: 5.63 sec 0.0 MB
- ../examples/tutorials/text.py: 4.36 sec 0.0 MB
- ../examples/tutorials/contour-map.py: 4.22 sec 0.0 MB
- ../examples/tutorials/coastlines.py: 3.27 sec 0.0 MB
- ../examples/tutorials/inset.py: 2.96 sec 0.0 MB
- ../examples/projections/azim/azim_general_perspective.py: 2.69 sec 0.0 MB
- ../examples/tutorials/plot.py: 2.48 sec 0.0 MB
- ../examples/tutorials/first-figure.py: 1.70 sec 0.0 MB
- ../examples/tutorials/configuration.py: 1.65 sec 0.0 MB
- ../examples/gallery/plot/inset.py: 1.39 sec 0.0 MB
- ../examples/gallery/grid/track_sampling.py: 1.11 sec 0.0 MB
- ../examples/gallery/coast/borders.py: 1.08 sec 0.0 MB
- ../examples/projections/cyl/cyl_cassini.py: 0.98 sec 0.0 MB

Merging the changes from #866 doesn't seem to have sped up the tests.

@willschlitzerwillschlitzer changed the title Changes to speed up Earth relief and regions tutorials.Changes to speed up Earth relief and regions tutorialsFeb 12, 2021
@seisman

Copy link
Copy Markdown
Member

I'm afraid the key reason for the slow execution time is because there are too many figures in these tutorials (7 for 3d perspective figure and 11 for regions).

For example, in the 3d perspective figure, can we merge the last few (~3) figures into one figure?

@seisman

Copy link
Copy Markdown
Member

Here is what we can do to improve the 3D respective tutorial:

  1. Use a lower resolution earth relief grid (currently impossible, because lower-resolution grids don't support the region argument yet)
  2. Merge the 2nd and the 3rd figures
  3. Merge the last three figures (still easy to understand what contourpen, colorbar and perspective do).

@willschlitzerwillschlitzer mentioned this pull request Feb 12, 2021
5 tasks
@willschlitzer

Copy link
Copy Markdown
ContributorAuthor

Closing this PR due to creating multiple branches and pushing them; discussion/further edits will be at #871

@willschlitzer
willschlitzer deleted the speedier-tutorials branch January 15, 2026 14:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenanceBoring but important stuff for the core devsskip-changelogSkip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve some tutorials to speed up the Continuous Documentation

3 participants

@willschlitzer@weiji14@seisman