flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
test_stub_sync Namespace Reference

Functions

 _public (name)
 _stub_names ()
 _runtime_names ()
 test_stub_covers_every_public_name ()
 test_stub_names_exist_at_runtime ()

Variables

str STUB = Path(__file__).resolve().parents[2] / "packaging" / "_flow.pyi"
dict MPI_ONLY
dict RETURNED_PRIVATE = {"_AndersonAccelerator", "_AndersonAcceleratorColocated"}

Detailed Description

Contract: the shipped type stub packaging/_flow.pyi covers every public name of peclet.flow._flow.

The stub is generated by nanobind.stubgen against an MPI-enabled host build (recipe in
CMakeLists.txt, next to the rule that stages it). A binding added without regenerating it fails
here. Names in the stub but absent at runtime fail too, except on a build without MPI, which lacks
the distributed names the stub carries.

Run: PYTHONPATH=<build> python -m pytest -q tests/python/test_stub_sync.py

Function Documentation

◆ _public()

test_stub_sync._public ( name)
protected

Definition at line 27 of file test_stub_sync.py.

Referenced by _runtime_names(), and _stub_names().

◆ _stub_names()

test_stub_sync._stub_names ( )
protected

Definition at line 31 of file test_stub_sync.py.

References _public().

Referenced by test_stub_covers_every_public_name(), and test_stub_names_exist_at_runtime().

◆ _runtime_names()

test_stub_sync._runtime_names ( )
protected

Definition at line 46 of file test_stub_sync.py.

References _public().

Referenced by test_stub_covers_every_public_name(), and test_stub_names_exist_at_runtime().

◆ test_stub_covers_every_public_name()

test_stub_sync.test_stub_covers_every_public_name ( )

Definition at line 61 of file test_stub_sync.py.

References _runtime_names(), and _stub_names().

◆ test_stub_names_exist_at_runtime()

test_stub_sync.test_stub_names_exist_at_runtime ( )

Definition at line 67 of file test_stub_sync.py.

References _runtime_names(), and _stub_names().

Variable Documentation

◆ STUB

str test_stub_sync.STUB = Path(__file__).resolve().parents[2] / "packaging" / "_flow.pyi"

Definition at line 15 of file test_stub_sync.py.

◆ MPI_ONLY

dict test_stub_sync.MPI_ONLY
Initial value:
1= {"mpi_block", "predict_hierarchy", "Solver.init_mpi", "SolverColocated.init_mpi",
2 "SolverDiagnostics.rebalance_by_weights",
3 "SolverColocatedDiagnostics.rebalance_by_weights"}

Definition at line 17 of file test_stub_sync.py.

◆ RETURNED_PRIVATE

dict test_stub_sync.RETURNED_PRIVATE = {"_AndersonAccelerator", "_AndersonAcceleratorColocated"}

Definition at line 24 of file test_stub_sync.py.