vedo icon indicating copy to clipboard operation
vedo copied to clipboard

Make load functions compatible with pathlib.Path

Open Louis-Pujol opened this issue 6 months ago • 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

Louis-Pujol avatar Jul 29 '24 11:07 Louis-Pujol