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

Make load functions compatible with pathlib.Path #1169

Open
Louis-Pujol opened this issue Jul 29, 2024 · 1 comment
Open

Make load functions compatible with pathlib.Path #1169

Louis-Pujol opened this issue Jul 29, 2024 · 1 comment

Comments

@Louis-Pujol
Copy link
Contributor

Louis-Pujol commented Jul 29, 2024

Hi !

So far vedo loaders work with filenames as strings, I usually use pathlib.Path to manage file locations. The current implementation is not compatible as some functions specific to strings are called. What do you think about making it compatible with pathlib.Path ? An easy way would be to convert pathlib.Path to string and let the rest of the loaders as before, something like that should work:

import os
from pathlib import Path

def load(filename: str | os.PathLike, ...):
    
   is isinstance(filename, Path):
       filename = str(filename)

Thanks,
Louis

@marcomusy
Copy link
Owner

Thanks Louis! I'm very open to it, please feel free to open a PR if you wish!

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

2 participants