1000! Beta release: 1.6.0b1 - #1000
Merged
Merged
Conversation
Implemented automated Type and Value Checking
…jects on full parse.
…_jit_parse grab_cells_from_jit_parse() checked hasattr(uni_inp, "_parked_data"), but nothing anywhere ever sets _parked_data -- the real attribute (inherited from CellModifierInput._accept_from_data) is _parked_value. This silently defeated the fast-path optimization, always falling back to the slower cell.search()+full_parse() branch. Add tests for soft_claim() given a bare Cell, grab_cells_from_jit_parse() with no problem linked, the now-fixed parked-value fast path, and Universe renumbering updating a cell's cached .universe reference. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rticle formatting merge() when self is still JIT but other is parsed (forces self.full_parse() first), merge() when both sides are still JIT (defers onto _inputs instead of forcing a parse), and _format_tree() skipping a _part_combos entry not actually tracked in _particle_importances. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…fallback _find_and_populate_universe raised IllegalStateError, which doesn't exist anywhere -- only IllegalState is defined. Fixed. Also remove `uni_num = cell.old_universe_number; if uni_num is None: uni_num = 0` in push_to_cells: old_universe_number (via make_prop_val_node's fallback) can never actually return None, it always defaults to 0, making the check unreachable. Add tests for both guards on _find_and_populate_universe, the universe-0 fallback when a data-block U card runs short, and Cells(jit_parse=False)'s blank-modifier _clear_data() path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ilure fallback The three missing lines only trigger when the JIT peek light-parser fails AND the surface type has no specific/generic dispatch class (only axisymmetric-by-points X/Y/Z qualify) AND jit_parse=False is requested. Reuses the existing peek-failure monkeypatch technique with an X surface. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…text _ExceptionContextAdder's __new__ only detected plain functions via inspect.isfunction(), but a @staticmethod-decorated attribute in a class's raw namespace is a staticmethod object, not a plain function -- isfunction() returns False for it. Every public staticmethod on every MCNP_Object/Surface subclass was silently left unwrapped, so exceptions raised from them never got the line-number context the rest of the codebase relies on. Also check isinstance(value, staticmethod). Add a test file for this module (none existed) verifying wrap_string_for_mcnp is now wrapped and still works correctly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ink conflict _find_impacted_parents's `if self.number == new_number: return` could never fire: its only caller (_number_validator) always runs collection.check_number(number) first, which raises for any already-in-use number, including the object's own. Removed, along with the now-unused new_number parameter (updated the one call site). Add a test for _link_to_collection's conflict guard (IllegalState when an already-linked object is linked to a different collection). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ches Same shape as the make_prop_val_node fix earlier: `raise_error(); return` in check_type's union-candidate matching -- the return can never execute since raise_error() always raises. Removed the unreachable return. Add tests for: skipping type-checks on excess positional/unknown keyword args when there's no */** catch-all, TypeAliasType (PEP 695) annotation unwrapping, and the multi-candidate union path where all shape-matching candidates fail validation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
raise MalformedInputError(input, ...) referenced `input`, which isn't a parameter or import anywhere in this method -- it silently resolved to Python's builtin `input` function. This didn't crash (the constructor's getattr(input, "input_file", None) falls back gracefully), but it meant the error lost all file/line context. Fixed to self._input. Add a test constructing a VOL data card with key-value parameters (which VOL doesn't support), confirming the fix raises with proper context. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No bugs found in this batch -- each of these was a genuinely reachable branch that just needed the right trigger: - cell.py: the ban_repeat guard for a cell-block modifier (Volume/Universe/Lattice/Fill) specified twice. Ordinary duplicate text is actually caught earlier by a different check, so this required calling _parse_keyword_modifiers() a second time directly. - cell_modifier.py: a false-positive keyword match in _check_redundant_definitions (a $ comment mentioning "vol" forces a full parse, then must recognize it wasn't a real parameter). - fill.py: .universes accessed on a multi-universe lattice fill detached from a problem. - surface.py: _enforce_values()'s early return when neither _surface_type nor a tree entry for it exists. - cell_parser.py / data_parser.py: the JIT light-parsers' defensive assert False on unexpected tokens. - mcnp_input.py: tokenize()'s lexer_class override -- never actually used by any current caller (_lexer_class is read via getattr(..., None) and never set anywhere), tested directly as a reachable-but-internally-unexercised public parameter. Reaches 100% patch coverage on this branch relative to develop. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Split User and Developer guides into manageable chunks.
Beta implementation of Just In time parsing
MicahGale
marked this pull request as ready for review
July 29, 2026 17:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features Added
Performance Improvement
📚 Documentation preview 📚: https://montepy--1000.org.readthedocs.build/en/1000/