Skip to content

Commit b40e639

Browse files
authored
Merge pull request #34 from openmc-data-storage/grouping-reactions-when-writting-single-file
corrected temperature;
2 parents b85f85a + 6d76616 commit b40e639

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/openmc_data_to_json/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,9 @@ def cross_section_h5_file_to_json_file(
406406
'Atomic symbol': dict_of_reactions[0]["Atomic symbol"],
407407
'Incident particle': dict_of_reactions[0]["Incident particle"],
408408
'Library': dict_of_reactions[0]["Library"],
409-
410409
}
410+
#TODO check if multiple temperatures are present
411+
temperature_found = dict_of_reactions[0]['Temperature(K)']
411412
for entry in dict_of_reactions:
412413
del entry["uuid"]
413414
del entry["Proton number"]
@@ -419,8 +420,7 @@ def cross_section_h5_file_to_json_file(
419420
del entry["Incident particle"]
420421
del entry["Library"]
421422

422-
# could get temperature key from dict_of_reactions, instead getting from user args
423-
dict_of_multiple_reactions['Temperature(K)'] = {temperature: dict_of_reactions},
423+
dict_of_multiple_reactions['Temperature(K)'] = {temperature_found: dict_of_reactions},
424424

425425
with open(output, "w") as fout:
426426
json.dump(dict_of_multiple_reactions, fout, indent=indent)

0 commit comments

Comments
 (0)