Skip to content

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

Draft
m-messer wants to merge 16 commits into
refactor/adopt-packagesfrom
refactor/restructure-app
Draft

m-messer wants to merge 16 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

…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.
…nd update documentation regarding import conventions.
…he codebase, refactor `requirements-dev.txt` to include dev tools, and streamline dependency management in workflows and CI.
… from `app/types.py`, remove unused imports, and refine function type hints.

This branch has not been deployed

No deployments
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.

1 participant