marcomusy/vedo

Make load functions compatible with pathlib.Path

Opened this issue · 1 comments

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

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