Skip to content

Expand test coverage across modules (unit + integration) #7

Description

@bernalde

Goal

Grow real test coverage beyond the two existing integration scenarios, with an emphasis on fast unit tests that don't need assimulo. Part of #3; depends on #4.

Current state

  • Only integration tests exist (full reactor / flowsheet solves). Reverted PR Fix crystallizer energy balance units and jacket paths #106 estimated baseline coverage ~3%.
  • Many pure-Python pieces are unit-testable in isolation without a solver: kinetics rate evaluation, thermodynamic property calls, stream/phase construction, name analysis, interpolation, FVM flux/limiter helpers, moment conversions.

Proposed coverage targets (unit, no assimulo)

  • Kinetics.pyRxnKinetics.get_rxn_rates / temp_term / elem_f_model against hand-computed values; CrystKinetics.get_kinetics supersaturation branches.
  • Phases.py / Streams.py — construct Liquid/Solid/Vapor streams, check derived properties and moment/distribution conversions.
  • ThermoModule.py — property evaluations on a known compound DB.
  • Commons.py — FVM helpers (high_resolution_fvm, limiter math), NameAnalysis mapping.
  • Connections.pytopological_bfs ordering and recycle detection; unit conversion.

Integration coverage (assimulo, mark @pytest.mark.assimulo)

  • Batch / CSTR / Semibatch reactor smoke tests against reference trajectories.
  • Batch and MSMPR crystallizer (moments + 1D-FVM) smoke tests.
  • At least one separation unit (filtration/drying) end-to-end.

Acceptance criteria


Upstream PR

Wave 2 — land upstream as several small, test-only PRs (one module or theme each), not a single large one. See #3.


Reverted PR provenance

This issue is part of the selective re-introduction of useful infrastructure from the reverted upstream work:

Implementation should stay small and reviewable, avoid repo-wide formatting, and preserve traceability through one focused PR per issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:testingTest discovery, fixtures, coverage, and test strategystatus:plannedPlanned roadmap or maintenance work, not a verified bug reporttestingTest suite and coverage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions