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.savefig: Support uppercase file extensions (e.g., PNG, PDF) #2697

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Sep 20, 2023

Description of proposed changes

Closes #2683

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman seisman added the enhancement Improving an existing feature label Sep 20, 2023
@seisman seisman added this to the 0.11.0 milestone Sep 20, 2023
@@ -306,7 +306,7 @@ def savefig(

fname = Path(fname)
prefix, suffix = fname.with_suffix("").as_posix(), fname.suffix
ext = suffix[1:] # Remove the .
ext = suffix[1:].lower() # Remove the . and normalize to lowercase
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't update the docstrings to document this new enhancement because I don't want to encourage users to use uppercase file extensions.

Copy link
Member

@yvonnefroehlich yvonnefroehlich Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the use of upper case file extensions (including any combination of lower and upper case letters) should be avoided. Thus, I feel it is fine to not explicitly mention this possibility in the documentation.

@seisman seisman added the needs review This PR has higher priority and needs review. label Sep 20, 2023
@seisman seisman requested a review from a team September 21, 2023 00:03
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it works as expected!

@seisman seisman added 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. labels Sep 21, 2023
@seisman seisman merged commit 6c933b2 into main Sep 22, 2023
15 checks passed
@seisman seisman deleted the savefig-uppercase branch September 22, 2023 04:57
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support upper-case file extensions
2 participants