data_mapper.aind_data_schema¶
AindDataSchemaDataMapper ¶
AindDataSchemaDataMapper(*args, **kwargs)
Bases: DataMapper[_TAdsObject]
, ABC
Abstract base class for mapping data to aind-data-schema objects.
This class provides the foundation for mapping experimental data to AIND data schema formats, ensuring consistent structure and metadata handling across different data types.
Attributes:
Name | Type | Description |
---|---|---|
session_name |
str
|
The name of the session associated with the data |
Example
# Example subclass implementing session_name
class MySessionMapper(AindDataSchemaDataMapper):
@property
def session_name(self) -> str:
return "session_001"
Initializes the service.
Source code in src/clabe/services.py
28 29 30 |
|
session_name
abstractmethod
property
¶
session_name: str
Abstract property that must be implemented to return the session name.
Subclasses must implement this property to provide the session name associated with the data being mapped.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the session |
mapped
property
¶
mapped: TMapTo
Retrieves the mapped data object.
This property should return the successfully mapped data object. Implementations should ensure that mapping has been completed before returning the data.
Returns:
Name | Type | Description |
---|---|---|
TMapTo |
TMapTo
|
The mapped data object |
Raises:
Type | Description |
---|---|
ValueError
|
If the data has not been mapped yet. |
build_runner ¶
Builds a runner function for the service.
Subclasses must implement this method to return a callable that can be executed by the launcher.
Source code in src/clabe/services.py
32 33 34 35 36 37 38 |
|
map
abstractmethod
¶
map() -> TMapTo
Maps data to the target schema or format.
This method should contain the core logic for transforming input data into the target format specified by the TMapTo type parameter.
Returns:
Name | Type | Description |
---|---|---|
TMapTo |
TMapTo
|
The mapped data object |
Source code in src/clabe/data_mapper/_base.py
56 57 58 59 60 61 62 63 64 65 66 67 |
|
is_mapped ¶
is_mapped() -> bool
Checks if the data has been successfully mapped.
This method should verify whether the mapping operation has been completed and the data is available in the target format.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the data is mapped, False otherwise |
Source code in src/clabe/data_mapper/_base.py
69 70 71 72 73 74 75 76 77 78 79 |
|
AindDataSchemaSessionDataMapper ¶
AindDataSchemaSessionDataMapper(*args, **kwargs)
Bases: AindDataSchemaDataMapper[Session]
, ABC
Abstract base class for mapping session data to aind-data-schema Session objects.
This class specializes the generic data mapper for session-specific data, providing the interface for converting experimental session data to the AIND data schema Session format.
Initializes the service.
Source code in src/clabe/services.py
28 29 30 |
|
mapped
property
¶
mapped: TMapTo
Retrieves the mapped data object.
This property should return the successfully mapped data object. Implementations should ensure that mapping has been completed before returning the data.
Returns:
Name | Type | Description |
---|---|---|
TMapTo |
TMapTo
|
The mapped data object |
Raises:
Type | Description |
---|---|
ValueError
|
If the data has not been mapped yet. |
session_name
abstractmethod
property
¶
session_name: str
Abstract property that must be implemented to return the session name.
Subclasses must implement this property to provide the session name associated with the data being mapped.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the session |
session_schema ¶
session_schema() -> Session
Returns the session schema for the mapped session data.
This method should be implemented by subclasses to return the specific session schema that corresponds to the data being mapped.
Returns:
Type | Description |
---|---|
Session
|
ads_session.Session: The session schema object |
Source code in src/clabe/data_mapper/aind_data_schema.py
69 70 71 72 73 74 75 76 77 78 79 |
|
build_runner ¶
Builds a runner function for the service.
Subclasses must implement this method to return a callable that can be executed by the launcher.
Source code in src/clabe/services.py
32 33 34 35 36 37 38 |
|
map
abstractmethod
¶
map() -> TMapTo
Maps data to the target schema or format.
This method should contain the core logic for transforming input data into the target format specified by the TMapTo type parameter.
Returns:
Name | Type | Description |
---|---|---|
TMapTo |
TMapTo
|
The mapped data object |
Source code in src/clabe/data_mapper/_base.py
56 57 58 59 60 61 62 63 64 65 66 67 |
|
is_mapped ¶
is_mapped() -> bool
Checks if the data has been successfully mapped.
This method should verify whether the mapping operation has been completed and the data is available in the target format.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the data is mapped, False otherwise |
Source code in src/clabe/data_mapper/_base.py
69 70 71 72 73 74 75 76 77 78 79 |
|
AindDataSchemaRigDataMapper ¶
AindDataSchemaRigDataMapper(*args, **kwargs)
Bases: AindDataSchemaDataMapper[Rig]
, ABC
Abstract base class for mapping rig data to aind-data-schema Rig objects.
This class specializes the generic data mapper for rig-specific data, providing the interface for converting experimental rig configurations to the AIND data schema Rig format.
Initializes the service.
Source code in src/clabe/services.py
28 29 30 |
|
mapped
property
¶
mapped: TMapTo
Retrieves the mapped data object.
This property should return the successfully mapped data object. Implementations should ensure that mapping has been completed before returning the data.
Returns:
Name | Type | Description |
---|---|---|
TMapTo |
TMapTo
|
The mapped data object |
Raises:
Type | Description |
---|---|
ValueError
|
If the data has not been mapped yet. |
session_name
abstractmethod
property
¶
session_name: str
Abstract property that must be implemented to return the session name.
Subclasses must implement this property to provide the session name associated with the data being mapped.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the session |
rig_schema ¶
rig_schema() -> Rig
Returns the rig schema for the mapped rig data.
This method should be implemented by subclasses to return the specific rig schema that corresponds to the data being mapped.
Returns:
Type | Description |
---|---|
Rig
|
ads_rig.Rig: The rig schema object |
Source code in src/clabe/data_mapper/aind_data_schema.py
91 92 93 94 95 96 97 98 99 100 101 |
|
build_runner ¶
Builds a runner function for the service.
Subclasses must implement this method to return a callable that can be executed by the launcher.
Source code in src/clabe/services.py
32 33 34 35 36 37 38 |
|
map
abstractmethod
¶
map() -> TMapTo
Maps data to the target schema or format.
This method should contain the core logic for transforming input data into the target format specified by the TMapTo type parameter.
Returns:
Name | Type | Description |
---|---|---|
TMapTo |
TMapTo
|
The mapped data object |
Source code in src/clabe/data_mapper/_base.py
56 57 58 59 60 61 62 63 64 65 66 67 |
|
is_mapped ¶
is_mapped() -> bool
Checks if the data has been successfully mapped.
This method should verify whether the mapping operation has been completed and the data is available in the target format.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the data is mapped, False otherwise |
Source code in src/clabe/data_mapper/_base.py
69 70 71 72 73 74 75 76 77 78 79 |
|