Skip to content

1000! Beta release: 1.6.0b1 - #1000

Merged
MicahGale merged 553 commits into
beta-testfrom
beta_rel_dev
Jul 29, 2026
Merged

1000! Beta release: 1.6.0b1#1000
MicahGale merged 553 commits into
beta-testfrom
beta_rel_dev

Conversation

@MicahGale

@MicahGale MicahGale commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Features Added

Performance Improvement


📚 Documentation preview 📚: https://montepy--1000.org.readthedocs.build/en/1000/

MicahGale and others added 30 commits December 2, 2025 09:42
Implemented automated Type and Value Checking
MicahGale and others added 20 commits July 25, 2026 23:29
…_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 MicahGale changed the title Beta rel dev 1000! Beta release: 1.6.0b1 Jul 29, 2026
@MicahGale
MicahGale marked this pull request as ready for review July 29, 2026 17:36
@MicahGale
MicahGale merged commit fd4c5ab into beta-test Jul 29, 2026
19 checks passed
@MicahGale
MicahGale deployed to build-pypi July 29, 2026 17:50 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants