Bugs Fixed
- Fixed bug where values for user generated objects would be rounded off at five digits no matter what. This will now round off at 15 digits if necessary (:issue:`962`).
Feature Added
- Added surface classes to support almost all surface types such as :class:`~montepy.XPlane` and :class:`~montepy.YTorus` (:issue:`502`).
Cell.universecan now be set toNone(or deleted viadel cell.universe) to reset the universe assignment back to the default (:issue:`902`).- Added
extend_renumbertoNumberedObjectCollectionwith related test cases (:issue:`881`). - Made :class:`montepy.data_inputs.importance.Importance` more
dict-like withkeys,values, anditemsfunctions (:pull:`921`).
Bugs Fixed
- Fixed a bug where surface type mnemonics (e.g.
SO,PZ) were always written in uppercase, discarding the original case supplied by the user (e.g.sO,Pz) (:issue:`522`). - Fixed a bug where
append_renumberraised aTypeErrorwhen called with an object whosenumberisNone(e.g. an object created with no arguments) (:issue:`880`). - Fixed a bug where the importance of cells made from scratch are usually not printed to the output file (:pull:`921`).
Performance Improvement
- Removed Guardrails from :class:`~montepy.numbered_object_collection.NumberedObjectCollection` (:issue:`895`)
Documentation
- Enable Sphinx nitpicky mode and fix ~30 broken cross-references in the developer guide, user guide, and migration docs (:issue:`889`).
- Remove redundant "montepy.*" prefix from navigation in the API docs (:issue:`901`).
Performance Improvement
- Implement
_collection_refto link objects to theirNumberedObjectCollectionparent (:issue:`849`).
Features Added
- Added support for
Surfacesubtypes for spheres (:issue:`876`).
Bugs Fixed
- Fixed a bug where
&=and|=for geometry definitions (HalfSpace) were not handled operator precedence properly (:issue:`879`).
Documentation
- Clarify vacuum boundary condition / zero-importance cell / graveyard (:issue:`744`).
Performance Improvement
- Optimized \mathcal{O}(N^2) scaling in :func:`~montepy.numbered_object_collection.NumberedObjectCollection.request_number` by improving
NumberedObjectCollection.check_numberto \mathcal{O}(N) (:issue:`786`).
Features Added
- Added checking for additional input after the
datablock, and raising a warning if it exists (:issue:`525`). - Allow multiple universe fills to accept 2D MNCP lattices (:issue:`719`).
- Make
LatticeType.RECTANGULARandLatticeType.HEXAHEDRALsynonymous (:issue:`808`). - Allow setting
cell.fill.universeswith a numpy array of universe IDs (:issue:`736`). - Added Boundary condition type to the representation of a
montepy.Surface(e.g.,repr(surf)) (:issue:`682`). - Changed default importance value from 0.0 to 1.0 to match MCNP defaults. (:issue:`735`)
Bugs Fixed
- Fixed bug where lines that were the allowed length was raising a
LineOverRunWarningwhen read by MontePy (:issue:`517`). - Added descriptive TypeError messages (:issue:`801`)
- Fixed a bug that caused to write an extra termination line between the data block and the cell data section in the MCNP input. (:pull:`819`) (:issue:`703`).
- Avoided parsing
FMESHinputs that have more complicated syntax to parse (:issue:`846`).
Documentation
Added a web browser instance of
jupyterto the website allowing testing out MontePy with no python installed locally (:issue:`796`)... jupyterlite:: :new_tab: True :new_tab_button_text: Launch jupyter in your browswerImproved documentation for :class:`~montepy.numbered_object_collection.NumberedObjectCollection` on Slicing behavior. (:issue:`798`)
Reorganized Python API documentation. Some hyperlinks may be broken now (:pull:`828`).
Deprecations
- Dropped support for python 3.9 through 3.11, and numpy 1.26 in order to comply with SPEC 0 (:issue:`780`).
Documentation
- Improved documentation for :class:`~montepy.numbered_object_collection.NumberedObjectCollection` on Slicing behavior. (:issue:`798`)
Bugs Fixed
- Fixed bug where lines that were the allowed length was raising a
LineOverRunWarningwhen read by MontePy (:issue:`517`). - Added descriptive TypeError messages (:issue:`801`)
Code Quality
- Refactor
montepy.errorstomontepy.exceptions, to reflect that it also contains warnings (:issue:`764`).
Deprecations
- Marked
montepy.errorsas deprecated, with aFutureWarning, usemontepy.exceptionsinstead. (:issue:`764`).
Bugs Fixed
- Fixed parsing error where MontePy could not handle a fill matrix that was sparse (:issue:`601`).
Features Added
- Added demonstration jupyter notebooks for working with Pin Cell and PWR assemblies in MontePy.
Bugs Fixed
- Fixed bug where surfaces created from scratch couldn't be accurately written out to the file (:issue:`652`).
- Fixed bug where surface transformations couldn't be unset and exported properly (:issue:`711`).
- Fixed bug where negative numbers were treated as valid by
append_renumber(:issue:`690`). - Fixed bug that couldn't parse
SDEFby simply not parsing the input for the time being (:pull:`767`). - Fixed parsing bug with
DE LOGstyle inputs by simply not parsing them for now (:pull:`767`).
Features Added
- Added
Universe.filled_cells, a generator that yields the cells filled with that universe instance (:issue:`361`). - Added
__eq__dunder method toUniverseto support equality comparisons (:issue:`361`). - Changed general plane constants checker to support more than 9 constants (:issue:`761`).
Bugs Fixed
- Fixed bug where MontePy would overly aggressively round outputs and remove the user's intent (:issue:`756`).
- Fixed bug where a cell complement in the first five characters causes a spurious vertical mode detection (:issue:`753`).
Features Added
- Redesigned how Materials hold Material_Components. See :ref:`migrate 0 1` (:pull:`507`).
- Made it easier to create an Isotope (now Nuclide):
montepy.Nuclide("H-1.80c")(:issue:`505`). - When a typo in an object attribute is made an Error is raised rather than silently having no effect (:issue:`508`).
- Improved material printing to avoid very long lists of components (:issue:`144`).
- Allow querying for materials by components (:issue:`95`), either broadly or specifically (:issue:`642`).
- Added support for getting and setting default libraries, e.g.,
nlib, from a material (:issue:`369`). - Added most objects to the top level so they can be accessed like:
montepy.Cell. - Made
Material.is_atom_fractionsettable (:issue:`511`). - Made NumberedObjectCollections act like a set (:issue:`138`).
- Automatically added children objects, e.g., the surfaces in a cell, to the problem when the cell is added to the problem (:issue:`63`).
- Added ability to parse all MCNP objects from a string (:issue:`88`).
- Added function: :meth:`~montepy.MCNP_Problem.parse` to parse arbitrary MCNP object (:issue:`88`).
- An error is now raised when typos in object attributes are used, e.g.,
cell.nubmer(:issue:`508`). - Warnings are no longer raised for comments that exceed the maximum line lengths (:issue:`188`).
- Particle type exceptions are now warnings, not errors (:issue:`381`).
- Added :meth:`~montepy.Material.clear` to
Materialto clear out all nuclides (:issue:`665`). - Allow any
Realtype for floating point numbers and anyIntegraltype for integer numbers during type enforcement (:issue:`679`). - Avoided multiple
LineExpansionWarningscoming from the same object on export (:issue:`198`). - Added
mcnp_strfunction to allMCNP_Objectto quickly get the string that would be printed in the MCNP input file (:issue:`700`). - Added
montepy.MCNP_VERSIONas an easy way to set the default MCNP version to target for reading and writing input files (:issue:`700`). - Renamed
Cell.latticetoCell.lattice_type,LatticetoLatticeType, andLatticeType.HEXAHEDRAtoLatticeType.HEXAHEDRALwith deprecation warnings (:issue:`728`).
Bugs Fixed
- Made it so that a material created from scratch can be written to file (:issue:`512`).
- Added support for parsing materials with parameters mixed throughout the definition (:issue:`182`).
- Fixed bug where
surf.is_reflectingwould put an extra space in the output e.g.,* 1 PZ...(:issue:`697`). - Fixed bug where setting a lattice would print as
LAT=None. Also switchedCellModifierto print in the cell block by default (:issue:`699`). - Fixed bug that wouldn't allow cloning most surfaces (:issue:`704`).
- Fixed bug that crashed when some cells were not assigned to any universes (:issue:`705`).
- Fixed bug where setting
surf.is_reflectingtoFalsedid not always get exported properly (:issue:`709`). - Fixed bug where setting multiple universes for a cell fill not being properly exported (:issue:`714`).
- Fixed bug where the
i("x") andk("z") dimensions of multiple universe matrixfillswere switched (:issue:`726`). - Fixed bug 549 — corrected blank importance printing issue (:issue:`549`).
Breaking Changes
- Removed
Material.material_components. See :ref:`migrate 0 1` (:pull:`507`). - Removed :class:`~montepy.data_inputs.isotope.Isotope` and changed them to :class:`~montepy.data_inputs.nuclide.Nuclide`.
- Removed
MCNP_Problem.add_cell_children_to_problemas it is no longer needed.
Deprecated code Removed
montepy.Cell.geometry_logic_stringmontepy.data_inputs.cell_modifier.CellModifier.has_changed_print_stylemontepy.data_inputs.data_input.DataInputAbstractclass_prefixhas_numberhas_classifier
montepy.input_parser.mcnp_input.Cardmontepy.input_parser.mcnp_input.ReadCardmontepy.input_parser.mcnp_input.Input.wordsmontepy.input_parser.mcnp_input.Commentmontepy.input_parser.mcnp_input.parse_card_shortcutsmontepy.mcnp_object.MCNP_Objectwrap_words_for_mcnpcompress_repeat_valuescompress_jump_valueswordsallowed_keywords
Bug Fixes
- Fixed parsing bug with sigma baryon particles (e.g.,
+/-) (:issue:`671`).
Bug Fixes
- Fixed parsing error with not being able to parse a blank
sdef(:issue:`636`). - Fixed parsing error with parsing
SSW(:issue:`639`).
Bug Fixes
- Fixed how material components work so new components can actually be added to a material and exported (:issue`597`).
Error Handling
- Added the input file, line number, and the input text to almost all errors raised by
MCNP_Object(:pull:`581`).
Bug Fixes
- Fixed
AttributeErrorthat occured when a data blockIMPwas preceded by a comment (:issue:`580`). - Fixed bug where tally inputs in a file prevented the file from being pickled or copied (:issue:`463`).
Features Added
- Added
clonemethod to simplify making copies of objects (:issue:`469`).
Performance Improvement
- Fixed cyclic memory reference that lead to memory leak in
copy.deepcopy(:issue:`514`). - Fixed O(N2) operation in how append works for object collections like Cells (:issue:`556`).
Bug Fixes
- Fixed bug with parsing an
EOinput (:issue:`551`). - Fixed a bug raised in an edge case when editing cell geometry, by making the error clearer (:issue:`558`).
- Fixed bug with having a shortcut in a cell fill (:issue:`552`).
- Fixed bug where file streams couldn't actually be read (:pull:`553`).
Support
- Added support for Python 3.13, and removed support for Python 3.8, and officially added support NumPy 1 & 2 (:pull:`548`).
Features Added
- Added support for reading an input from either file paths or streams (file handles) with
montepy.read_input(:issue:`519`).
Bug Fixes
- Fixed a bug where
problem.materials.append_renumberwould double add a material toproblem.data_inputs(:issue:`516`). - Fixed bug where material-level library specifications (e.g.,
m1 plib=84p) could not be fully parsed (:issue:`521`). - Fixed bug with shortcuts right after another shortcut (e.g.,
1 2M 3R) not being properly recompressed on export (:issue:`499`). - Fixed bug with shortcuts in cell geometry definitions not being recompressed on export (:issue:`489`).
- Fixed bug where leading comments were not always transferred to the appropriate input. (:issue:`352`, :issue:`526`).
Performance Improvement
- Fixed method of linking
MaterialtoThermalScatteringobjects, avoiding a very expensive O(N 2) (:issue:`510`).
Deprecations
- Marked
Material.material_componentsas deprecated, and created migration plan describing what to expect moving forward (:issue:`506`).
Features Added
- Write problems to either file paths or streams (file handles) with MCNP_Problem.write_problem() (:issue:`492`).
- When adding a material to problem.materials it will also be added to problem.data_inputs, ensuring it is printed to the file (:pull:`488`).
Bug Fixes
- Fixed bug that didn't show metastable states for pretty printing and isotope. Also handled the case that Am-241 metstable states break convention (:issue:`486`).
- Fixed bug where cell modifiers could be made irrelevant by being added after a comment (:issue:`483`).
- Fixed bug where parentheses in cell geometry are not properly exported (:pull:`491`).
Bug fixes
- Fixed bug with material compositions not being updated when written to file (:issue:`470`).
- Fixed bug with appending and renumbering numbered objects from other MCNP problems (:issue:`466`).
- Fixed bug with dynamic typing and the parsers that only appear in edge cases (:issue:`461`).
- Fixed parser bug with having spaces in the start of the transform input for the fill of a cell (:pull:`479`).
- Fixed bug with trying to get trailing comments from non-existent parts of the syntax tree (:pull:`480`).
Code Quality
- Simpler
Isotoperepresentation (:issue:`473`).
Bug fixes
- Fixed bug with trailing dollar sign comments that moved them to a new line. (:issue:`458`).
Bug fixes
- Fixed parser bug with parsing cells with implicit intersection, e.g.,
(1:-2)(3:-4). (:issue:`355`).
Features Added
overwriteargument added toMCNP_Problem.write_to_fileto ensure files are only overwritten if the user really wants to do so (:pull:`443`).
Bug fixes
- Fixed bug with
SDEFinput, and made parser more robust (:issue:`396`).
Bug fixes
- Fixed bug with parsing tally segments (:issue:`377`)
Documentation
- Added link to the PyPI project on the Sphinx site (:issue:`410`)
- Added link shortcuts for MCNP manual, and github issues and pull requests (:pull:`417`).
- Added discussion of MCNP output files to FAQ (:issue:`400`).
- Updated MCNP 6.3 manual link to point to OSTI/DOI (:issue:`424`).
CI/CD
- Fixed project metadata for author to show up correctly on PyPI (:pull:`408`)
- Removed automated versioning from CI/CD, and simplified deploy process (:pull:`418`)
Bug fixes
- Made versioning system more robust for all situations (:issue:`386`).
- Fixed bug with handling read inputs, and made parser more efficient (:issue:`206`)
- Fixed bug that couldn't read materials without a library. E.g., 1001 vs. 1001.80c (:issue:`365`).
Documentation
- Added changelog
- Added contribution guideline
- Added pull request template
CI/CD
- Improved coveralls integration so actual source code can be shown.
- Improved sphinx build process (:issue:`388`)
Added
- Implemented Github actions
- Added default github issue templates
Changed
- Improved readme and documentation hyperlinks
Fixed
- bug with comments in complex geometry.
Added
- Public release
Added
- A license
- A logo
Changed
- Explicitly set file encoding for read/write. :issue:`159`.
Fixed
- Bug with not detecting comments with no space e.g., cn. :issue:`158`.
Fixed
- TODO
Fixed
- A bug with the packaging process
Added
- User formatting is preserved automatically
- Cell geometry is now stored in
cell.geometryand can be set with bitwise operators. e.g.,cell.geometry = + inner_sphere & - outer_sphere. This was heavily influenced by OpenMC. - You can now check an input file for errors from the command line.
python -m montepy -c /path/to/inputs/*.imcnp - The error reporting for syntax errors should be much more intuitive now, and easy to read.
- Dollar sign comments are kept and are available in
obj.comments - All comments are now in a generator
.comments
Deprecated
montepy.data_cardsmoved tomontepy.data_inputsmontepy.data_cards.data_cardis nowmontepy.data_inputs.data_inputMontepy.Cell.geometry_logic_stringwas completely removed.- Much of the internal functions with how objects are written to file were changed and/or deprecated.
montepy.data_cards.data_card.DataCard.class_prefixwas moved to_class_prefixas the user usually shouldn't see this. Same goes forhas_classifierandhas_number.- Most of the data types inside
montepy.input_parser.mcnp_inputwere deprecated or changed
Added
- License information
fixed
- Fixed bug that
+=didn't work with Numbered object collections - Updated the Documentation URL for sphinx
- Improved (and then removed) guidance on weird gitlab installation workflow.
Fixed
- When a
PXstyle surface was1 PZ 0this would cause a validation error. - Empty "cell modifiers" would be printed in the data block even if they had no useful information. E.g.,
U 30J - Volumes couldn't start with a jump e.g.,
vol j 1.0 - "Cell modifiers" were printed both in the cell block and the data block.
- Running
problem.cells = []would make the problem impossible to write to file. - Support was added for tabs.
Added
- Added infrastructure to support cell modifier inputs easily
- Added support for importances, and particle modes:
imp,mode. - Added support for cell volumes
vol. - Add support for Universes, lattices, and fills
U,fill,lat. - Created universal system for parsing parameters
- If you create an object from scratch and write it out to a file while it is missing, it will gracefully fail with a helpful error message.
- Added support for detecting metastable isotopes.
- Improved the experience with densities in
Cellinstead of havingcell.densitynow there iscell.mass_densityandcell.atom_density.
Fixed
- Supported parameters that don't have equal signs. MCNP supports
1 0 -1 u 1 - Now doesn't try to expand shortcuts inside of
FCandSCcomments.
Code Quality
- Removed magic numbers for number of characters in a line.
- Reduced the usage of regular expressions
- Made error messages related to invalid user set attributes clearer.
- Cleaned up documentation and docstrings
- Improved CI backend
Added:
NumberedObjectCollectionswhich is implemented forcells,surfaces, andmaterials. This changed these collections from being a list to acting like a dict. Objects are now retrievable by their number e.g.,cells[1005]will retrieve cell 1005.- Implemented "pass-through" of the original inputs. If an object is not edited or mutated, the original formatting from the input file will be copied out to the output.
- Support was added for most MCNP shortcuts: (
R,I,M,LOG),Jstill needs some better support. MontePy will expand these shortcuts, but will not "recompress" them. - Added sphinx documentation website. This documents the API, has a starting guide for the users, and a guide for developers.
Changed:
- Object numbers are now generalized: e.g.,
cell.cell_numberhas changed tocell.number. The.numberproperty is standardized across all numbered objects.
Fixed:
- Comments in the middle of an input no longer breaks the input into two.