Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure.plot: Refactor to increase code readability #2742

Merged
merged 14 commits into from
Mar 27, 2024
Merged

Conversation

seisman
Copy link
Member

@seisman seisman commented Oct 13, 2023

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 seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Oct 13, 2023
@seisman seisman added this to the 0.11.0 milestone Oct 13, 2023
@seisman seisman marked this pull request as draft October 13, 2023 15:22
@seisman seisman changed the title Figure.plot: Refactor to increase code readability WIP: Figure.plot: Refactor to increase code readability Oct 14, 2023
pygmt/src/plot.py Outdated Show resolved Hide resolved
@michaelgrund
Copy link
Member

Are there any further changes you wanna make @seisman ?

@seisman
Copy link
Member Author

seisman commented Oct 17, 2023

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
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.

@seisman seisman modified the milestones: 0.11.0, 0.12.0 Dec 11, 2023
@seisman seisman removed this from the 0.12.0 milestone Feb 26, 2024
@seisman seisman changed the title WIP: Figure.plot: Refactor to increase code readability Figure.plot: Refactor to increase code readability Mar 4, 2024
@seisman seisman 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
@seisman seisman added this to the 0.12.0 milestone Mar 4, 2024
@seisman seisman removed the needs review This PR has higher priority and needs review. label Mar 13, 2024
@seisman seisman added the needs review This PR has higher priority and needs review. label Mar 22, 2024
@seisman seisman 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
Member Author

seisman commented Mar 26, 2024

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

@weiji14
Copy link
Member

weiji14 commented Mar 26, 2024

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

@seisman
Copy link
Member Author

seisman commented Mar 27, 2024

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 seisman 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 main Mar 27, 2024
24 checks passed
@seisman seisman deleted the refactor/plot branch March 27, 2024 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants