aind_behavior_services package¶
Subpackages¶
- aind_behavior_services.calibration package
- Submodules
- aind_behavior_services.calibration.aind_manipulator module
- aind_behavior_services.calibration.load_cells module
- aind_behavior_services.calibration.olfactometer module
- aind_behavior_services.calibration.treadmill module
- aind_behavior_services.calibration.water_valve module
- Module contents
- aind_behavior_services.rig package
- Submodules
- aind_behavior_services.rig.cameras module
CameraController
Circle
FFMPEG_INPUT
FFMPEG_OUTPUT_16BIT
FFMPEG_OUTPUT_8BIT
Point2f
Rect
SpinnakerCamera
SpinnakerCamera.adc_bit_depth
SpinnakerCamera.binning
SpinnakerCamera.color_processing
SpinnakerCamera.device_type
SpinnakerCamera.exposure
SpinnakerCamera.gain
SpinnakerCamera.gamma
SpinnakerCamera.pixel_format
SpinnakerCamera.region_of_interest
SpinnakerCamera.serial_number
SpinnakerCamera.video_writer
SpinnakerCamera.validate_roi
SpinnakerCameraAdcBitDepth
SpinnakerCameraPixelFormat
SpinnakerCameraPixelFormat.B10
SpinnakerCameraPixelFormat.B12
SpinnakerCameraPixelFormat.B16
SpinnakerCameraPixelFormat.B8
SpinnakerCameraPixelFormat.BAYERBG10
SpinnakerCameraPixelFormat.BAYERBG10P
SpinnakerCameraPixelFormat.BAYERBG10PACKED
SpinnakerCameraPixelFormat.BAYERBG12
SpinnakerCameraPixelFormat.BAYERBG12P
SpinnakerCameraPixelFormat.BAYERBG12PACKED
SpinnakerCameraPixelFormat.BAYERBG16
SpinnakerCameraPixelFormat.BAYERBG8
SpinnakerCameraPixelFormat.BAYERGB10
SpinnakerCameraPixelFormat.BAYERGB10P
SpinnakerCameraPixelFormat.BAYERGB10PACKED
SpinnakerCameraPixelFormat.BAYERGB12
SpinnakerCameraPixelFormat.BAYERGB12P
SpinnakerCameraPixelFormat.BAYERGB12PACKED
SpinnakerCameraPixelFormat.BAYERGB16
SpinnakerCameraPixelFormat.BAYERGB8
SpinnakerCameraPixelFormat.BAYERGR10
SpinnakerCameraPixelFormat.BAYERGR10P
SpinnakerCameraPixelFormat.BAYERGR10PACKED
SpinnakerCameraPixelFormat.BAYERGR12
SpinnakerCameraPixelFormat.BAYERGR12P
SpinnakerCameraPixelFormat.BAYERGR12PACKED
SpinnakerCameraPixelFormat.BAYERGR16
SpinnakerCameraPixelFormat.BAYERGR8
SpinnakerCameraPixelFormat.BAYERRG10
SpinnakerCameraPixelFormat.BAYERRG10P
SpinnakerCameraPixelFormat.BAYERRG10PACKED
SpinnakerCameraPixelFormat.BAYERRG12
SpinnakerCameraPixelFormat.BAYERRG12P
SpinnakerCameraPixelFormat.BAYERRG12PACKED
SpinnakerCameraPixelFormat.BAYERRG16
SpinnakerCameraPixelFormat.BAYERRG8
SpinnakerCameraPixelFormat.BGR10
SpinnakerCameraPixelFormat.BGR10P
SpinnakerCameraPixelFormat.BGR12
SpinnakerCameraPixelFormat.BGR12P
SpinnakerCameraPixelFormat.BGR14
SpinnakerCameraPixelFormat.BGR16
SpinnakerCameraPixelFormat.BGR565P
SpinnakerCameraPixelFormat.BGR8
SpinnakerCameraPixelFormat.BGRA10
SpinnakerCameraPixelFormat.BGRA10P
SpinnakerCameraPixelFormat.BGRA12
SpinnakerCameraPixelFormat.BGRA12P
SpinnakerCameraPixelFormat.BGRA14
SpinnakerCameraPixelFormat.BGRA16
SpinnakerCameraPixelFormat.BGRA8
SpinnakerCameraPixelFormat.CONFIDENCE1
SpinnakerCameraPixelFormat.CONFIDENCE16
SpinnakerCameraPixelFormat.CONFIDENCE1P
SpinnakerCameraPixelFormat.CONFIDENCE32F
SpinnakerCameraPixelFormat.CONFIDENCE8
SpinnakerCameraPixelFormat.COORD3D_A10P
SpinnakerCameraPixelFormat.COORD3D_A12P
SpinnakerCameraPixelFormat.COORD3D_A16
SpinnakerCameraPixelFormat.COORD3D_A32F
SpinnakerCameraPixelFormat.COORD3D_A8
SpinnakerCameraPixelFormat.COORD3D_ABC10P
SpinnakerCameraPixelFormat.COORD3D_ABC10P_PLANAR
SpinnakerCameraPixelFormat.COORD3D_ABC12P
SpinnakerCameraPixelFormat.COORD3D_ABC12P_PLANAR
SpinnakerCameraPixelFormat.COORD3D_ABC16
SpinnakerCameraPixelFormat.COORD3D_ABC16_PLANAR
SpinnakerCameraPixelFormat.COORD3D_ABC32F
SpinnakerCameraPixelFormat.COORD3D_ABC32F_PLANAR
SpinnakerCameraPixelFormat.COORD3D_ABC8
SpinnakerCameraPixelFormat.COORD3D_ABC8_PLANAR
SpinnakerCameraPixelFormat.COORD3D_AC10P
SpinnakerCameraPixelFormat.COORD3D_AC10P_PLANAR
SpinnakerCameraPixelFormat.COORD3D_AC12P
SpinnakerCameraPixelFormat.COORD3D_AC12P_PLANAR
SpinnakerCameraPixelFormat.COORD3D_AC16
SpinnakerCameraPixelFormat.COORD3D_AC16_PLANAR
SpinnakerCameraPixelFormat.COORD3D_AC32F
SpinnakerCameraPixelFormat.COORD3D_AC32F_PLANAR
SpinnakerCameraPixelFormat.COORD3D_AC8
SpinnakerCameraPixelFormat.COORD3D_AC8_PLANAR
SpinnakerCameraPixelFormat.COORD3D_B10P
SpinnakerCameraPixelFormat.COORD3D_B12P
SpinnakerCameraPixelFormat.COORD3D_B16
SpinnakerCameraPixelFormat.COORD3D_B32F
SpinnakerCameraPixelFormat.COORD3D_B8
SpinnakerCameraPixelFormat.COORD3D_C10P
SpinnakerCameraPixelFormat.COORD3D_C12P
SpinnakerCameraPixelFormat.COORD3D_C16
SpinnakerCameraPixelFormat.COORD3D_C32F
SpinnakerCameraPixelFormat.COORD3D_C8
SpinnakerCameraPixelFormat.G10
SpinnakerCameraPixelFormat.G12
SpinnakerCameraPixelFormat.G16
SpinnakerCameraPixelFormat.G8
SpinnakerCameraPixelFormat.MONO10
SpinnakerCameraPixelFormat.MONO10P
SpinnakerCameraPixelFormat.MONO10PACKED
SpinnakerCameraPixelFormat.MONO12
SpinnakerCameraPixelFormat.MONO12P
SpinnakerCameraPixelFormat.MONO12PACKED
SpinnakerCameraPixelFormat.MONO14
SpinnakerCameraPixelFormat.MONO16
SpinnakerCameraPixelFormat.MONO16S
SpinnakerCameraPixelFormat.MONO1P
SpinnakerCameraPixelFormat.MONO2P
SpinnakerCameraPixelFormat.MONO32F
SpinnakerCameraPixelFormat.MONO4P
SpinnakerCameraPixelFormat.MONO8
SpinnakerCameraPixelFormat.MONO8S
SpinnakerCameraPixelFormat.R10
SpinnakerCameraPixelFormat.R12
SpinnakerCameraPixelFormat.R16
SpinnakerCameraPixelFormat.R8
SpinnakerCameraPixelFormat.RGB10
SpinnakerCameraPixelFormat.RGB10P
SpinnakerCameraPixelFormat.RGB10P32
SpinnakerCameraPixelFormat.RGB10_PLANAR
SpinnakerCameraPixelFormat.RGB12
SpinnakerCameraPixelFormat.RGB12P
SpinnakerCameraPixelFormat.RGB12_PLANAR
SpinnakerCameraPixelFormat.RGB14
SpinnakerCameraPixelFormat.RGB16
SpinnakerCameraPixelFormat.RGB16S
SpinnakerCameraPixelFormat.RGB16_PLANAR
SpinnakerCameraPixelFormat.RGB32F
SpinnakerCameraPixelFormat.RGB565P
SpinnakerCameraPixelFormat.RGB8
SpinnakerCameraPixelFormat.RGB8PACKED
SpinnakerCameraPixelFormat.RGB8_PLANAR
SpinnakerCameraPixelFormat.RGBA10
SpinnakerCameraPixelFormat.RGBA10P
SpinnakerCameraPixelFormat.RGBA12
SpinnakerCameraPixelFormat.RGBA12P
SpinnakerCameraPixelFormat.RGBA14
SpinnakerCameraPixelFormat.RGBA16
SpinnakerCameraPixelFormat.RGBA32F
SpinnakerCameraPixelFormat.RGBA8
SpinnakerCameraPixelFormat.YCBCR411_8
SpinnakerCameraPixelFormat.YCBCR422_8
SpinnakerCameraPixelFormat.YCBCR8
SpinnakerCameraPixelFormat.YUV411PACKED
SpinnakerCameraPixelFormat.YUV422PACKED
SpinnakerCameraPixelFormat.YUV444PACKED
VideoWriterFfmpeg
VideoWriterFfmpegFactory
VideoWriterOpenCv
WebCamera
- aind_behavior_services.rig.harp module
- aind_behavior_services.rig.network module
- aind_behavior_services.rig.visual_stimulation module
- Module contents
- aind_behavior_services.session package
- Module contents
AindBehaviorSessionModel
AindBehaviorSessionModel.aind_behavior_services_pkg_version
AindBehaviorSessionModel.allow_dirty_repo
AindBehaviorSessionModel.commit_hash
AindBehaviorSessionModel.date
AindBehaviorSessionModel.experiment
AindBehaviorSessionModel.experiment_version
AindBehaviorSessionModel.experimenter
AindBehaviorSessionModel.notes
AindBehaviorSessionModel.root_path
AindBehaviorSessionModel.session_name
AindBehaviorSessionModel.skip_hardware_validation
AindBehaviorSessionModel.subject
AindBehaviorSessionModel.version
AindBehaviorSessionModel.generate_session_name_default
- Module contents
- aind_behavior_services.task_logic package
- Submodules
- aind_behavior_services.task_logic.distributions module
BetaDistribution
BetaDistributionParameters
BinomialDistribution
BinomialDistributionParameters
DistributionBase
DistributionFamily
DistributionParametersBase
ExponentialDistribution
ExponentialDistributionParameters
GammaDistribution
GammaDistributionParameters
LogNormalDistribution
LogNormalDistributionParameters
NormalDistribution
NormalDistributionParameters
PdfDistribution
PdfDistributionParameters
PoissonDistribution
PoissonDistributionParameters
Scalar
ScalarDistributionParameter
ScalingParameters
TruncationParameters
UniformDistribution
UniformDistributionParameters
- Module contents
Submodules¶
aind_behavior_services.base module¶
- pydantic model aind_behavior_services.base.SchemaVersionedModel[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "SchemaVersionedModel", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" }, "version": { "description": "schema version", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version", "type": "string" } }, "required": [ "version" ] }
- Fields:
- Validators:
- field aind_behavior_services_pkg_version: Literal[pkg_version] = '0.11.0'[source]¶
- Constraints:
pattern = ^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)(?:-((?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*)(?:.(?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:+([0-9a-zA-Z-]+(?:.[0-9a-zA-Z-]+)*))?$
- Validated by:
- field version: str [Required][source]¶
schema version
- Constraints:
pattern = ^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)(?:-((?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*)(?:.(?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:+([0-9a-zA-Z-]+(?:.[0-9a-zA-Z-]+)*))?$
- Validated by:
- validator coerce_version » version, aind_behavior_services_pkg_version[source]¶
- Parameters:
v (str)
- Return type:
str
- class aind_behavior_services.base.SemVerAnnotation[source]¶
Bases:
object
A class representing semantic version annotations.
- aind_behavior_services.base.coerce_schema_version(cls, v, version_string='version', check_compatibility=True)[source]¶
- Parameters:
cls (type[SchemaVersionedModel])
v (str)
version_string (str)
check_compatibility (bool)
- Return type:
str
aind_behavior_services.data_types module¶
- pydantic model aind_behavior_services.data_types.DataTypes[source]¶
Bases:
SchemaVersionedModel
Show JSON schema
{ "title": "DataTypes", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" }, "version": { "const": "0.1.1", "default": "0.1.1", "title": "Version", "type": "string" }, "software_event": { "$ref": "#/$defs/SoftwareEvent" }, "render_synch_state": { "$ref": "#/$defs/RenderSynchState" } }, "$defs": { "DataType": { "enum": [ "string", "number", "boolean", "object", "array", "null" ], "title": "DataType", "type": "string" }, "RenderSynchState": { "properties": { "sync_quad_value": { "anyOf": [ { "maximum": 1, "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "The synchronization quad value", "title": "Sync Quad Value" }, "frame_index": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "description": "The frame index of the event", "title": "Frame Index" }, "frame_timestamp": { "anyOf": [ { "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "The timestamp of the frame", "title": "Frame Timestamp" } }, "title": "RenderSynchState", "type": "object" }, "SoftwareEvent": { "description": "A software event is a generic event that can be used to track any event that occurs in the software.", "properties": { "name": { "description": "The name of the event", "title": "Name", "type": "string" }, "timestamp": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "The timestamp of the event", "title": "Timestamp" }, "timestamp_source": { "$ref": "#/$defs/TimestampSource", "default": "null", "description": "The source of the timestamp" }, "frame_index": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "description": "The frame index of the event", "title": "Frame Index" }, "frame_timestamp": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "The timestamp of the frame", "title": "Frame Timestamp" }, "data": { "anyOf": [ {}, { "type": "null" } ], "default": null, "description": "The data of the event", "title": "Data" }, "dataType": { "$ref": "#/$defs/DataType", "default": "null", "description": "The data type of the event" }, "data_type_hint": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The data type hint of the event", "title": "Data Type Hint" } }, "required": [ "name" ], "title": "SoftwareEvent", "type": "object" }, "TimestampSource": { "enum": [ "null", "harp", "render" ], "title": "TimestampSource", "type": "string" } }, "required": [ "software_event", "render_synch_state" ], "x-abstract": "True" }
- Config:
json_schema_extra: dict = {‘x-abstract’: ‘True’}
- Fields:
- Validators:
- field render_synch_state: RenderSynchState [Required][source]¶
- field software_event: SoftwareEvent [Required][source]¶
- pydantic model aind_behavior_services.data_types.RenderSynchState[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "RenderSynchState", "type": "object", "properties": { "sync_quad_value": { "anyOf": [ { "maximum": 1, "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "The synchronization quad value", "title": "Sync Quad Value" }, "frame_index": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "description": "The frame index of the event", "title": "Frame Index" }, "frame_timestamp": { "anyOf": [ { "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "The timestamp of the frame", "title": "Frame Timestamp" } } }
- pydantic model aind_behavior_services.data_types.SoftwareEvent[source]¶
Bases:
BaseModel
,Generic
[TData
]A software event is a generic event that can be used to track any event that occurs in the software.
Show JSON schema
{ "title": "SoftwareEvent", "description": "A software event is a generic event that can be used to track any event that occurs in the software.", "type": "object", "properties": { "name": { "description": "The name of the event", "title": "Name", "type": "string" }, "timestamp": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "The timestamp of the event", "title": "Timestamp" }, "timestamp_source": { "$ref": "#/$defs/TimestampSource", "default": "null", "description": "The source of the timestamp" }, "frame_index": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "description": "The frame index of the event", "title": "Frame Index" }, "frame_timestamp": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "The timestamp of the frame", "title": "Frame Timestamp" }, "data": { "anyOf": [ {}, { "type": "null" } ], "default": null, "description": "The data of the event", "title": "Data" }, "dataType": { "$ref": "#/$defs/DataType", "default": "null", "description": "The data type of the event" }, "data_type_hint": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The data type hint of the event", "title": "Data Type Hint" } }, "$defs": { "DataType": { "enum": [ "string", "number", "boolean", "object", "array", "null" ], "title": "DataType", "type": "string" }, "TimestampSource": { "enum": [ "null", "harp", "render" ], "title": "TimestampSource", "type": "string" } }, "required": [ "name" ] }
- Fields:
- field timestamp_source: TimestampSource = TimestampSource.NULL[source]¶
The source of the timestamp
aind_behavior_services.patterns module¶
aind_behavior_services.utils module¶
- class aind_behavior_services.utils.CustomGenerateJsonSchema(*args, **kwargs)[source]¶
Bases:
GenerateJsonSchema
- enum_schema(schema)[source]¶
Generates a JSON schema that matches an Enum value.
- Parameters:
schema (EnumSchema) – The core schema.
- Returns:
The generated JSON schema.
- Return type:
dict[str, Any]
- get_flattened_oneof(schemas)[source]¶
- Parameters:
schemas (list[dict[str, Any]])
- Return type:
dict[str, Any]
- literal_schema(schema)[source]¶
Generates a JSON schema that matches a literal value.
- Parameters:
schema (LiteralSchema) – The core schema.
- Returns:
The generated JSON schema.
- Return type:
dict[str, Any]
- aind_behavior_services.utils.bonsai_sgen(schema_path, output_path, namespace='DataSchema', root_element=None, serializer=None, executable='dotnet tool run bonsai.sgen')[source]¶
Runs Bonsai.SGen to generate a Bonsai-compatible schema from a json-schema model For more information run bonsai.sgen –help in the command line.
- Returns:
The result of running the command.
- Return type:
CompletedProcess
- Parameters:
schema_path (PathLike) – Target Json Schema file
output_path (PathLike) – Specifies the name of the file containing the generated code.
namespace (Optional[str], optional) – Specifies the namespace to use for all generated serialization classes. Defaults to DataSchema.
root_element (Optional[str], optional) – Specifies the name of the class used to represent the schema root element. If None, it will use the json schema root element. Defaults to None.
serializer (Optional[List[BonsaiSgenSerializers]], optional) – Specifies the serializer data annotations to include in the generated classes. Defaults to None.
executable (PathLike | str)
- aind_behavior_services.utils.convert_pydantic_to_bonsai(models, namespace='DataSchema', schema_path=PosixPath('src/DataSchemas'), output_path=PosixPath('src/Extensions'), serializer=None, skip_sgen=False, export_schema_kwargs=None)[source]¶
- Parameters:
models (Dict[str, List[Type[BaseModel]] | Type[BaseModel]])
namespace (str)
schema_path (PathLike)
output_path (PathLike)
serializer (List[BonsaiSgenSerializers] | None)
skip_sgen (bool)
export_schema_kwargs (Dict[str, Any] | None)
- Return type:
Dict[str, CompletedProcess | None]
- aind_behavior_services.utils.export_schema(model, schema_generator=<class 'aind_behavior_services.utils.CustomGenerateJsonSchema'>, mode='serialization', def_keyword='definitions', models_title=None)[source]¶
Export the schema of a model to a json file
- Parameters:
model (List[Type[BaseModel]] | Type[BaseModel])
schema_generator (Type[GenerateJsonSchema])
mode (Literal['validation', 'serialization'])
def_keyword (str)
models_title (str | None)
- aind_behavior_services.utils.format_datetime(value, is_tz_strict=False)[source]¶
- Parameters:
value (datetime)
is_tz_strict (bool)
- Return type:
str
- aind_behavior_services.utils.get_fields_of_type(searchable, target_type, *, recursive=True, stop_recursion_on_type=True)[source]¶
- Parameters:
searchable (BaseModel | Dict | List)
target_type (Type[T])
recursive (bool)
stop_recursion_on_type (bool)
- Return type:
List[Tuple[str | None, T]]
- aind_behavior_services.utils.model_from_json_file(json_path, model)[source]¶
- Parameters:
json_path (PathLike | str)
model (type[TModel])
- Return type:
TModel
- aind_behavior_services.utils.now()[source]¶
Returns the current time as a timezone unaware datetime.
- Return type:
datetime
- aind_behavior_services.utils.open_bonsai_process(workflow_file, bonsai_exe='bonsai/bonsai.exe', is_editor_mode=True, is_start_flag=True, layout=None, additional_properties=None, log_file_name=None, cwd=None, creation_flags=None, print_cmd=False)[source]¶
- Parameters:
workflow_file (PathLike | str)
bonsai_exe (PathLike | str)
is_editor_mode (bool)
is_start_flag (bool)
layout (PathLike | str | None)
additional_properties (Dict[str, str] | None)
log_file_name (str | None)
cwd (PathLike | str | None)
creation_flags (int | None)
print_cmd (bool)
- Return type:
Popen
- aind_behavior_services.utils.pascal_to_snake_case(s)[source]¶
Converts a PascalCase string to snake_case.
- Parameters:
s (str) – The PascalCase string to be converted.
- Returns:
The snake_case string.
- Return type:
str
- aind_behavior_services.utils.run_bonsai_process(workflow_file, bonsai_exe='bonsai/bonsai.exe', is_editor_mode=True, is_start_flag=True, layout=None, additional_properties=None, cwd=None, timeout=None, print_cmd=False)[source]¶
- Parameters:
workflow_file (PathLike | str)
bonsai_exe (PathLike | str)
is_editor_mode (bool)
is_start_flag (bool)
layout (PathLike | str | None)
additional_properties (Dict[str, str] | None)
cwd (PathLike | str | None)
timeout (float | None)
print_cmd (bool)
- Return type:
CompletedProcess
- aind_behavior_services.utils.screaming_snake_case_to_pascal_case(s)[source]¶
Converts a SCREAMING_SNAKE_CASE string to PascalCase.
- Parameters:
s (str) – The SCREAMING_SNAKE_CASE string to be converted.
- Returns:
The PascalCase string.
- Return type:
str
- aind_behavior_services.utils.snake_to_pascal_case(s)[source]¶
Converts a snake_case string to PascalCase.
- Parameters:
s (str) – The snake_case string to be converted.
- Returns:
The PascalCase string.
- Return type:
str
Module contents¶
- pydantic model aind_behavior_services.AindBehaviorRigModel[source]¶
Bases:
SchemaVersionedModel
Show JSON schema
{ "title": "AindBehaviorRigModel", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" }, "version": { "description": "schema version", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version", "type": "string" }, "computer_name": { "description": "Computer name", "title": "Computer Name", "type": "string" }, "rig_name": { "description": "Rig name", "title": "Rig Name", "type": "string" } }, "required": [ "version", "rig_name" ] }
- Fields:
computer_name (str)
rig_name (str)
- Validators:
- pydantic model aind_behavior_services.AindBehaviorSessionModel[source]¶
Bases:
SchemaVersionedModel
Show JSON schema
{ "title": "AindBehaviorSessionModel", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" }, "version": { "const": "0.3.1", "default": "0.3.1", "title": "Version", "type": "string" }, "experiment": { "description": "Name of the experiment", "title": "Experiment", "type": "string" }, "experimenter": { "default": [], "description": "Name of the experimenter", "items": { "type": "string" }, "title": "Experimenter", "type": "array" }, "date": { "description": "Date of the experiment", "format": "date-time", "title": "Date", "type": "string" }, "root_path": { "description": "Root path where data will be logged", "title": "Root Path", "type": "string" }, "session_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Name of the session. This will be used to create a folder in the root path.", "title": "Session Name" }, "subject": { "description": "Name of the subject", "title": "Subject", "type": "string" }, "experiment_version": { "description": "Version of the experiment", "title": "Experiment Version", "type": "string" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Notes about the experiment", "title": "Notes" }, "commit_hash": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Commit hash of the repository", "title": "Commit Hash" }, "allow_dirty_repo": { "default": false, "description": "Allow running from a dirty repository", "title": "Allow Dirty Repo", "type": "boolean" }, "skip_hardware_validation": { "default": false, "description": "Skip hardware validation", "title": "Skip Hardware Validation", "type": "boolean" } }, "required": [ "experiment", "root_path", "subject", "experiment_version" ] }
- Fields:
- Validators:
generate_session_name_default
»all fields
- field date: Annotated[AwareDatetime, WrapValidator(func=_add_default_tz, json_schema_input_type=PydanticUndefined), FieldInfo(annotation=NoneType, required=True, validate_default=True)] [Optional][source]¶
Date of the experiment
- Constraints:
func = <function _add_default_tz at 0x7f3f2bc9d800>
json_schema_input_type = PydanticUndefined
- Validated by:
- field session_name: str | None = None[source]¶
Name of the session. This will be used to create a folder in the root path.
- Validated by:
- pydantic model aind_behavior_services.AindBehaviorTaskLogicModel[source]¶
Bases:
Task
Show JSON schema
{ "title": "AindBehaviorTaskLogicModel", "type": "object", "properties": { "name": { "description": "Name of the task.", "title": "Name", "type": "string" }, "description": { "default": "", "description": "Description of the task.", "title": "Description", "type": "string" }, "task_parameters": { "$ref": "#/$defs/TaskParameters", "description": "Parameters of the task logic" }, "version": { "description": "task schema version", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version", "type": "string" }, "stage_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Optional stage name the `Task` object instance represents.", "title": "Stage Name" } }, "$defs": { "TaskParameters": { "additionalProperties": true, "properties": { "rng_seed": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Seed of the random number generator", "title": "Rng Seed" }, "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" } }, "title": "TaskParameters", "type": "object" } }, "additionalProperties": false, "required": [ "name", "task_parameters", "version" ] }
- Config:
extra: str = forbid
validate_assignment: bool = True
validate_default: bool = True
strict: bool = True
str_strip_whitespace: bool = True
- Fields:
- Validators:
- field task_parameters: TaskParameters [Required][source]¶
Parameters of the task logic
- pydantic model aind_behavior_services.SchemaVersionedModel[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "SchemaVersionedModel", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" }, "version": { "description": "schema version", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version", "type": "string" } }, "required": [ "version" ] }
- Fields:
- Validators:
- field aind_behavior_services_pkg_version: Literal[pkg_version] = '0.11.0'[source]¶
- Constraints:
pattern = ^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)(?:-((?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*)(?:.(?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:+([0-9a-zA-Z-]+(?:.[0-9a-zA-Z-]+)*))?$
- Validated by:
- field version: str [Required][source]¶
schema version
- Constraints:
pattern = ^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)(?:-((?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*)(?:.(?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:+([0-9a-zA-Z-]+(?:.[0-9a-zA-Z-]+)*))?$
- Validated by:
- validator coerce_version » version, aind_behavior_services_pkg_version[source]¶
- Parameters:
v (str)
- Return type:
str