Skip to content

Commit 35b69ef

Browse files
committed
Remove radas git hash from regression result
Was actually pointing to POPCON hash
1 parent b573331 commit 35b69ef

File tree

6 files changed

+3
-40
lines changed

6 files changed

+3
-40
lines changed

cfspopcon/formulas/atomic_data/atomic_data.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def __init__(self, atomic_data_directory: Path = Path() / "radas_dir") -> None:
4545

4646
self.species_ne_tau: dict[AtomicSpecies, xr.DataArray] = dict()
4747
self.ne_tau_units = ureg.m**-3 * ureg.s
48-
self.radas_git_hash: str = ""
4948

5049
for species in self.available_species:
5150
dataset = self[species]
@@ -65,18 +64,6 @@ def __init__(self, atomic_data_directory: Path = Path() / "radas_dir") -> None:
6564
self.noncoronal_Lz_interpolators[(species, ne_tau)] = CoeffInterpolator(subds.equilibrium_Lz, **ref)
6665
self.noncoronal_Z_interpolators[(species, ne_tau)] = CoeffInterpolator(subds.equilibrium_mean_charge_state, **ref)
6766

68-
self._check_radas_git_hash(dataset.git_hash)
69-
70-
def _check_radas_git_hash(self, test_git_hash: str) -> None:
71-
"""Check that all of the datasets have the same git hash."""
72-
if self.radas_git_hash == "":
73-
self.radas_git_hash = test_git_hash
74-
elif self.radas_git_hash != test_git_hash:
75-
warnings.warn(
76-
f"Found multiple radas git hashes ({self.radas_git_hash} != {test_git_hash}) in the requested atomic data. Will set radas_git_hash = UNDEFINED.",
77-
stacklevel=2,
78-
)
79-
8067
@staticmethod
8168
def read_atomic_data(atomic_data_directory: Path = Path() / "radas_dir") -> dict[AtomicSpecies, xr.Dataset]:
8269
"""Reads atomic data from netCDF files located in the specified directory.
@@ -203,8 +190,8 @@ def get_noncoronal_Z_interpolator(
203190
return self.noncoronal_Z_interpolators[(self.key_to_enum(species), ne_tau)]
204191

205192

206-
@Algorithm.register_algorithm(return_keys=["atomic_data", "radas_git_hash"])
207-
def read_atomic_data(radas_dir: Path) -> tuple[AtomicData, str]:
193+
@Algorithm.register_algorithm(return_keys=["atomic_data"])
194+
def read_atomic_data(radas_dir: Path) -> AtomicData:
208195
"""Construct an AtomicData interface using the atomic data in the specified directory."""
209196
atomic_data = AtomicData(get_item(radas_dir))
210-
return atomic_data, atomic_data.radas_git_hash
197+
return atomic_data

cfspopcon/variables.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,13 +1481,6 @@ radas_dir:
14811481
set_by: []
14821482
used_by:
14831483
- read_atomic_data
1484-
radas_git_hash:
1485-
default_units: null
1486-
description:
1487-
- Git hash for the version of radas used to construct the atomic data files.
1488-
set_by:
1489-
- read_atomic_data
1490-
used_by: []
14911484
radiated_power_method:
14921485
default_units: null
14931486
description:

docs/doc_sources/physics_glossary.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,6 @@ Physics Glossary
422422
radas_dir
423423
A path to the `radas <https://github.com/cfs-energy/radas>`_ working directory.
424424

425-
radas_git_hash
426-
Git hash for the version of radas used to construct the atomic data files.
427-
428425
radiated_power_method
429426
A :class:`~cfspopcon.named_options.RadiationMethod` indicating how we should calculate the power radiated from the confined region.
430427

tests/regression_results/PRD.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,11 +1062,6 @@
10621062
"data": 3.290275716,
10631063
"dims": []
10641064
},
1065-
"radas_git_hash": {
1066-
"attrs": {},
1067-
"data": "9741acc",
1068-
"dims": []
1069-
},
10701065
"radiated_power_method": {
10711066
"attrs": {},
10721067
"data": "Radas",
-536 Bytes
Binary file not shown.

tests/test_atomic_data.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,3 @@ def test_get_functions_with_missing_ne_tau(atomic_data, species, ne_tau):
140140

141141
with pytest.raises(KeyError):
142142
atomic_data.get_noncoronal_Z_interpolator(species, ne_tau, ne_tau_rel_tolerance=1e-2)
143-
144-
145-
def test_get_git_hash(atomic_data):
146-
atomic_data._check_radas_git_hash(atomic_data.radas_git_hash)
147-
148-
with pytest.warns(UserWarning):
149-
atomic_data._check_radas_git_hash("git hashes don't have spaces in them.")
150-
151-
assert atomic_data.radas_git_hash == atomic_data["hydrogen"].git_hash == atomic_data["helium"].git_hash

0 commit comments

Comments
 (0)