Refactor plates module and expose a public API - #78
Merged
Conversation
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.
|
This pull request introduces 1 alert when merging 5584098 into 1912bb2 - view on LGTM.com new alerts:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_platesanddetect_plates_vzcheckare merged in one routinedetect_plates.--vzratio,+-distributionand+-nbplatesallow the user to switch on the use ofvzabswhen detecting plate limits, plotting of plate size distribution, and plotting of number of plates as a function of time.+-continentsargument switches the detection of continents and the related decorations on plots.-o/--plotnow works in a similar way to eponym options offield,rprof, andtimesubcommands. Theplatessubcommand plots the requested surface diagnostics. The later can be surface fields, fields, or"dv2"(which isd(vphi)/dphi).detect_platesand two plotting routinesplot_at_surfaceandplot_scalar_field) is documented and available in user scripts.Closes #37