Skip to content

Restructure app: split tests, previews and comparison helpers into modules - #281

Merged
m-messer merged 27 commits into
refactor/adopt-packagesfrom
refactor/restructure-app
Oct 23, 2026
Merged

m-messer merged 27 commits into
refactor/adopt-packagesfrom
refactor/restructure-app

Conversation

@m-messer

Copy link
Copy Markdown
Member

Problem

This is the structural follow-up promised in #280; it's stacked on that PR. After the packages extraction, app/ still mixed tests, previews and comparison helpers in a few large modules. app/context/symbolic.py held the set-equivalence and numerical-comparison logic alongside the symbolic context.

Changes

Files and code move; behaviour is unchanged.

  • Tests: app/evaluation_test.py and app/preview_test.py move to app/tests/, the latter as symbolic_preview_test.py. Imports and the healthcheck entry point (app/evaluation_tests.py) are updated to match.
  • Previews: app/preview.py, app/symbolic_preview.py and the physical-quantity preview move into an app/preview/ package. Shared preview types and helpers go in app/preview/common.py.
  • Contexts: two pieces of app/context/symbolic.py move into their own modules:
    • numerical comparison (compare_numerically) into app/context/numerical.py;
    • set equivalence (as_sets, add_set_equivalence_nodes) into app/context/set_equivalence.py.
  • Docs: README.md and app/docs/dev.md paths are updated.

Checklist

  • Tests added/updated (moved; no new tests)
  • Docs updated (app/docs.md) if user-facing behaviour changed (n/a, no behaviour change)

Testing

🤖 Generated with Claude Code

@neagualexa neagualexa assigned m-messer and unassigned neagualexa Oct 22, 2026
…rts, and revise documentation for consistency.
… numerical comparison logic into dedicated modules
… contexts into packages, update imports, and revise documentation for clarity
…inal_criterion`, `disable_nodes`, `outcome_tag`) and integrate them across symbolic and physical_quantity contexts
…package with specialized modules (`equivalence`, `set_equivalence`, `generic`, `substitution`), and extract comparison logic into `comparison.py`.
… (`graphs`, `parsing`, `criteria_parser`, `comparison`), update imports, and consolidate redundant code in `__init__.py`.
…ons (`_input_symbol_codes_and_aliases`, `_raise_on_collisions`, `_build_parameters`, etc.), remove redundant in-line implementations, and streamline `FrozenValuesDictionary` usage.
…efaults.py` for shared default parameters, extract reusable parsing/comparison utilities (`parse_criterion_sides`, `COMPARISON_OPERATORS`) into dedicated modules, streamline evaluation graph imports and `disable_nodes` logic.
…TORS` in `app/context/operators.py`, replace `unused_input` with `_response` across evaluation methods, remove redundancy in comparison and substitution functions, and streamline parameter handling in criteria-related methods.
…for static type checking, enforce stricter type safety across the codebase, and integrate mypy checks into the CI workflow.
…ialization logic with `outcome_graph` helper function, update imports, and streamline related modules.
…parison, eliminate redundant structures, and streamline simplification handling.
m-messer and others added 11 commits October 23, 2026 09:32
…` dataclass, introduce `base.py` for shared context logic, update evaluation methods to use `Context` object, and streamline context selection logic in `select_context`.
…sedQuantity` dataclass, update type aliases and dependent methods, and streamline parameter lookups in evaluation logic.
…nd update documentation regarding import conventions.
… `EvaluationParameters` dataclass, update all affected modules and type hints, streamline parameter access, and update dev documentation accordingly.
…he codebase, refactor `requirements-dev.txt` to include dev tools, and streamline dependency management in workflows and CI.
…_report` helper to centralize feedback and exception handling logic, reduce redundancy, and streamline reserved expression evaluation.
… from `app/types.py`, remove unused imports, and refine function type hints.
… into them

Use `split_criteria`, `build_quantity_criteria_parser` and `where_substitutions`
from `lambdafeedback.criteria`, and `notation_warnings` from
`lambdafeedback.expression_parsing`, in place of the local copies. Empty
criteria in a criteria list now raise "Cannot parse criteria". Add tests for
malformed criteria lists and update dev documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, internal references, and type hints across symbolic evaluation modules to streamline parameter usage and improve consistency.
@m-messer
m-messer force-pushed the refactor/restructure-app branch from 821829c to 659ab57 Compare October 23, 2026 09:43
@m-messer
m-messer removed this pull request from stack #293 October 23, 2026 11:49
Update lambdafeedback packages to v0.3.0-rc.3 and adopt helpers moved into them
Design patterns: Context, EvaluationParameters and ParsedQuantity dataclasses, graph helpers
@m-messer
m-messer merged commit 3edde8d into refactor/adopt-packages Oct 23, 2026
1 check failed
@m-messer
m-messer deleted the refactor/restructure-app branch October 23, 2026 11:51
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.

3 participants