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

MAINT: use pathlib for path manipulation #209

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

MridulS
Copy link
Member

@MridulS MridulS commented Apr 24, 2024

This should fix #208 but I feel like there should be a better solution.

@MridulS MridulS changed the title MAINT: use pathlib from path manipulation MAINT: use pathlib for path manipulation Apr 24, 2024
return self.file[sel[1:]]
elif sel.endswith('/'):
return self[sel[:-1]]
sel_path = Path(sel)
Copy link
Member

Choose a reason for hiding this comment

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

This depends on the OS. You need to use PosixPath here. Or better AbstractPosixPath because it doesn't refer to a real file.

This is one reason why only testing on Linux is not enough... But that is a different discussion.

@MridulS
Copy link
Member Author

MridulS commented Apr 25, 2024

There are unrelated windows error in scippnexus btw.
One of the errors in the CI run with windows, let's use scipp/copier_template#166 for the windows discussion.

E           RuntimeError: Coordinate must be monotonically increasing or decreasing for label-based indexing.

@MridulS MridulS merged commit 7188161 into scipp:main Apr 25, 2024
3 checks passed
@MridulS MridulS deleted the pathlib_santize branch April 25, 2024 12:14
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.

Repeated forward slashes become absolute paths
2 participants