diff --git a/.mailmap b/.mailmap index 77a23a6afca..6baefb7b027 100644 --- a/.mailmap +++ b/.mailmap @@ -263,3 +263,5 @@ Sarthak Srivastava Sarthak Srivastava kimsina Kim Lingemann kim + +Rudraksh Nalbalwar rudrakshnalbalwar diff --git a/benchmarks/benchmark_run_tardis.py b/benchmarks/benchmark_run_tardis.py deleted file mode 100644 index 7a62dc5822a..00000000000 --- a/benchmarks/benchmark_run_tardis.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Basic TARDIS Benchmark.""" -import os -from tardis.io.configuration.config_reader import Configuration -from tardis import run_tardis - -class Benchmarkruntardis: - """Class to benchmark the run_tardis function. - """ - timeout = 200 - - def setup(self): - filename = "tardis_configv1_benchmark.yml" - dir_path = os.path.dirname(os.path.realpath(__file__)) - path = os.path.join(dir_path, "data", filename) - config = Configuration.from_yaml(path) - config.atom_data = "kurucz_cd23_chianti_H_He.h5" - self.config = config - - def time_run_tardis(self): - sim = run_tardis(self.config, log_level="ERROR", show_progress_bars=False) diff --git a/tardis/io/atom_data/util.py b/tardis/io/atom_data/util.py index 82cff49e183..b967479f6aa 100644 --- a/tardis/io/atom_data/util.py +++ b/tardis/io/atom_data/util.py @@ -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, @@ -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( diff --git a/tox.ini b/tox.ini index 477e8824b7c..d380d117025 100644 --- a/tox.ini +++ b/tox.ini @@ -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