Set cross_sections for element expansion in Material.add_element() (#2633)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Josh May 2023-08-18 22:20:00 -07:00 committed by GitHub
parent e8de4c18b8
commit 471caa5810
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -642,7 +642,8 @@ class Material(IDManagerMixin):
def add_element(self, element: str, percent: float, percent_type: str = 'ao',
enrichment: Optional[float] = None,
enrichment_target: Optional[str] = None,
enrichment_type: Optional[str] = None):
enrichment_type: Optional[str] = None,
cross_sections: Optional[str] = None):
"""Add a natural element to the material
Parameters
@ -669,6 +670,8 @@ class Material(IDManagerMixin):
Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment
.. versionadded:: 0.12
cross_sections : str, optional
Location of cross_sections.xml file.
Notes
-----
@ -747,7 +750,8 @@ class Material(IDManagerMixin):
percent_type,
enrichment,
enrichment_target,
enrichment_type):
enrichment_type,
cross_sections):
self.add_nuclide(*nuclide)
def add_elements_from_formula(self, formula: str, percent_type: str = 'ao',
@ -1457,7 +1461,7 @@ class Material(IDManagerMixin):
if "cfg" in elem.attrib:
cfg = elem.get("cfg")
return Material.from_ncrystal(cfg, material_id=mat_id)
mat = cls(mat_id)
mat.name = elem.get('name')