Skip to content

Commit eaded77

Browse files
committed
Argument is type pathlib.Path() so update as required
1 parent db65309 commit eaded77

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

tests/test_ame_mass_parse.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from pynch.ame_mass_parse import AMEMassParser
22

3+
import pathlib
34

45
def test_read_line():
5-
parser = AMEMassParser(".", 2003)
6+
parser = AMEMassParser(pathlib.Path("."), 2003)
67
line = " 15 41 26 67 Fe x -45692.348 415.570 8449.695 6.203 B- 9368.702 523.438 66 950947.244 446.132"
78
d = parser._read_line(line)
89

@@ -18,7 +19,7 @@ def test_read_line():
1819
assert d['AtomicMass'] == 950947.244
1920
assert d['AtomicMassError'] == 446.132
2021

21-
parser = AMEMassParser(".", 2012)
22+
parser = AMEMassParser(pathlib.Path("."), 2012)
2223
line = " 15 41 26 67 Fe x -46068.530 217.972 8455.310 3.253 B- 9253.245 218.067 66 950543.395 234.002"
2324
d = parser._read_line(line)
2425

@@ -34,7 +35,7 @@ def test_read_line():
3435
assert d['AtomicMass'] == 950543.395
3536
assert d['AtomicMassError'] == 234.002
3637

37-
parser = AMEMassParser(".", 2016)
38+
parser = AMEMassParser(pathlib.Path("."), 2016)
3839
line = " 15 41 26 67 Fe x -45610.155 270.285 8448.469 4.034 B- 9711.620 270.362 66 951035.482 290.163"
3940
d = parser._read_line(line)
4041

@@ -50,8 +51,7 @@ def test_read_line():
5051
assert d['AtomicMass'] == 951035.482
5152
assert d['AtomicMassError'] == 290.163
5253

53-
54-
parser = AMEMassParser(".", 2020)
54+
parser = AMEMassParser(pathlib.Path("."), 2020)
5555
line = " 15 41 26 67 Fe x -45708.416 3.819 8449.9359 0.0570 B- 9613.3678 7.4900 66 950930.000 4.100"
5656
d = parser._read_line(line)
5757

tests/test_ame_reaction_1_parse.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from pynch.ame_reaction_1_parse import AMEReactionParserOne
22

3+
import pathlib
34

45
def test_read_line():
5-
parser = AMEReactionParserOne(".", 2003)
6+
parser = AMEReactionParserOne(pathlib.Path("."), 2003)
67
line = " 186 Ir 77 15704.74 32.47 9524.26 17.08 3849.65 103.31 -7458.10 26.70 -2639.77 16.57 -10561.10 44.19"
78
d = parser._read_line(line)
89

@@ -22,7 +23,7 @@ def test_read_line():
2223
assert d['QBetaNeutron'] == -10561.10
2324
assert d['QBetaNeutronError'] == 44.19
2425

25-
parser = AMEReactionParserOne(".", 2012)
26+
parser = AMEReactionParserOne(pathlib.Path("."), 2012)
2627
line = " 186 Ir 77 15706.55 32.47 9527.99 17.09 3848.03 103.31 -7459.92 26.70 -2641.13 16.57 -10557.95 30.67"
2728
d = parser._read_line(line)
2829

@@ -42,7 +43,7 @@ def test_read_line():
4243
assert d['QBetaNeutron'] == -10557.95
4344
assert d['QBetaNeutronError'] == 30.67
4445

45-
parser = AMEReactionParserOne(".", 2016)
46+
parser = AMEReactionParserOne(pathlib.Path("."), 2016)
4647
line = " 186 Ir 77 15704.13 32.47 9530.65 17.07 3848.80 103.31 -7457.49 26.70 -2642.29 16.55 -10555.52 30.67"
4748
d = parser._read_line(line)
4849

@@ -62,7 +63,7 @@ def test_read_line():
6263
assert d['QBetaNeutron'] == -10555.52
6364
assert d['QBetaNeutronError'] == 30.67
6465

65-
parser = AMEReactionParserOne(".", 2020)
66+
parser = AMEReactionParserOne(pathlib.Path("."), 2020)
6667
line = " 186 Ir 77 15704.1312 32.4655 9530.4731 17.0698 3848.8777 103.3133 -7457.4943 26.6968 -2642.2739 16.5459 -10555.5245 30.6658"
6768
d = parser._read_line(line)
6869

tests/test_ame_reaction_2_parse.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from pynch.ame_reaction_2_parse import AMEReactionParserTwo
22

