pygmt icon indicating copy to clipboard operation
pygmt copied to clipboard

Figure.plot: Refactor to increase code readability

Open seisman opened this issue 2 years ago • 3 comments

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.

seisman avatar Oct 13 '23 09:10 seisman

Are there any further changes you wanna make @seisman ?

michaelgrund avatar Oct 17 '23 08:10 michaelgrund

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.

seisman avatar Oct 17 '23 08:10 seisman

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.

michaelgrund avatar Oct 17 '23 08:10 michaelgrund

Ping @GenericMappingTools/pygmt-maintainers for final review. Will merge in 24 hours if no further comments.

seisman avatar Mar 26 '24 13:03 seisman

Did you want to update some of the type hints here, or in #2744?

weiji14 avatar Mar 26 '24 20:03 weiji14

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.

seisman avatar Mar 27 '24 01:03 seisman