Skip to content

Add description attribute to Model#3956

Merged
GuySten merged 2 commits into
openmc-dev:developfrom
EdenRochmanSharabi:feature/model-description
Jul 23, 2026
Merged

Add description attribute to Model#3956
GuySten merged 2 commits into
openmc-dev:developfrom
EdenRochmanSharabi:feature/model-description

Conversation

@EdenRochmanSharabi

Copy link
Copy Markdown
Contributor

Closes #3586.

Adds a description property to Model that allows users to attach
a free-text description to a model instance.

  • The description is written as a <description> element in model XML
    and read back via from_model_xml.
  • An empty description (the default) is omitted from the output.
  • Type-checked via check_type.

Tests cover round-trip serialization, empty-description omission, and
empty round-trip.

Allow users to attach a free-text description to a Model
instance. The description is written as a <description>
element in model XML and read back on import. An empty
description is omitted from the output.

@GuySten GuySten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
@EdenRochmanSharabi, next time please keep the default pull request checklist.

@GuySten GuySten added Other Enhancement Merging Soon PR will be merged in < 24 hrs if no further comments are made. XML labels Jul 22, 2026

@paulromano paulromano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Sorry for the delay on this relatively simple PR. Note that I fixed one issue on the branch with respect to XML escaping (modified test illustrates the problem).

@eepeterson @shimwell Do you guys have any opinions on this? If my memory serves me correctly, I feel like some combination of us had discussed this before.

@shimwell

Copy link
Copy Markdown
Member

I am in favor of meta like this model.description . I think we had chatted about meta data in the nuclear data before which is perhaps related. but yes LGTM

@GuySten
GuySten merged commit a533fcd into openmc-dev:develop Jul 23, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merging Soon PR will be merged in < 24 hrs if no further comments are made. Other Enhancement XML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add model.description attribute and persist to model.xml output

4 participants