3+
import pathlib
34

45
def test_read_line():
5-
parser = AMEReactionParserTwo(".", 2003)
6+
parser = AMEReactionParserTwo(pathlib.Path("."), 2003)
67
line = " 204 Tl 81 6656.10 0.29 6365.82 1.25 -12470.66 24.01 13710.69 1.15 8181.34 1.16 7701.54 3.34"
78
d = parser._read_line(line)
89

@@ -22,7 +23,7 @@ def test_read_line():
2223
assert d['QNeutronAlpha'] == 7701.54
2324
assert d['QNeutronAlphaErrror'] == 3.34
2425

25-
parser = AMEReactionParserTwo(".", 2012)
26+
parser = AMEReactionParserTwo(pathlib.Path("."), 2012)
2627
line = " 204 Tl 81 6656.09 0.29 6365.80 1.25 -12470.19 22.31 13710.68 1.14 8181.16 1.15 7701.67 3.33"
2728
d = parser._read_line(line)
2829

@@ -42,7 +43,7 @@ def test_read_line():
4243
assert d['QNeutronAlpha'] == 7701.67
4344
assert d['QNeutronAlphaErrror'] == 3.33
4445

45-
parser = AMEReactionParserTwo(".", 2016)
46+
parser = AMEReactionParserTwo(pathlib.Path("."), 2016)
4647
line = " 204 Tl 81 6656.08 0.29 6365.85 1.25 -12470.71 22.32 13709.99 1.06 8180.45 1.07 7700.97 3.31"
4748
d = parser._read_line(line)
4849

@@ -63,7 +64,7 @@ def test_read_line():
6364
assert d['QNeutronAlphaErrror'] == 3.31
6465

6566

66-
parser = AMEReactionParserTwo(".", 2020)
67+
parser = AMEReactionParserTwo(pathlib.Path("."), 2020)
6768
line = " 204 Tl 81 6656.0787 0.2907 6365.8379 1.2542 -12470.8182 22.6974 13710.0469 1.0612 8180.5147 1.0721 7701.0380 3.3084"
6869
d = parser._read_line(line)
6970

tests/test_nubase_parse.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# from pynch.nubase_parse import NubaseParser
2-
# import pynch as py
31
import pynch.nubase_parse as nbp
42

3+
import pathlib
54

65
def test_read_halflife_value():
7-
parser = nbp.NubaseParser(".", 2003)
6+
parser = nbp.NubaseParser(pathlib.Path("."), 2003)
87

98
line_01 = "232 0950 232Am 43400# 300# 1.31 m 0.04 91 B+=?;A=2#;B+SF=0.069 10"
109

@@ -15,7 +14,7 @@ def test_read_halflife_value():
1514

1615

1716
def test_read_halflife_error():
18-
parser = nbp.NubaseParser(".", 2003)
17+
parser = nbp.NubaseParser(pathlib.Path("."), 2003)
1918

2019
line_01 = "113 0500 113Sn -88333 4 115.09 d 0.03 1/2+ 00 B+=100"
2120
assert parser._read_halflife_error(line_01) == 0.03
@@ -25,7 +24,7 @@ def test_read_halflife_error():
2524

2625

2726
def test_readable_line():
28-
parser = nbp.NubaseParser(".", 2003)
27+
parser = nbp.NubaseParser(pathlib.Path("."), 2003)
2928

3029
bad_line01 = "003 0030 3Li 28670# 2000# RN p-unst 98 p ?"
3130
bad_line02 = "130 0556 130Csx -86873 17 27 15 R=.2~~~.1 fsmix"
@@ -41,7 +40,7 @@ def test_readable_line():
4140

4241

4342
def test_read_line():
44-
parser = nbp.NubaseParser(".", 2003)
43+
parser = nbp.NubaseParser(pathlib.Path("."), 2003)
4544

4645
iso_line = "183 0791 183Aum -30114 10 73.3 0.4 >1 us (1/2)+ 99 IT=100"
4746
assert parser._read_line(iso_line) == dict()
@@ -79,7 +78,7 @@ def test_read_line():
7978
assert d['Decay'] == "B+"
8079

8180
# 2020 table has a new format
82-
parser = nbp.NubaseParser(".", 2020)
81+
parser = nbp.NubaseParser(pathlib.Path("."), 2020)
8382

8483
# Use the same isotope as previously tested
8584
gs_line = "057 0290 57Cu -47309.0 0.5 196.4 ms 0.7 3/2-* 98 1976 B+=100"

0 commit comments

Comments
 (0)