camacq.plugins.sample package¶
Handle sample state.
- class camacq.plugins.sample.Image(path: str, values: dict[str, Any] | None = None, **kwargs: Any)[source]¶
Bases:
ImageContainerAn image with path and position info.
- property change_event: type[SampleImageSetEvent]¶
Event: Return an event class to fire on container change.
- property name: str¶
str: Return an identifying name for the container.
- property path: str¶
str: Return the path of the image.
- property values: dict[str, Any]¶
dict: Return a dict with the values set for the container.
- class camacq.plugins.sample.ImageContainer[source]¶
Bases:
ABCA container for images.
- abstract property change_event: type[SampleEvent]¶
Event: Return an event class to fire on container change.
- abstract property name: str¶
str: Return an identifying name for the container.
- abstract property values: dict[str, Any]¶
dict: Return a dict with the values set for the container.
- class camacq.plugins.sample.Sample[source]¶
Bases:
ImageContainer,ABCRepresentation of the state of the sample.
- data: dict[str, ImageContainer] | None = None¶
- get_sample(name: str, **kwargs: Any) ImageContainer | None[source]¶
Get an image container of the sample.
- Parameters:
name (str) – The name of the container type.
**kwargs – Arbitrary keyword arguments. These will be used to create the id string of the container.
- Returns:
Return the found ImageContainer instance.
- Return type:
ImageContainer instance
- abstract property image_event_type: str¶
str: Return the image event type to listen to for the sample.
- abstract property name: str¶
str: Return the name of the sample.
- abstractmethod async on_image(center: Center, event: Event) None[source]¶
Handle image event for this sample.
- async set_sample(name: str, values: dict[str, Any] | None = None, **kwargs: Any) ImageContainer[source]¶
Set an image container of the sample.
- Parameters:
name (str) – The name of the container type.
values (dict) – The optional values to set on the container.
**kwargs – Arbitrary keyword arguments. These will be used to create the id string of the container.
- Returns:
Return the ImageContainer instance that was updated.
- Return type:
ImageContainer instance
- abstract property set_sample_schema: Schema | Any¶
Return the validation schema of the set_sample method.
- class camacq.plugins.sample.SampleEvent(data: dict[str, Any] | None = None)[source]¶
Bases:
EventAn event produced by a sample change event.
- property container: ImageContainer | None¶
ImageContainer instance: Return the container instance of the event.
- property container_name: str¶
str: Return the container name of the event.
- event_type: ClassVar[str] = 'sample_event'¶
- property values: dict[str, Any]¶
dict: Return the container values of the event.
- class camacq.plugins.sample.SampleImageSetEvent(data: dict[str, Any] | None = None)[source]¶
Bases:
SampleEventAn event produced by a new image on the sample.
- event_type: ClassVar[str] = 'sample_image_set_event'¶
- camacq.plugins.sample.get_matched_samples(sample: Sample, name: str, attrs: dict[str, Any] | None = None, values: dict[str, Any] | None = None) list[ImageContainer][source]¶
Return the sample items that match.