Python API¶
The public package is fpm_rs. Configuration objects and NumPy arrays cross the
Python boundary while model compilation, simulation, reconstruction, and bundle
I/O run in Rust. Private _core implementation names are intentionally omitted.
Start with the domain that owns the concept you need:
- Datasets for registry discovery, caching, and loaded data.
- Experiment and illumination for physical microscope inputs.
- Compiled models and measurements for the algorithm-facing forward model and measured stacks.
- Simulation for synthetic objects, detector effects, and deterministic acquisitions.
- Reconstruction algorithms for solver selection and execution.
- Results and bundles for outputs, checkpoints, and durable or benchmark artifacts.
- Callbacks and diagnostics for run hooks, recording, plotting, and reports.
- Evaluation and metrics for comparison with reference data.
The checked-in python/fpm_rs/__init__.pyi, metrics.pyi, and evaluation.pyi
files are the authoritative signatures and API prose used by this reference.
Shared types and exceptions¶
All package-specific failures derive from FpmError. Shape, parameter, model,
measurement, length, frame-range, numerical, unsupported-operation, dataset,
I/O, and serialization failures have distinct subclasses.
fpm_rs
¶
Python interface for the fpm-rs reconstruction and simulation core.
ReconstructionShapeSpec
module-attribute
¶
ReconstructionShapeSpec: TypeAlias
Explicit reconstruction shape or an automatic size-selection strategy.
FloatArray
module-attribute
¶
FloatArray: TypeAlias
NumPy array whose elements are double-precision real values.
ComplexArray
module-attribute
¶
ComplexArray: TypeAlias
NumPy array whose elements are double-precision complex values.
MaskArray
module-attribute
¶
MaskArray: TypeAlias
NumPy mask array with zero for excluded pixels and nonzero for valid pixels.
Path
module-attribute
¶
Path: TypeAlias
Text or path-like filesystem path accepted by the public API.
Callback
module-attribute
¶
Callback: TypeAlias
Rust-backed or Python callback accepted by reconstruction algorithms.
FpmError
¶
Bases: Exception
Base class for errors raised by the Rust extension.
InvalidParameterError
¶
Bases: FpmError
A configuration parameter is non-finite or outside its valid range.
InvalidModelError
¶
Bases: FpmError
A compiled model is internally inconsistent or unsuitable for an operation.
InvalidMeasurementsError
¶
Bases: FpmError
A measurement stack contains invalid dimensions or intensity values.
LengthMismatchError
¶
Bases: FpmError
Related sequences or arrays do not have the required matching lengths.
FrameOutOfRangeError
¶
Bases: FpmError
A requested acquisition-frame index lies outside the measurement stack.