idaholab / MontePy

MontePy is the most user friendly Python library (API) to read, edit, and write MCNP input files.
https://www.montepy.org/
MIT License
32 stars 6 forks source link

Material strings can become unruly. #144

Open MicahGale opened 1 year ago

MicahGale commented 1 year ago

When you print a material a list of all its elements are included. For depleted fuel this can become ... very unruly. Should implement a numpy style snip that cuts out a lot of the middle bits.

MicahGale commented 10 months ago

In addition the elements should be sorted by composition. It's hard for anyone but a materials scientist to see that: 'magnesium', 'aluminum', 'silicon', 'chromium', 'manganese', 'iron', 'copper', 'zinc', 'tin' is aluminum-6061.

MicahGale commented 9 months ago

I keep coming back: and really wanting the composition sorting.

SterlingButters commented 9 months ago

In addition the elements should be sorted by composition. It's hard for anyone but a materials scientist to see that: 'magnesium', 'aluminum', 'silicon', 'chromium', 'manganese', 'iron', 'copper', 'zinc', 'tin' is aluminum-6061.

Should again consider https://github.com/idaholab/MontePy/discussions/344#discussioncomment-8337827 for material labeling (not necessarily the sorting)

MicahGale commented 9 months ago

To clarify this isn't about writing to file this is just for printing when examining a material:

print(material)

SterlingButters commented 9 months ago

I'm a little surprised that MCNP doesn't support named materials - or do they? If, so, could just be on the user to do so. If not, you could still leverage the JSONification for this (imo).

MicahGale commented 9 months ago

Do you mean by being able to label m1 as water or being able to define a material as being water?

SterlingButters commented 9 months ago

@MicahGale I feel like either would resolve the issue right? But AFAICT, there isn't any native way to do this in MCNP.

MicahGale commented 9 months ago

Yes you are right, neither of these features is supported by MCNP natively, much to everyone's chagrin.

So next steps on your idea: I think all of these would be a separate issue:

  1. Extend the scope of #76.
  2. Add common composition data (at least elemental) data to simplify generating new materials. I am warry of doing this as we would then be responsible for a rather large data set. Though people can't sue us over getting it wrong, they can still complain loudly.
SterlingButters commented 9 months ago

2. Add common composition data (at least elemental) data to simplify generating new materials. I am warry of doing this as we would then be responsible for a rather large data set. Though people can't sue us over getting it wrong, they can still complain loudly.

Honestly, I don't think it will be long before people request the PNNL Material Compendium anyhow