Skip to content

Commit bcdf281

Browse files
committed
Add kurucz test
1 parent ad7f382 commit bcdf281

File tree

12 files changed

+32
-18
lines changed

12 files changed

+32
-18
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
runs-on: ubuntu-24.04
7575
env:
7676
UV_FROZEN: 1
77+
ARTISATOMIC_TESTMODE: 1
7778
steps:
7879
- name: Checkout Code
7980
uses: actions/checkout@v4
@@ -108,7 +109,7 @@ jobs:
108109
tests:
109110
strategy:
110111
matrix:
111-
testname: [cmfgen, floers25, jplt, qub]
112+
testname: [cmfgen, floers25, jplt, kurucz, qub]
112113
fail-fast: false
113114
runs-on: ubuntu-24.04
114115
env:

artisatomic/readkuruczdata.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from collections import defaultdict
23
from collections import namedtuple
34
from pathlib import Path
@@ -7,21 +8,23 @@
78
hc_in_ev_cm = 0.0001239841984332003
89

910
kuruczdatapath = Path(__file__).parent.absolute() / ".." / "atomic-data-kurucz"
11+
if os.environ["ARTISATOMIC_TESTMODE"] == "1":
12+
kuruczdatapath = kuruczdatapath / "test_sample"
1013

1114

1215
def find_gfall(atomic_number: int, ion_charge: int) -> Path:
13-
path_gfall = (kuruczdatapath / "extendedatoms" / f"gf{atomic_number:02d}{ion_charge:02d}.lines").resolve()
14-
15-
if not path_gfall.is_file():
16-
path_gfall = (kuruczdatapath / "extendedatoms" / f"gf{atomic_number:02d}{ion_charge:02d}z.lines").resolve()
17-
18-
if not path_gfall.is_file():
19-
path_gfall = (kuruczdatapath / "zztar" / f"gf{atomic_number:02d}{ion_charge:02d}.all").resolve()
20-
21-
if not path_gfall.is_file():
22-
raise FileNotFoundError(f"No Kurucz file for Z={atomic_number} ion_charge {ion_charge}")
23-
24-
return path_gfall
16+
filenames = [
17+
f"gf{atomic_number:02d}{ion_charge:02d}.lines.zst",
18+
f"gf{atomic_number:02d}{ion_charge:02d}.lines",
19+
f"gf{atomic_number:02d}{ion_charge:02d}z.lines.zst",
20+
f"gf{atomic_number:02d}{ion_charge:02d}z.lines",
21+
]
22+
for filename in filenames:
23+
path_gfall = (kuruczdatapath / "extendedatoms" / filename).resolve()
24+
if path_gfall.is_file():
25+
return path_gfall
26+
27+
raise FileNotFoundError(f"No Kurucz file for Z={atomic_number} ion_charge {ion_charge}")
2528

2629

2730
def get_levelname(row) -> str:

atomic-data-kurucz/.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
gfall*
2-
*.lines
3-
*.all
4-
creationdates.dat
1+
extendedatoms/*.lines
2+
zztar/*.all
73.7 KB
Binary file not shown.
1.11 KB
Binary file not shown.
1.65 KB
Binary file not shown.
4.38 KB
Binary file not shown.
2.36 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
[41, [[1, "tanakajplt"], [2, "tanakajplt"], [3, "tanakajplt"], [4, "tanakajplt"]]]
3+
]

0 commit comments

Comments
 (0)