-
Notifications
You must be signed in to change notification settings - Fork 268
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
PurePath screws up HDF5 table construction on Windows systems #2318
Comments
Hi Christopher, Please note ctapipe in general does not support Windows. We have had some best effort PRs lately, but it's definitely a non-goal to officially support windows and ensure compatibility. The recommended way for running ctapipe on windows would be to use WSL. That being said, the issue here looks easy to fix and of course we probably shouldn't be using the filesystem APIs for hdf5 related stuff anyways. |
Hi Max, Thanks for the fast response. Yes, I suspected that Windows compatibility is not foreseen (and I undestand why)... |
Do not use pathlib for hdf5 datasets, fixes #2318
Describe the bug
On Windows systems, code such as
crashes with error
NameError: ``where`` must start with a slash ('/')
The reason is that
HDF5TableWriter._setup_new_table()
makes use ofpathlib.PurePath
to set up HDF5 table name and path. The HDF5 format expects slashes ("/") as a separator for the internal data organisation.On Windows systems, however,
PurePath
automatically evaluates toPureWindowsPath
which expands any slash to a back-slash ("\"), screwing up the internal HDF5 path description.Proposed solution
The proposed solution is to replace
PurePath
byPurePosixPath
inHDF5TableWriter._setup_new_table()
, specifically in(However, I didn't test this, as I don't have access to a Windows system myself).
To Reproduce
Minimal example for what happens in
HDF5TableWriter._setup_new_table()
:This results on Windows systems in
Expected behavior
For the HDF5 internal data structure, I would expect that the result should look as follows:
This is what is produced on Linux systems.
Supporting information
If applicable, add screenshots, logs, or a traceback to help illustrate the bug.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: