Replies: 12 comments 39 replies
-
Other thought: there needs to be a way to update and view the libraries for every component, and also see the particle specific libraries. Maybe something like: mat.def_libraries["neutron"] = "00c"
mat.iso_libraries[1001] = "80c" |
Beta Was this translation helpful? Give feedback.
-
For the next minor release, this makes sense. A compatibility-breaking release that adds a friendly interface to materials and their components will be welcome in the future : ) For the cross section library, continuing to support the extension would be intuitive to users. At the very least, |
Beta Was this translation helpful? Give feedback.
-
Reading section
I'm interpreting |
Beta Was this translation helpful? Give feedback.
-
For atomic data which should be valid?
Requiring an explicit |
Beta Was this translation helpful? Give feedback.
-
Other thought: how should slices be handled? I think should probably be the method >>> mat["U",:]
{Isotope: ..., } |
Beta Was this translation helpful? Give feedback.
-
See these two gists for some thoughts I had: Some initial feedback I have gotten from @pshriwise is that this isn't pythonic. It specifically violates the principle:
Given this I think this should be greatly simplified, and only one (maybe) two ways should be allowed. ZAID is not an option, IMO. I think symbol-A[meta][.library] notation should be that way. e.g.,
As for slicing this creates a great justification for tuple notation. Once again simplification is needed. I think Finally @gonuke was concerned with library slicing. It isn't the most intuitive. As proposed |
Beta Was this translation helpful? Give feedback.
-
Next discussion: assuming #504 is the case. How should repeated nuclides be handled? Current work For the current design in This pointer is a nested dictionary that is structured as:
So the current interface would be: >>>mat["U-235.80c"]
0.05 However, if duplicate entries are supported this would need to return an iterable (at least sometimes). One option is to always have it return a list: >>>mat["U-235"]
[0.05]
>>>mat["U-238"]
[0.05, 0.10] There's complicated in between options when it would sometimes return a scalar or an iterable. But that feels janky. Using lists can lead to ambiguity. Imagine the two materials:
Both materials would return >>>mat["H-1"]
[0.01, 0.01, 0.01, 0.01] But those entries would have different ambiguous meanings. One option to avoid this would be to return a dictionary (or Material container thingy) whenever slicing occurs. So in the above example: >>> materials[1]["H-1"]
{Isotope("1001.80c"): [0.01] * 4}
>>> materials[2]["H-1"]
{Isotope("1001.00c"): [0.01, 0.01], Isotope("1001.80c"): [0.01, 0.01]} This final interface feels the most correct because:
Though whenever setting values having to work with a list inside of a dictionary violates:
|
Beta Was this translation helpful? Give feedback.
-
Implementing DundersWhich dunders ( So far these will be implemented:
New proposed ones. Specifically ones for doing easy material mixing. This works well with the submaterial concept that @dodu94 has:
Weirder ones that might be interesting:
Misc:
|
Beta Was this translation helpful? Give feedback.
-
Other thought: should there be immutable Materials? I feel like some materials should be immutable. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
The 1.0 Migration documentation should provide guidance on how to replace deprecated user-facing functionality; namely, |
Beta Was this translation helpful? Give feedback.
-
The next question is: how should we provide information about the libraries that will actually be used? As a reminder the precendence is:
Reading Xsdir is out of scope right now. How should users get this info? is it |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As has been discussed for awhile the interface for
Material
,MaterialComponent
, etc. needs to be overhauled. So here's the overall thoughts I have so far.Material
to avoid a major release.Isotope
parse all isotope formats that I like (see Add support for MCNP 6.3.1 materials #179). I'm thinking only the set:'1001'
1001
'H-1'
'H1'
'hydrogen-1'
'hydrogen1'
'h-1m1'
...('h', 1)
(Element('H'), 2)
('hydrogen', 3)
Material.material_components
as is.Material
a duck dictionary. This would accept any validIsotope
instance orIsotope
string (above), and then return the fraction as a float.So I think the following code should all be valid:
Thoughts @tjlaboss?
Beta Was this translation helpful? Give feedback.
All reactions