particula.instruments.instrument
Read measurements from an instrument with a declared import profile.
Classes
| Name | Description |
|---|---|
Instrument | Read delimited exports that share one profile. |
Instrumentclassdataclass#
class Instrument(profile: ProfileSource, *, deployment: Deployment | None = None, registry: OperationRegistry = OperationRegistry(), reader: str = 'delimited')Read delimited exports that share one profile.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
profile | ProfileSource | required | Built-in profile ID, JSON or YAML file path, or profile mapping. Construction validates and stores a copy of the profile. |
deployment | Deployment | None | None | Instance, inlet, volume basis and calibration records. |
registry | OperationRegistry | OperationRegistry() | Trusted operations and reader implementations. |
reader | str | 'delimited' | Registered reader name, defaulting to delimited text. |
Raises
ProfileError- The profile cannot be loaded or fails validation.
_productsattributeclass attributeinstance attribute#
_products: dict[str, Measurement] = field(default_factory=dict, init=False, repr=False)deploymentattributeclass attributeinstance attribute#
deployment: Deployment | None = field(default=None, kw_only=True)profileattributeinstance attribute#
profile: ProfileSourcereaderattributeclass attributeinstance attribute#
reader: str = field(default='delimited', kw_only=True)registryattributeclass attributeinstance attribute#
registry: OperationRegistry = field(default_factory=OperationRegistry, kw_only=True)__init__method#
def __init__(profile: ProfileSource, *, deployment: Deployment | None = None, registry: OperationRegistry = OperationRegistry(), reader: str = 'delimited') -> None__post_init__method#
def __post_init__() -> NoneResolve the supplied profile before reading any sources.
available_operationsmethod#
def available_operations(as_product: str) -> dict[str, dict]Describe registered operations compatible with a bound product.
compatible_productmethod#
def compatible_product(contract: FieldContract) -> MeasurementChoose a unique product that can fill a physical input role.
processmethod#
def process(operation: str, version: str) -> MeasurementProcessLook up a named measurement operation for explicit execution.
productmethod#
def product(name: str) -> MeasurementReturn the named product previously read for this instrument.
readmethod#
def read(source: str | PathLike[str], *, as_product: str | None = None, **limits: int) -> MeasurementRead one export into memory using this instrument’s profile.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
source | str | PathLike[str] | required | Path to the delimited instrument export. |
as_product | str | None | None | Optional unique name for later role binding. |
**limits | int | {} | Optional chunk, record and batch limits accepted by MeasurementReader. |
Returns
Measurement- Measurement with scans in the profile’s output units, source
Measurement- diagnostics and the import manifest.
register_processmethod#
def register_process(process: MeasurementProcess) -> NoneExpose a trusted versioned process on this instrument’s registry.