Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path replace bug #2549

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,5 @@ Sarthak Srivastava <[email protected]> Sarthak Srivastava <sarthaksri592@g

Kim Lingemann <[email protected]> kimsina <[email protected]>
Kim Lingemann <[email protected]> kim <[email protected]>

Rudraksh Nalbalwar <[email protected]> rudrakshnalbalwar <[email protected]>
20 changes: 0 additions & 20 deletions benchmarks/benchmark_run_tardis.py

This file was deleted.

20 changes: 13 additions & 7 deletions tardis/io/atom_data/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import logging

from pathlib import Path

from tardis.io.configuration.config_internal import get_data_dir
from tardis.io.atom_data.atom_web_download import (
get_atomic_repo_config,
Expand All @@ -24,18 +26,22 @@ def resolve_atom_data_fname(fname):
: str
resolved fpath
"""
file_path = Path(fname)

if os.path.exists(fname):
return fname
if file_path.exists():
return file_path

fpath = os.path.join(os.path.join(get_data_dir(), fname))
if os.path.exists(fpath):
# fpath = os.path.join(os.path.join(get_data_dir(), fname))
data_dir = Path(get_data_dir())
combined_path = data_dir / file_path

if combined_path.exists():
logger.info(
f"\n\tAtom Data {fname} not found in local path.\n\tExists in TARDIS Data repo {fpath}"
f"\n\tAtom Data {file_path.exist()} not found in local path.\n\tExists in TARDIS Data repo {combined_path}"
)
return fpath
return combined_path

atom_data_name = fname.replace(".h5", "")
atom_data_name = file_path.with_suffix("").name
atom_repo_config = get_atomic_repo_config()
if atom_data_name in atom_repo_config:
raise IOError(
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ indexserver =
setenv = MPLBACKEND=agg

# Pass through the following environment variables which may be needed for the CI
passenv = HOME WINDIR LC_ALL LC_CTYPE CC CI TRAVIS
passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI,TRAVIS

# Run the tests in a temporary directory to make sure that we don't import
# this package from the source tree
Expand Down
Loading