class documentation

A custom LabThings Thing class for the OpenFlexure Microscope.

Method __enter__ Set the data directory when the Thing is entered.
Method __exit__ Close the OFMThing.
Method create_data_path Create a RelativeDataPath object with this Thing set as the saving Thing.
Property data_dir The data directory for this thing.
Property show_data_in_gallery Whether to show in the Gallery.
Class Variable _show_data_in_gallery Undocumented
Instance Variable _data_dir Undocumented
def __enter__(self) -> Self: (source)
def __exit__(self, _exc_type: type[BaseException], _exc_value: BaseException | None, _traceback: TracebackType | None): (source)

Close the OFMThing.

This is needed for the context manager protocol to work. Currently it doesn't do anything.

def create_data_path(self, path: str, absolute: bool = False) -> RelativeDataPath: (source)

Create a RelativeDataPath object with this Thing set as the saving Thing.

Parameters
path:strThe relative path within the data directory of this Thing's data dir that the data should be saved to.
absolute:boolSet to True if the current path is absolute. A relative path will be returned. A validation error will be raised if the absolute path is not within the data directory.
Returns
RelativeDataPathA RelativeDataPath object with the saving Thing already set.
@property
data_dir: str = (source)

The data directory for this thing.

@property
show_data_in_gallery: bool = (source)

Whether to show in the Gallery.

_show_data_in_gallery: bool = (source)
_data_dir: str | None = (source)

Undocumented