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

Paths should be path objects and not just concatenated strings #240

Open
dnowacki-usgs opened this issue Jun 28, 2024 · 0 comments
Open

Comments

@dnowacki-usgs
Copy link
Member

Currently we write paths as something like "your/path/goes/here".

And then modify paths by doing something like

    basefile = metadata["basefile"]

    if "prefix" in metadata:
        basefile = metadata["prefix"] + basefile

Those are string paths that we are concatenating using the addition operator.

This is not ideal, since it may be confusing to Windows users (who are used to seeing backslash-separated paths), the current method is not obvious, and because Python provides a more robust method of dealing with paths. We should consider using os.path or probably better, pathlib.

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

No branches or pull requests

1 participant