Skip to content

Commit

Permalink
Can now use data repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumit112192 authored Mar 18, 2024
1 parent e17fd85 commit 16e31cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tardis/io/atom_data/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ def resolve_atom_data_fname(fname):
if os.path.exists(fname):
return fname

fpath = os.path.join(os.path.join(get_data_dir(), fname))
fname = Path(fname.stem).with_suffix(".h5")
fpath = Path(os.path.join(get_data_dir(), fname))
if os.path.exists(fpath):
logger.info(
f"\n\tAtom Data {fname} not found in local path.\n\tExists in TARDIS Data repo {fpath}"
)
return fpath

atom_data_name = fname.with_suffix("")
atom_data_name = fname.stem
atom_repo_config = get_atomic_repo_config()
if str(atom_data_name) in atom_repo_config:
if atom_data_name in atom_repo_config:
raise IOError(
f"Atom Data {fname} not found in path or in TARDIS data repo - it is available as download:\n"
f"from tardis.io.atom_data.util import download_atom_data\n"
Expand Down

0 comments on commit 16e31cd

Please sign in to comment.