Skip to content

Commit

Permalink
replace string with dm_module variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kkovary committed Sep 18, 2023
1 parent d03316a commit 4bf712c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datamol/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4bf712c

Please sign in to comment.