Skip to content

Commit a4461de

Browse files
[fix #26] now BSTAC import works
1 parent 6eca1db commit a4461de

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/libeq/parsers/bstac.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def parse_model(lines, icd, nc) -> list[dict[str, Any]]:
107107
]
108108

109109
if icd == 0:
110-
process_func = sections[1]
110+
process_func = sections[0]
111111
model_columns = (
112112
[
113113
"BLOG",
@@ -120,7 +120,7 @@ def parse_model(lines, icd, nc) -> list[dict[str, Any]]:
120120
+ [f"IKA{i}" for i in range(1, 10)]
121121
)
122122
else:
123-
process_func = sections[0]
123+
process_func = sections[1]
124124
model_columns = (
125125
[
126126
"BLOG",
@@ -178,7 +178,7 @@ def parse_BSTAC_file(lines):
178178
["IREF", "AT", "BT", "c0", "c1", "d0", "d1", "e0", "e1", "KCD"],
179179
), # IREF,AT,BT,c0,c1,d0,d1,e0,e1,KCD(1...6)
180180
(
181-
lambda line: [float(part) for part in line.split()],
181+
lambda line: [int(part) for part in line.split()],
182182
1,
183183
"charges",
184184
), # Z(1...NC)

tests/test_legacy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ def test_import_superquad():
2121
assert popts.beta_flags == [Flags.REFINE, Flags.REFINE, Flags.REFINE,
2222
Flags.REFINE,Flags.CONSTANT]
2323
assert popts.weights == 'calculated'
24+
25+
26+
def test_import_bstac():
27+
data = SolverData.load_from_bstac("tests/data/namototc.mis")

0 commit comments

Comments
 (0)