Replies: 1 comment 1 reply
-
Argument in favor of function: Argument in favor of property:
Since these operations do not perform computationally expensive operations or have side effects or perform actions, they should be accessed as properties. Therefore, IMO, the property notation is a better fit. |
Beta Was this translation helpful? Give feedback.
-
Release
The alpha release of version 1.0.0 is now available on PyPI, and we need alpha testers.
To install this version specifically (in an isolated conda or virtual environment might be a good idea) run:
Changes
This release primarily focuses on redesigning the material interface. For details see the migration guide. Also the updated getting started guide shows how to use a lot of these new features.
The biggest change is that
Material
is no longer a wrapper of dictionary; it now behaves like a list.This will make it a lot easier to do the following with materials:
nlib=80c
for a specific materialmontepy.Nuclide("U-235m1.80c")
This will also make it a lot easier to work with MontePy objects in general by:
cell.nuber = 5
from having no effect.montepy.Cell("1 0 -2 imp:n=1")
. In a lot of cases it's a better idea to do:problem.parse("1 0 -2 imp:n=1")
.Features Added
Material Interface Changes
Mat redesign #507
montepy.Nuclide("H-1.80c")
Improve Isotope Instantiation #505
Material strings can become unruly. #144
Allow querying materials by elements #95
nlib
, from a materialAdd support for particle specific libraries and default libraries. #369
montepy.Cell
.Material.is_atom_fraction
settableMake
Material.is_atom_fraction
settable #511General Updates
Implement __slots__ to avoid user confusion #508
Make NumberedObjectCollection act like a set #138
Remove duplicate objects without relying on Hashing #63
Improve ab initio DataCard __init__ #88
MCNP_Problem.parse
to parse arbitrary MCNP objectImprove ab initio DataCard __init__ #88
Bugs Fixed
Can't make a material from scratch and export it. #512
Support poorly formatted Material definitions #182
Breaking Changes
Material.material_components
Mat redesign #507
Isotope
and changed them toNuclide
MCNP_Problem.add_cell_children_to_problem
as it is no longer needed.Feedback/ Ask
We ultimately need users to play with these changes in realistic situations, and find things that are broken, or that are not quite right. You can open new issues with this feedback or add them to this thread.
If you find MontePy useful, please give us a star.
Questions
Here are some open questions I have about the design I would like feedback on:
Should
material.values
andmaterial.nuclides
not be properties but functions?Does the way of specifying a
montepy.Nuclide
make sense?Does the following ways of searching make sense and behave predictably?
nuclide in material
material.contains()
materials.get_containing()
Beta Was this translation helpful? Give feedback.
All reactions