Skip to content

Consider nesting Calibration in Device #850

Description

@bruno-f-cruz

Is your feature request related to a problem? Please describe.
In all the cases I have encountered, Calibration is always tied to a specific device. Indeed, the current spec makes this clear in the Calibration class by adding a device_name REQUIRED property to keep track of this association

class Calibration(AindModel):
"""Generic calibration class"""
calibration_date: datetime = Field(..., title="Date and time of calibration")
device_name: str = Field(..., title="Device name", description="Must match a device name in rig/instrument")
description: str = Field(..., title="Description", description="Brief description of what is being calibrated")
input: AindGenericType = Field(AindGeneric(), description="Calibration input", title="inputs")
output: AindGenericType = Field(AindGeneric(), description="Calibration output", title="outputs")
notes: Optional[str] = Field(None, title="Notes")

Describe the solution you'd like
Make calibration a nested field inside Device with the Optional[Calibration] typing. For hardware installation and experiment specification this would be a huge help and it would allow users to not have to grab cross-referenced data across different class (well actually across schemas, since Calibration is currently also stored in Session (?))

Describe alternatives you've considered
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions