pygmt
pygmt copied to clipboard
Figure.plot: Refactor to increase code readability
Description of proposed changes
The Figure.plot method is one of the first GMT modules wrapped in PyGMT and we have kept adding more features into this method but without any refactorings.
The current Figure.plot codes are difficult to read and maintain. This PR refactors the codes to make it easier to read by grouping the codes based on the data kind.
Are there any further changes you wanna make @seisman ?
Are there any further changes you wanna make @seisman ?
Yes, need to finish PR https://github.com/GenericMappingTools/pygmt/pull/2744 first.
Off-topic: Did you receive the email I sent one month ago? It's about the PyGMT mail list.
Are there any further changes you wanna make @seisman ?
Yes, need to finish PR #2744 first.
Off-topic: Did you receive the email I sent one month ago? It's about the PyGMT mail list.
No I didn't, I was traveling the last ~4 weeks. However, just saw that Yvonne forwarded the mail to me. Will answer it later.
Ping @GenericMappingTools/pygmt-maintainers for final review. Will merge in 24 hours if no further comments.
Did you want to update some of the type hints here, or in #2744?
Did you want to update some of the type hints here, or in #2744?
I have some other ideas about refactoring virtualfile_in and data_kind, so PR #2744 will likely be abandoned.
The Figure.plot wrapper will be refactored again when we rewrite the virtualfile_in/data_kind method, so better to make the codes simple here without adding type hints.