Figure.choropleth: Refactor using low-level sessions and virtualfiles#4700
Open
seisman wants to merge 2 commits into
Open
Figure.choropleth: Refactor using low-level sessions and virtualfiles#4700seisman wants to merge 2 commits into
seisman wants to merge 2 commits into
Conversation
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.
Previously, the
Figure.choroplethmethod was implemented by wrapping theFigure.plotmethod. It's simple, but has the following downsides:Figure.plotmethod has complicated codes for dealing with diverse input format, which is necessary forFigure.choroplethFigure.plotvia**kwargs, but many parameters, such assymbol/straight_line/errorbardon't make sense inFigure.choropleth.This PR reimplements
Figure.choroplethusing the lower-levelplotmodule call instead of wrappingFigure.plot. Also updates the docstring to describe the method directly instead of as a thin wrapper aroundFigure.plot.Strictly speaking, this is a breaking change, as
kwargsis removed. Since this method was added after v0.18.0, it's not public yet. So the breaking change should have no effect on existing scripts.Preview: https://pygmt-dev--4700.org.readthedocs.build/en/4700/api/generated/pygmt.Figure.choropleth.html#pygmt.Figure.choropleth
Address #4414. Supersedes #2798.