Skip to content

Conversation

willschlitzer
Copy link
Contributor

@willschlitzer willschlitzer commented Feb 12, 2021

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

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

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
Member

weiji14 commented Feb 12, 2021

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

@willschlitzer
Copy link
Contributor Author

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.

@willschlitzer willschlitzer changed the title Changes to speed up Earth relief and regions tutorials. Changes to speed up Earth relief and regions tutorials Feb 12, 2021
@seisman
Copy link
Member

seisman commented Feb 12, 2021

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
Member

seisman commented Feb 12, 2021

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).

@willschlitzer
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip 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