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

Save figs fix #39

Merged
merged 8 commits into from
Feb 14, 2024
Merged

Save figs fix #39

merged 8 commits into from
Feb 14, 2024

Conversation

A-CGray
Copy link
Member

@A-CGray A-CGray commented Feb 14, 2024

Purpose

In savefigs, we allow the user to pass either a list of formats (e.g ["png", "pdf"]) or a single format string (e.g "png"). In theory, when the user passes in a single string, we convert it to a single entry list so that we always have a list of formats to loop through:

# --- Convert the file format to a list if only one given ---
if not isinstance(formats, Iterable):
   formats = [formats]

However, a string is iterable, so what actually happens when the user passes in a single format string is we don't put it in a list and instead loop over the individual character in the string. So I just changed logic to check if the input is a string.

Expected time until merged

NOW

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@A-CGray A-CGray requested a review from a team as a code owner February 14, 2024 14:32
@eirikurj eirikurj merged commit 7892f4c into main Feb 14, 2024
19 checks passed
@A-CGray A-CGray deleted the saveFigsFix branch February 14, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants