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

Handle str and pathlib.Path consistently in image_io #54

Merged
merged 5 commits into from
Mar 18, 2024
Merged

Conversation

K-Meech
Copy link
Contributor

@K-Meech K-Meech commented Mar 18, 2024

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
The load/save functions in image_io currently only specify str filepaths in their docstrings, although some can also accept pathlib.Path.

What does this PR do?
This PR ensures that all load/save functions in image_io consistently handle both str and pathlib.Path. It favours using pathlib.Path internally wherever possible.

References

Closes #47

How has this PR been tested?

image_io tests were updated so that all load/save functions are tested with both pathlib.Path and str.

Is this a breaking change?

No

Does this PR require an update to the documentation?

All relevant image_io docstrings were updated.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@K-Meech K-Meech requested a review from a team March 18, 2024 13:29
brainglobe_utils/image_io/load.py Outdated Show resolved Hide resolved
brainglobe_utils/image_io/load.py Outdated Show resolved Hide resolved
brainglobe_utils/image_io/save.py Outdated Show resolved Hide resolved
brainglobe_utils/image_io/load.py Show resolved Hide resolved
@K-Meech K-Meech merged commit 723815d into main Mar 18, 2024
10 checks passed
@K-Meech K-Meech deleted the image_io_paths branch March 18, 2024 15:38
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.

Make image_io consistently handle both str and pathlib.Path
2 participants