Skip to content

Commit

Permalink
pass tardis-refdata via env variables
Browse files Browse the repository at this point in the history
Signed-off-by: Asish Kumar <[email protected]>
  • Loading branch information
officialasishkumar committed Aug 9, 2024
1 parent 1488fdb commit 18f6d47
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
22 changes: 17 additions & 5 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,30 @@
"project": "tardis",
"project_url": "https://tardis-sn.github.io/tardis",
"repo": ".",
"install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
"uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
"install_command": [
"in-dir={env_dir} python -mpip install {wheel_file}"
],
"uninstall_command": [
"return-code=any python -mpip uninstall -y {project}"
],
"build_command": [
"python setup.py build",
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
],
"branches": ["origin/master", "HEAD"],
"branches": [
"origin/master",
"HEAD"
],
"environment_type": "mamba",
"show_commit_url": "https://github.com/tardis-sn/tardis/commit/",
"conda_environment_file": "tardis_env3.yml",
"benchmark_dir": "benchmarks",
"env_dir": ".asv/env",
"results_dir": ".asv/results",
"html_dir": ".asv/html"
}
"html_dir": ".asv/html",
"matrix": {
"env": {
"TARDIS_REF_PATH": "tardis-refdata/atom_data"
}
}
}
5 changes: 3 additions & 2 deletions benchmarks/benchmark_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
import os
from copy import deepcopy
from pathlib import Path

Expand Down Expand Up @@ -61,7 +62,7 @@ def config_rpacket_tracking(self):
def tardis_ref_path(self):
ref_data_path = Path(
Path(__file__).parent.parent,
"tardis-refdata"
os.environ.get("TARDIS_REF_PATH")
).resolve()
return ref_data_path

Expand All @@ -78,7 +79,7 @@ def atomic_dataset(self) -> AtomData:
@functools.cached_property
def atomic_data_fname(self):
atomic_data_fname = (
f"{self.tardis_ref_path}/atom_data/kurucz_cd23_chianti_H_He.h5"
f"{self.tardis_ref_path}/kurucz_cd23_chianti_H_He.h5"
)

if not Path(atomic_data_fname).exists():
Expand Down

0 comments on commit 18f6d47

Please sign in to comment.