scistudio.core.meta

Canonical import root: from scistudio.core.meta import ...

Self-contained public-API reference — 3 symbols from this module's __all__, with signatures and docstrings inlined (ADR-052 §7). Generated; do not hand-edit.

ChannelInfoclass

Stability: stable · Since 0.3.1

class ChannelInfo(BaseModel)

One acquisition channel's descriptive properties.

Plugin Meta classes use this to describe per-channel properties such as excitation/emission wavelength and dye (for example FluorImage.Meta.channels or SRSImage.Meta). Every field except name is optional, so an author fills in only what they have. The model is frozen (immutable), so it serialises to and from JSON cleanly when an object travels between processes.

Example: >>> dapi = ChannelInfo( ... name="DAPI", ... dye="Hoechst 33342", ... excitation_nm=358.0, ... emission_nm=461.0, ... ) >>> dapi.name 'DAPI'

FrameworkMetaclass

Stability: stable · Since 0.3.1

class FrameworkMeta(BaseModel)

Framework-managed metadata, filled in when a DataObject is built.

Block authors do not write these fields directly. The framework sets them when it constructs a new DataObject or derives one (for example when slicing or iterating over an array). The model is frozen, so an accidental write raises a ValidationError instead of silently mutating shared state. The fields are validated and JSON-round-tripped automatically when an object is sent to or from a worker subprocess.

Example: >>> meta = FrameworkMeta(source="raw.tif") >>> meta.source 'raw.tif' >>> meta.derived_from is None True

with_meta_changesfunction

Stability: stable · Since 0.3.1

with_meta_changes(meta: 'T', **changes: 'Any') -> 'T'

Return a copy of a metadata model with the given fields updated.

A pure helper backing DataObject.with_meta(). It works on any Pydantic BaseModel (typically a DataObject's meta slot) and never mutates the input — the original instance is returned unchanged.

Args: meta: A Pydantic BaseModel instance, usually a Meta subclass defined on a DataObject plugin type. **changes: Field assignments to apply to the copy.

Returns: A new instance of the same class as meta with changes applied.

Raises: pydantic.ValidationError: If the changes would violate the model's field constraints.

Example: >>> from pydantic import BaseModel >>> class M(BaseModel): ... x: int = 0 ... y: int = 0 >>> a = M(x=1, y=2) >>> b = with_meta_changes(a, x=10) >>> b.x, b.y (10, 2) >>> a.x, a.y # original unchanged (1, 2)