Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/pymodaq_data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def _compute_slices_from_axis(axis: Axis, _slice, *ignored, is_index=True, **ign
return _slice


@ser_factory.register_decorator()
class Axis(SerializableBase):
"""Object holding info and data about physical axis of some data

Expand Down Expand Up @@ -619,6 +620,7 @@ def find_indexes(self, thresholds: IterableType[float]) -> IterableType[int]:
return [self.find_index(threshold) for threshold in thresholds]


@ser_factory.register_decorator()
class NavAxis(Axis):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -1846,6 +1848,7 @@ def _get_dimension_str(self):
return string


@ser_factory.register_decorator()
class DataWithAxes(DataBase, SerializableBase):
"""Data object with Axis objects corresponding to underlying data nd-arrays

Expand All @@ -1867,7 +1870,7 @@ class DataWithAxes(DataBase, SerializableBase):
def __new__(cls, *args, **kwargs):
ser_factory.register_from_type(cls, cls.serialize,
cls.deserialize) # implement
# serialization/deserialization to all subtypes of DataBase
# serialization/deserialization to all subtypes of DataBase but only when first instantiated hence the decorator
return super().__new__(cls)

def __init__(self, name: str,
Expand Down Expand Up @@ -2781,6 +2784,7 @@ def get_data_as_dwa(self, index: int = 0) -> DataWithAxes:
return self.deepcopy_with_new_data([self[index]])


@ser_factory.register_decorator()
class DataRaw(DataWithAxes):
"""Specialized DataWithAxes set with source as 'raw'. To be used for raw data"""
def __init__(self, name: str,
Expand Down Expand Up @@ -2810,6 +2814,7 @@ def __init__(self, name: str,
)


@ser_factory.register_decorator()
class DataCalculated(DataWithAxes):
"""Specialized DataWithAxes set with source as 'calculated'. To be used for
processed/calculated data"""
Expand Down Expand Up @@ -2839,6 +2844,7 @@ def __init__(self, name: str,
**kwargs)


@ser_factory.register_decorator()
class DataFromRoi(DataCalculated):
"""Specialized DataWithAxes set with source as 'calculated'.
To be used for processed data from region of interest"""
Expand Down Expand Up @@ -2866,6 +2872,7 @@ def __init__(self, name: str,
**kwargs)


@ser_factory.register_decorator()
class DataToExport(DataLowLevel, SerializableBase):
"""Object to store all raw and calculated DataWithAxes data for later exporting, saving, sending signal...

Expand Down