Releases: idaholab/MontePy
0.2.5 beta
Minor patch release:
- Implemented Github actions
- Added default github issue templates
- Improved readme and documentation hyperlinks
- Fixed bug with comments in complex geometry.
0.2.4beta
0.2.3 Beta
0.2.2 beta
0.2.1 beta
This was a quick release that fixed a small bug with the packaging information that was breaking our pages deployment process.
v0.2.0
Release 0.2.0 beta
tl;dr: User formatting is now preserved, and geometry logic is truly implemented in MontePy now.
This is a very large release that has been in development for about a year.
This completely rewrote the majority of the code base.
This does break some backwards compatibility, and adds a new dependency out of necessity.
Why was this necessary
All previous versions of MontePy used "lazy" parsing.
The line was split up into chunks of space separated values,
then each object would take the first chunk and interpret it, etc.
This threw away user formatting.
Also this couldn't handle geometry logic easily.
Using this form of parsing it could be possible to interpret the logic using reverse polish notation.
However, an easier way would to be form binary trees for each operation, and then crawling that tree explicitly represents the geometry logic.
To preserve user formatting and geometry logic a concrete syntax tree had to be created.
To do this you need to truly parse the inputs as a context-free language with a Lexer and Parser.
The library SLY (SLY Lex Yacc) was chosen to provide the Lexer and Parser (yet another compiler-compiler (Yacc)).
This was chosen because it is implemented in purely python and has no dependencies,
making it very easy to install for our users.
Implementing SLY meant actually writing rigorous grammar rules for MCNP inputs.
It also meant creating an entirely new set of data types for properly handling the concrete syntax tree.
Finally, all objects representing inputs had to be rewritten for working with the syntax trees.
Now though when a user changes the density on a cell the whole cell formatting won't change.
Instead the leaf in the syntax tree representing the density (and the space following it) will try to reverse engineer
the formatting the user used (e.g., how many significant figures, was scientific notation used, etc.),
and format the new value the same way, while taking up the same amount of space.
It will eat into the trailing space if necessary.
Though if it has to make the line longer in order to fit the same numerical precision it will do so with a warning.
New Features
- User formatting is preserved automatically
- Cell geometry is now stored in
cell.geometry
and 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 features
montepy.data_cards
moved tomontepy.data_inputs
montepy.data_cards.data_card
is nowmontepy.data_inputs.data_input
Montepy.Cell.geometry_logic_string
was 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_prefix
was moved to_class_prefix
as the user usually shouldn't see this. Same goes forhas_classifier
andhas_number
.- Most of the data types inside
montepy.input_parser.mcnp_input
were deprecated or changed
Issues resolved
#12, #48,#105, #106, #114, #119, #136
Related MRs
!57, !58, !71, !73, !75, !77, !80, !81, !82, !83, !84, !85, !86, !87 !88, !89, !90, !92, !93, !94, !95, !96, !97, !99, !103
Issues resolved in Alpha Testing
#121, #122, #123, #124, #125, #126, #129, #130, #132, #133, #134, #140, #146
Release 0.1.6-beta
This is a minor release. It includes some bug fixes, and more importantly a rebranding.
Now this package is called MontePy.
Bug Fixes
- 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.
Release 0.1.5-beta
This release is primarily focused on bugs discovered after 0.1.0 that are critical to fix.
Tests were added that replicated all bugs. An additional four tests were written; the rest were covered by modifying existing tests. The new tests have 149 more lines of code.
Bugs fixed
- When a
PX
style surface was1 PZ 0
this 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.
Issues:
#79, #86, #88, #90, #91, #100, #101, #104, #108
MRs
!62, !63, !64, !65, !66, !67, !68, !69
Release 0.1.0-beta
Summary
This release primarily focused on "cell modifiers" inputs, those that modify a cell with further data, such as imp
, vol
, etc.
The most difficult and useful one of these being Universes lattices and fills.
How to Use new Features
- Just see the getting started guide for this. Specifically for sections like "Setting Cell Importances", "Universes", and "Setting How Cell Data Gets displayed in the Input File."
Features Added
- Added infrastructure to support cell modifier cards 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
Cell
instead of havingcell.density
now there iscell.mass_density
andcell.atom_density
.
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
Bugs Fixed
- Improved CI backend
- Supported parameters that don't have equal signs. MCNP supports
1 0 -1 u 1
- Now doesn't try to expand shortcuts inside of
FC
andSC
comments.
Issues
#23, #27, #34, #36, #39, #40, #41, #42, #51, #53, #63, #70, #73, #67, #49, #25, #9
Merge Requests
!30, !31, !33, !34, !35, !37, !38, !39, !40, !41, !42, !43, !51, !53, !55, !56, !45, !50, !54
Release 0.0.5-beta
Features Added
- Object numbers are now generalized: e.g.,
cell.cell_number
has changed tocell.number
. The.number
property is standardized across all numbered objects. - Implementation of the
NumberedObjectCollections
which 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 integration testing; test suite now has over 120 test cases, with over 97% code coverage.
- 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), J still needs some better support. MCNPy 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.
Bugs Fixed
- Comments that "cut" a parent card are now supported.
Issues
#2, #6, #11, #13, #17, #18, #19, #20, #28,
MRs
!9, !11, !16, !18, !13, !19, !20, !22, !23