Skip to content

make path user expansion optional#5892

Merged
wyli merged 2 commits intoProject-MONAI:devfrom
colobas:feature/optional_expanduser
Jan 24, 2023
Merged

make path user expansion optional#5892
wyli merged 2 commits intoProject-MONAI:devfrom
colobas:feature/optional_expanduser

Conversation

@colobas
Copy link
Copy Markdown
Contributor

@colobas colobas commented Jan 24, 2023

Description

When using LoadImage, file paths get wrapped with pathlib.Path and .expanduser() is called. This causes paths with a protocol prefix to get corrupted (e.g. in my case paths starting with s3:// are getting one of the forward slashes removed)

This PR makes the wrapping with Path and call to .expanduser() optional (but set to True by default, to preserve current behavior)

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Jan 24, 2023

Thanks, could you please amend the commit message to have a sign-off line "git commit --amend --sign-off"? See https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md#signing-your-work

or please follow this dco suggestion https://github.com/Project-MONAI/MONAI/pull/5892/checks?check_run_id=10839784668

Signed-off-by: Guilherme Pires <[email protected]>
@colobas colobas force-pushed the feature/optional_expanduser branch from e142bdc to 9de21dc Compare January 24, 2023 18:06
@colobas
Copy link
Copy Markdown
Contributor Author

colobas commented Jan 24, 2023

signed off!

@wyli wyli enabled auto-merge (squash) January 24, 2023 18:31
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Jan 24, 2023

/build

@wyli wyli merged commit 86c7ecd into Project-MONAI:dev Jan 24, 2023
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