Skip to content

Audit legacy edge-case warning semantics #23

@bernalde

Description

@bernalde

Context

While following up on PR #22, the CI-equivalent non-notebook/non-Pyomo test subset originally reported 2064 warnings. PR #22 now filters the expected test warnings narrowly in pytest.ini, so the test run is clean again.

The warnings came from legacy edge-case tests that intentionally exercise infeasible or no-sublimation paths:

  • repeated No sublimation... UserWarnings from lyopronto.calc_unknownRp
  • Total shelf temperature setpoint time exceeded... from lyopronto.calc_unknownRp
  • infeasible design-space warnings from lyopronto.design_space
  • pressure/shelf-temperature infeasibility warnings from lyopronto.calc_knownRp
  • optimization failure and incomplete-drying warnings from lyopronto.opt_Pch
  • a small number of RuntimeWarning: divide by zero encountered in scalar divide from lyopronto.functions.Rp_finder

Why this should be separate from PR #22

The warning flood is test noise, but the underlying code behavior is broader than benchmark validation/timeouts. In particular, Rp_finder has a singular denominator when Tbot == T_sub; the current downstream behavior appears tolerated by tests, but changing it should be reviewed against physical/numerical expectations.

Suggested Work

  • Decide whether these conditions should use custom warning categories rather than plain UserWarning.
  • Audit Rp_finder behavior for Tbot == T_sub and document or handle the singular resistance case explicitly.
  • Consider adding a verbosity or diagnostics option for calculators that can emit per-time-step warnings.
  • Replace broad coverage-test warning filters with pytest.warns at specific call sites where practical.

Acceptance Criteria

  • Expected infeasible/no-sublimation scenarios are still visible to users when appropriate.
  • Tests do not emit large warning counts during normal CI runs.
  • Any singular resistance behavior is documented and covered by focused tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions