mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Merge pull request #1489 from SamPUG/develop
Fixed bug which prevents creating photon data with no atomic relax
This commit is contained in:
commit
e7514e1122
2 changed files with 10 additions and 2 deletions
|
|
@ -784,8 +784,9 @@ class IncidentPhoton(EqualityMixin):
|
|||
sub_group = shell_group.create_group(key)
|
||||
|
||||
# Write atomic relaxation
|
||||
if key in self.atomic_relaxation.subshells:
|
||||
self.atomic_relaxation.to_hdf5(sub_group, key)
|
||||
if self.atomic_relaxation is not None:
|
||||
if key in self.atomic_relaxation.subshells:
|
||||
self.atomic_relaxation.to_hdf5(sub_group, key)
|
||||
else:
|
||||
continue
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from collections.abc import Mapping, Callable
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
|
@ -144,3 +145,9 @@ def test_export_to_hdf5(tmpdir, element):
|
|||
element2.bremsstrahlung['electron_energy']).all()
|
||||
# Export to hdf5 again
|
||||
element2.export_to_hdf5(filename, 'w')
|
||||
|
||||
def test_photodat_only(run_in_tmpdir):
|
||||
endf_dir = Path(os.environ['OPENMC_ENDF_DATA'])
|
||||
photoatomic_file = endf_dir / 'photoat' / 'photoat-001_H_000.endf'
|
||||
data = openmc.data.IncidentPhoton.from_endf(photoatomic_file)
|
||||
data.export_to_hdf5('tmp.h5', 'w')
|
||||
Loading…
Add table
Add a link
Reference in a new issue