diff --git a/datamol/data/__init__.py b/datamol/data/__init__.py index 21255c19..a13718e3 100644 --- a/datamol/data/__init__.py +++ b/datamol/data/__init__.py @@ -27,16 +27,18 @@ from ..convert import from_df from ..convert import render_mol_df + @functools.lru_cache() def datamol_data_file_path(filename: str, dm_module: str = "datamol.data") -> str: if sys.version_info < (3, 9, 0): - with importlib_resources.path("datamol.data", filename) as p: + with importlib_resources.path(dm_module, filename) as p: data_path = p else: data_path = importlib_resources.files(dm_module).joinpath(filename) return str(data_path) + def open_datamol_data_file( filename: str, open_binary: bool = False,