|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| None | test_version_is_declared () |
| None | test_version_matches_installed_metadata () |
| None | test_package_carries_no_web_framework () |
| None | test_physics_stack_is_importable (str module) |
| None | test_stack_versions_reports_every_dependency () |
Variables | |
| list | REQUIRED_STACK = ["numpy", "scipy", "CoolProp", "fluids", "ht"] |
Phase 00's exit criterion, as a test. The whole point of this phase is that ``import feedtwin`` works from two very different environments -- the feed-twin API container and EngineDesign's optimizer process -- and that the physics stack it needs is actually resolvable in both. That is not a formality: an optimizer that discovers a missing CoolProp 15 minutes into a Layer X run has wasted the run.
| None test_package.test_package_carries_no_web_framework | ( | ) |
The library must stay importable in a process with no web stack. EngineDesign's optimizer will import this package directly (ADR-0001). If a FastAPI import ever creeps into the physics -- through a Pydantic model that drags in starlette, most likely -- that call path acquires a dependency it has no use for, and the separation this package exists to maintain is gone. Checked in a subprocess, not against this process's ``sys.modules``: pytest itself, or a sibling test, may legitimately have imported a web framework already, and asserting on a shared interpreter would make this pass or fail on test ordering rather than on what feedtwin actually pulls in.
Definition at line 47 of file test_package.py.
| None test_package.test_physics_stack_is_importable | ( | str | module | ) |
Each dependency resolves in whatever environment is running these tests.
Definition at line 77 of file test_package.py.
| None test_package.test_stack_versions_reports_every_dependency | ( | ) |
Run provenance covers the whole stack, not just feedtwin's own version.
Definition at line 82 of file test_package.py.
| None test_package.test_version_is_declared | ( | ) |
Definition at line 26 of file test_package.py.
| None test_package.test_version_matches_installed_metadata | ( | ) |
``__init__.py`` is the only place the version is written. pyproject.toml reads it from there via ``[tool.setuptools.dynamic]``, so the two cannot disagree in a fresh install. They can still disagree after bumping ``__version__`` without reinstalling, and that matters: run provenance stamps the attribute while anything resolving the distribution sees the metadata. This turns that into a failed test rather than two versions of the truth in a results file.
Definition at line 30 of file test_package.py.
| list test_package.REQUIRED_STACK = ["numpy", "scipy", "CoolProp", "fluids", "ht"] |
Definition at line 23 of file test_package.py.