Skip to content

Figure.plot: Refactor to increase code readability - #2742

Merged
seisman merged 14 commits into
mainfrom
refactor/plot
Mar 27, 2024
Merged

Figure.plot: Refactor to increase code readability#2742
seisman merged 14 commits into
mainfrom
refactor/plot

Conversation

@seisman

@seismanseisman commented Oct 13, 2023

Copy link
Copy Markdown
Member

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.

@seismanseisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Oct 13, 2023
@seismanseisman added this to the 0.11.0 milestone Oct 13, 2023
@seisman
seisman marked this pull request as draft October 13, 2023 15:22
@seismanseisman changed the title Figure.plot: Refactor to increase code readabilityWIP: Figure.plot: Refactor to increase code readabilityOct 14, 2023
Comment threadpygmt/src/plot.py Outdated
@michaelgrund

Copy link
Copy Markdown
Member

Are there any further changes you wanna make @seisman ?

@seisman

Copy link
Copy Markdown
MemberAuthor

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.

@michaelgrund

Copy link
Copy Markdown
Member

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.

@seismanseisman modified the milestones: 0.11.0, 0.12.0Dec 11, 2023
@seismanseisman removed this from the 0.12.0 milestone Feb 26, 2024
@seismanseisman changed the title WIP: Figure.plot: Refactor to increase code readabilityFigure.plot: Refactor to increase code readabilityMar 4, 2024
@seismanseisman added needs review This PR has higher priority and needs review. and removed skip-changelog Skip adding Pull Request to changelog labels Mar 4, 2024
@seisman
seisman marked this pull request as ready for review March 4, 2024 12:57
@seismanseisman added this to the 0.12.0 milestone Mar 4, 2024
@seismanseisman removed the needs review This PR has higher priority and needs review. label Mar 13, 2024
@seismanseisman added the needs review This PR has higher priority and needs review. label Mar 22, 2024
@seismanseisman added run/benchmark Trigger the benchmark workflow in PRs final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. run/benchmark Trigger the benchmark workflow in PRs labels Mar 26, 2024
@seisman

Copy link
Copy Markdown
MemberAuthor

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

@weiji14

Copy link
Copy Markdown
Member

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

@seisman

Copy link
Copy Markdown
MemberAuthor

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.

@seismanseisman added skip-changelog Skip adding Pull Request to changelog and removed final review call This PR requires final review and approval from a second reviewer labels Mar 27, 2024
@seisman
seisman merged commit 4b3b3eb into mainMar 27, 2024
@seisman
seisman deleted the refactor/plot branch March 27, 2024 02:16
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenanceBoring but important stuff for the core devsskip-changelogSkip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@seisman@michaelgrund@weiji14