analysis
Pydantic models for the analysis response from the AnalysisController --> API.
AnalysisIdMixin
pydantic-model
¶
AnalysisListResponse
pydantic-model
¶
Bases: PaginatedResponse
A page of analyses, of a project or of a recording.
Fields:
-
total(NonNegativeInt) -
offset(NonNegativeInt) -
limit(PositiveInt) -
analyses(list[AnalysisOut])
AnalysisLogs
pydantic-model
¶
AnalysisOut
pydantic-model
¶
Bases: AnalysisIdMixin, AnalysisStatusMixin, AnalysisTimingMixin
Analysis information available to user.
Combines identification, timing, context annotations, and cost fields into a single flat response model.
Fields:
-
enqueue_time(datetime) -
start_time(datetime | None) -
end_time(datetime | None) -
status(AnalysisStatus) -
status_message(str | None) -
failure_code(ErrorCode | None) -
id(UUID) -
owner_id(UUID | None) -
analysis_types(list[AnalysisType]) -
analysis_config_name(AnalysisConfigNameStr) -
analysis_config_id(str) -
parameter_hash(str | None) -
study_name(NameString | None) -
study_id(UUID | None) -
project_name(NameString | None) -
project_id(UUID | None) -
recording_id(UUID | None) -
recording_file_name(str | None) -
channels(list[ChannelName] | None) -
parameters(list[tuple[str, str | int | float | bool]]) -
research_parameters(list[str] | None) -
analysis_hours(NonNegativeFloat) -
cost(NonNegativeFloat) -
cost_currency(Currency) -
deleted(bool) -
charged(bool) -
refunded(bool)
analysis_config_id
pydantic-field
¶
ID of the analysis configuration used for the analysis.
analysis_config_name
pydantic-field
¶
Name of the analysis configuration used for the analysis.
analysis_hours = 0
pydantic-field
¶
Number of hours of recording analysed.
analysis_types
pydantic-field
¶
List of analysis types the analysis performed.
channels = None
pydantic-field
¶
Channels used in the analysis. None if all available channels were used.
charged = False
pydantic-field
¶
Whether its cost was charged: a run in the platform's pool when it completes, a run at a site when a runner of the site is handed it, whatever happens after. False from a server that predates it.
cost = 0
pydantic-field
¶
Cost of the analysis.
cost_currency = Currency.CREDITS
pydantic-field
¶
The currency of the cost.
deleted = False
pydantic-field
¶
Flag indicating if the analysis has been deleted
owner_id = None
pydantic-field
¶
The member who added it. Only they, or the project's owner, may change or remove it; it passes to the project's owner when they leave the organization.
parameter_hash = None
pydantic-field
¶
SHA-1 hash of the analysis parameters (config ID + parameters + dependencies + channels).
parameters
pydantic-field
¶
Parameters used in the analysis.
project_id = None
pydantic-field
¶
ID of the project the analysis belongs to. None if deleted.
project_name = None
pydantic-field
¶
Name of the project the analysis belongs to. None if deleted.
recording_file_name = None
pydantic-field
¶
Name of the recording file the analysis was performed on. None if deleted.
recording_id = None
pydantic-field
¶
ID of the recording the analysis was performed on. None if deleted.
refunded = False
pydantic-field
¶
Whether its charge was refunded automatically, because the run was lost to a fault on youSleep's side. False from a server that predates it.
research_parameters = None
pydantic-field
¶
Parameters (by API name) whose value lay outside the analysis configuration's characterised regime. A non-empty list marks this analysis as run in research mode: fully supported, but its outputs are exploratory because the analysis was not characterised at those values. Empty when every parameter was within the regime (or no regime is declared). None when not derived — the value could not be resolved against the configuration.
study_id = None
pydantic-field
¶
ID of the study the analysis belongs to. None if deleted.
study_name = None
pydantic-field
¶
Name of the study the analysis belongs to. None if deleted.
AnalysisStatusMixin
pydantic-model
¶
Bases: BaseModel
Mixin for analysis status fields.
Fields:
-
status(AnalysisStatus) -
status_message(str | None) -
failure_code(ErrorCode | None)
failure_code = None
pydantic-field
¶
Machine-readable cause when the analysis FAILED (one of the analysis_* error codes), for grouping failures without parsing the status message. None for non-failed analyses and for failures recorded before this field existed.
status
pydantic-field
¶
Status of the analysis
status_message = None
pydantic-field
¶
Status message of the analysis
AnalysisTimingMixin
pydantic-model
¶
Bases: BaseModel
Mixin for analysis timing fields.
Fields:
-
enqueue_time(datetime) -
start_time(datetime | None) -
end_time(datetime | None)
end_time = None
pydantic-field
¶
Time the analysis ended (completed, canceled or failed)
enqueue_time
pydantic-field
¶
Time the analysis was enqueued
processing_duration_sec
property
¶
Duration of the analysis in seconds.
queue_duration_sec
property
¶
Duration of the analysis in seconds.
start_time = None
pydantic-field
¶
Time the analysis started
AnnotatedAnalysisEvents
pydantic-model
¶
Bases: BaseModel
Events with associated analysis metadata for API download.
Fields:
-
events(list[Event]) -
analysis(AnalysisOut) -
notice(str | None)
notice = None
pydantic-field
¶
The research-use notice that travels with this result, in the wording its analyses' licences call for. Always set by the API.