Skip to content

✨ Matml Importer - #10

Open
je-cook wants to merge 7 commits into
mainfrom
je-cook/matml
Open

✨ Matml Importer#10
je-cook wants to merge 7 commits into
mainfrom
je-cook/matml

Conversation

@je-cook

@je-cook je-cook commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

Allows importing from MatML xml format, I have included the spec as it was a bit difficult to find online.

TODO

  • finish converter

@je-cook
je-cook marked this pull request as ready for review September 22, 2025 09:45
"qualifier": ["Dependent"] * len(prop_data),
}
# TODO @je-cook: Add independent parameter_value
# 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Need to change once issue opened


if (comp := char.chemical_composition) is not None: # noqa: F841
# TODO @je-cook: Process Elements more thoroughly
# 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

need to change once issue opened

@CoronelBuendia CoronelBuendia 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.

Whistlestop doc/API review.

We aim to offer a variety of converters to different formats where direct interfacing cannot easily be achieved.

We currently offer coverters to a few select neutronics packages but this area will be expanded as the `matproplib` matures.
We currently offer coverters to a few different formats, this will be expanded as the `matproplib` matures.

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.

Suggested change
We currently offer coverters to a few different formats, this will be expanded as the `matproplib` matures.
We currently offer converters to a few different formats, this will be expanded as `matproplib` matures.


##### Import

To import a material from a MatML 3.1 xml file. If the importer is unable to process a specific property you specifiy it in `skip_properties`

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.

Suggested change
To import a material from a MatML 3.1 xml file. If the importer is unable to process a specific property you specifiy it in `skip_properties`
To import a material from a MatML 3.1 xml file. If the importer is unable to process a specific property, you can specify it in `skip_properties`

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.

First sentence is not really a sentence!

##### Import

To import a material from a MatML 3.1 xml file. If the importer is unable to process a specific property you specifiy it in `skip_properties`
to ignore it. Please bare with us while we enable importing for different property types.

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.

Suggested change
to ignore it. Please bare with us while we enable importing for different property types.
to ignore it. Please bear with us while we enable importing for different property types.

Comment on lines +55 to +56
"tensile_ultimate_strength": "average_ultimate_tensile_stress",
"tensile_yield_strength": "average_yield_stress",

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.

Hmm tricky... it's probably fine, but this should technically be something the user decides somehow (e.g. minimum). I would not change anything, just leaving this for posteriority

"""Function to convert material to secondary format"""

@classmethod
def import_from(cls, obj, /) -> Material:

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.

Would it be possible to have an export_to on materials (or within their converters somehow).

I'm thinking that something along the lines of:

my_steel.export_to_xml("my_file.xml")

or a similar one-liner would be nice (not that I would use it...)

I know that at present it is only my_steel.convert(...).export(); just thinking what a typical tripping up point would be for a new user who maybe doesn't assiduously readthedocs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants