|
pnm 1.0.3
peclet.pnm — pore-network extraction from SDF geometry (Kokkos)
|
Functions | |
| _sdf () | |
| _raises (call, param) | |
| test_pore_refuses (args, param) | |
| test_pore_accepts (args) | |
| test_grid_refuses_origin (name, origin, param) | |
| test_grid_refuses_spacing (name, spacing, param) | |
| test_grid_accepts () | |
| test_segment_volume_refuses (spacing, param) | |
| test_segment_volume_accepts () | |
| test_extract_topology_refuses (shape, param) | |
| test_extract_topology_keeps_its_runtime_errors () | |
| test_extract_topology_accepts () | |
| test_mpi_block_refuses (shape, param) | |
| test_mpi_block_keeps_its_runtime_error () | |
| test_mpi_block_accepts () | |
| test_extract_pore_network_mpi_refuses_global_shape (shape, param) | |
Variables | |
| NAN | |
| INF | |
| int | N = 8 |
| list | O = [0.0, 0.0, 0.0] |
| list | S = [1.0, 1.0, 1.0] |
| HAS_MPI = hasattr(pnm, "mpi_block") | |
| list | BAD_ORIGIN |
| list | BAD_SPACING |
| dict | GRID_FUNCS |
| mpi = pytest.mark.skipif(not HAS_MPI, reason="module built without PECLET_PNM_MPI") | |
Contract: the entry points refuse a wrong-length triple, NaN/Inf or inadmissible value with ValueError. Validation lives in the binding (src/pnm_bindings_checks.hpp, used from src/pnm_bindings.cpp); the message names the function, the parameter, the admissible range with its dimension and the offending value. Each validated argument is covered twice: every bad value raises ValueError naming the parameter, and a valid call still returns what it returned before. origin_zyx and spacing_zyx are narrowed to float32 before the kernels, so they are checked as float32 (1e39 is not finite there, 1e-50 is not > 0). origin_zyx is a coordinate: finite only, any sign. The SDF values themselves are not scanned. extract_network_flow(_mpi) are outside this round (owned by paper A7's branch) and are not covered here. Run: PYTHONPATH=<build> python -m pytest -q tests/python/test_input_validation.py
|
protected |
One sphere of radius 3.5 in an 8^3 box: one pore.
Definition at line 29 of file test_input_validation.py.
Referenced by test_extract_pore_network_mpi_refuses_global_shape(), test_extract_topology_accepts(), test_extract_topology_keeps_its_runtime_errors(), test_extract_topology_refuses(), test_grid_accepts(), test_grid_refuses_origin(), test_grid_refuses_spacing(), test_segment_volume_accepts(), and test_segment_volume_refuses().
|
protected |
Definition at line 35 of file test_input_validation.py.
Referenced by test_extract_pore_network_mpi_refuses_global_shape(), test_extract_topology_refuses(), test_grid_refuses_origin(), test_grid_refuses_spacing(), test_mpi_block_refuses(), test_pore_refuses(), and test_segment_volume_refuses().
| test_input_validation.test_pore_refuses | ( | args, | |
| param ) |
Definition at line 56 of file test_input_validation.py.
References _raises().
| test_input_validation.test_pore_accepts | ( | args | ) |
Definition at line 61 of file test_input_validation.py.
| test_input_validation.test_grid_refuses_origin | ( | name, | |
| origin, | |||
| param ) |
Definition at line 79 of file test_input_validation.py.
| test_input_validation.test_grid_refuses_spacing | ( | name, | |
| spacing, | |||
| param ) |
Definition at line 85 of file test_input_validation.py.
| test_input_validation.test_grid_accepts | ( | ) |
A valid physical grid (negative origin, anisotropic spacing) still extracts the one pore.
Definition at line 89 of file test_input_validation.py.
References _sdf(), and pnm.extract_pore_network_mpi().
| test_input_validation.test_segment_volume_refuses | ( | spacing, | |
| param ) |
Definition at line 105 of file test_input_validation.py.
| test_input_validation.test_segment_volume_accepts | ( | ) |
Definition at line 109 of file test_input_validation.py.
References _sdf().
| test_input_validation.test_extract_topology_refuses | ( | shape, | |
| param ) |
Definition at line 119 of file test_input_validation.py.
| test_input_validation.test_extract_topology_keeps_its_runtime_errors | ( | ) |
The shape checks that predate this round stay RuntimeError (length, mismatch, rank).
Definition at line 125 of file test_input_validation.py.
References _sdf().
| test_input_validation.test_extract_topology_accepts | ( | ) |
Definition at line 136 of file test_input_validation.py.
References _sdf().
| test_input_validation.test_mpi_block_refuses | ( | shape, | |
| param ) |
Definition at line 152 of file test_input_validation.py.
References _raises().
| test_input_validation.test_mpi_block_keeps_its_runtime_error | ( | ) |
Definition at line 157 of file test_input_validation.py.
| test_input_validation.test_mpi_block_accepts | ( | ) |
Definition at line 163 of file test_input_validation.py.
| test_input_validation.test_extract_pore_network_mpi_refuses_global_shape | ( | shape, | |
| param ) |
Definition at line 172 of file test_input_validation.py.
References _raises(), _sdf(), and pnm.extract_pore_network_mpi().
| test_input_validation.NAN |
Definition at line 22 of file test_input_validation.py.
| test_input_validation.INF |
Definition at line 22 of file test_input_validation.py.
| int test_input_validation.N = 8 |
Definition at line 23 of file test_input_validation.py.
| list test_input_validation.O = [0.0, 0.0, 0.0] |
Definition at line 24 of file test_input_validation.py.
| list test_input_validation.S = [1.0, 1.0, 1.0] |
Definition at line 25 of file test_input_validation.py.
| test_input_validation.HAS_MPI = hasattr(pnm, "mpi_block") |
Definition at line 26 of file test_input_validation.py.
| list test_input_validation.BAD_ORIGIN |
Definition at line 42 of file test_input_validation.py.
| list test_input_validation.BAD_SPACING |
Definition at line 45 of file test_input_validation.py.
| dict test_input_validation.GRID_FUNCS |
Definition at line 68 of file test_input_validation.py.
| test_input_validation.mpi = pytest.mark.skipif(not HAS_MPI, reason="module built without PECLET_PNM_MPI") |
Definition at line 145 of file test_input_validation.py.