You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add model.description attribute and persist to model.xml output #3586
Add a description attribute to the openmc.Model class, allowing users to store an arbitrary description string for the model. This description should be written as an XML element in the model.xml file when exported via export_to_model_xml. If possible, also add support for reading the description back into the model when loading from XML via from_model_xml.
This feature will make it easier to document models, track provenance, and automate workflows where model metadata is useful.
Proposed change:
Add a description property/attribute to the Model class, defaulting to an empty string.
Update export_to_model_xml to include a <description>...</description> element right after the <model> root tag.
Update from_model_xml to read the <description> element and populate the new model attribute.
Ensure round-trip compatibility: description set on model ➜ saved in XML ➜ loaded back into Python.
Optionally, document and test this feature.
Alternatives
Continue to use Python-only ad-hoc attributes (not saved in XML).
Use external metadata files (less convenient, not coupled to model).
Overload an existing field (not semantically correct).
Compatibility
This enhancement adds a new attribute and XML element. If implemented to be optional and default to empty, it should not break existing models or workflows.
Models created with a description will still be readable by older OpenMC versions, which should ignore the unknown <description> element in XML.
Activity
feat(model): add Model.description attribute persisted in model.xml