-
Notifications
You must be signed in to change notification settings - Fork 32
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
enhancement/refactor: path handling #81
Labels
Comments
benatouba
added a commit
to benatouba/cosipy
that referenced
this issue
Nov 26, 2024
Transform all path variables to the more modern `pathlib.Path` object. This helps with cross-platform compatibility and makes the code more readable. Some type annotations were also passed. Meant to be applied in conjunction with a move to Pydantic for configuration validation. NOTE: If cherry-picked, needs to be revised carefully as the commit is meant to be applied with a move to Pydantic. Fixes cryotools#81
Links to #86. |
gampnico
added a commit
that referenced
this issue
Nov 29, 2024
benatouba
added a commit
to benatouba/cosipy
that referenced
this issue
Nov 29, 2024
Transform all path variables to the more modern `pathlib.Path` object. This helps with cross-platform compatibility and makes the code more readable. Some type annotations were also passed. Meant to be applied in conjunction with a move to Pydantic for configuration validation. NOTE: If cherry-picked, needs to be revised carefully as the commit is meant to be applied with a move to Pydantic. Fixes cryotools#81
benatouba
added a commit
to benatouba/cosipy
that referenced
this issue
Nov 29, 2024
Transform all path variables to the more modern `pathlib.Path` object. This helps with cross-platform compatibility and makes the code more readable. Some type annotations were also passed. Meant to be applied in conjunction with a move to Pydantic for configuration validation. NOTE: If cherry-picked, needs to be revised carefully as the commit is meant to be applied with a move to Pydantic. Fixes cryotools#81
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The file handling via the
os.path
module comes with several pitfalls, especially when dealing with bothUNIX-path
andntppath
styles. I am not sure if COSIPY is supposed to run on windows as well, but do you see a benefit in refactoring the code to usepathlib
module'sPath
andPurePath
classes for path-handling.It is encouraged to be used anyway, yields better type hinting, offers more flexibility with different systems and is arguably a bit prettier to write.
P.S.: I can't add labels to issues.
The text was updated successfully, but these errors were encountered: