Skip to content

Refactor plates module and expose a public API - #78

Merged
amorison merged 28 commits into
masterfrom
plates-refactor
Oct 21, 2021
Merged

Refactor plates module and expose a public API#78
amorison merged 28 commits into
masterfrom
plates-refactor

Conversation

@amorison

Copy link
Copy Markdown
Member

This PR is a full refactoring of the plates module to make it easier to maintain, expand, and use in a user script. The main improvements are:

  • detect_plates and detect_plates_vzcheck are merged in one routine detect_plates.
  • New command line arguments --vzratio, +-distribution and +-nbplates allow the user to switch on the use of vzabs when detecting plate limits, plotting of plate size distribution, and plotting of number of plates as a function of time.
  • the new +-continents argument switches the detection of continents and the related decorations on plots.
  • -o/--plot now works in a similar way to eponym options of field, rprof, and time subcommands. The plates subcommand plots the requested surface diagnostics. The later can be surface fields, fields, or "dv2" (which is d(vphi)/dphi).
  • the public api of the plates module (detect_plates and two plotting routines plot_at_surface and plot_scalar_field) is documented and available in user scripts.

Closes #37

Those are output from StagYY already, or can be easily computed
if needed for a particular study.  They are not general enough
to be handled by this module.
eta was hard-coded as the scalar field to plot with continents and plate
limits.  This commit abstracts and generalize this plot to any scalar
field.
The way it is computed is too specific of one problem to be useful
in the general case.
The modified colormap isn't used, and directly modifying a colormap
provided by matplotlib is deprecated.
Annotations outside of data limits wouldn't show. This commit
fix this with the annotation_clip kwarg.
Remove several unnecessary variables.
This is no longer used as the plates module handle arbitrary
fields and sfields variables.
This simplifies the API of detect_plates, and caching allows simplifying
the API of functions that need the position of ridges and trenches.
New configuration variables `plates.vzratio` and `distribution` control
plate limit detection and plotting of plate size distribution.
@lgtm-com

lgtm-com Bot commented Oct 21, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 5584098 into 1912bb2 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@amorison
amorison merged commit df7313d into master Oct 21, 2021
@amorison
amorison deleted the plates-refactor branch October 21, 2021 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve plate module

1 participant