Run#
- class nominal.core.Run(rid, name, description, properties, labels, links, start, end, run_number, assets, created_at, is_archived)#
Bases:
HasRid,RefreshableGrpcMixin[Run],_DatasetScopeIngestMixinA view of asset and dataset data within a time interval.
- properties: NominalProperties#
- start: IntegralNanosecondsUTC#
- end: IntegralNanosecondsUTC | None#
- created_at: IntegralNanosecondsUTC#
- add_ardupilot_dataflash(data_scope_name, path, tags=None)#
Add a Dataflash file to the dataset selected by
data_scope_name.This method behaves like
nominal.core.Dataset.add_ardupilot_dataflash, except that the data scope’s required tags are merged intotagsbefore ingest (with user-provided tags taking precedence on key collisions).For file expectations and return value details, see
nominal.core.Dataset.add_ardupilot_dataflash.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
- Return type:
- add_attachments(attachments)#
Add attachments that have already been uploaded to this run.
attachmentscan beAttachmentinstances, or attachment RIDs.- Raises:
NominalError – If adding the attachments fails.
- add_avro_stream(data_scope_name, path, *, timestamp_type=None, tags=None)#
Upload an avro stream file to the dataset selected by
data_scope_name.This method behaves like
nominal.core.Dataset.add_avro_stream, except that the data scope’s required tags are merged intotagsbefore ingest (with user-provided tags taking precedence on key collisions). Tags in the avro records take precedence over both, so a scope tag whose key a record already sets is not applied to that record’s data.For schema requirements, argument semantics, and return value details, see
nominal.core.Dataset.add_avro_stream.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
- Return type:
- add_comment(content)#
Post a markdown comment to this run’s discussion.
- Parameters:
content (str)
Markdown content for the comment.
- Returns:
The created
Comment.- Raises:
NominalError – If the comments service request fails.
- Return type:
- add_containerized(data_scope_name, extractor, sources, *, arguments=None, tags=None, timestamp_column=None, timestamp_type=None)#
Add data from proprietary formats using a pre-registered custom extractor.
This method behaves like
nominal.core.Dataset.add_containerized, except that the data scope’s required tags are merged intotagsbefore ingest (with user-provided tags taking precedence on key collisions).Pass both
timestamp_columnandtimestamp_type, or neither; this wrapper enforces that before delegating.For extractor inputs, tagging semantics, timestamp metadata behavior, and return value details, see
nominal.core.Dataset.add_containerized.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
ValueError – If only one of
timestamp_columnandtimestamp_typeis given.
- Return type:
- add_dataset(ref_name, dataset, *, series_tags=None, offset=None)#
Add a dataset to this run.
Datasets map “ref names” (their name within the run) to a Dataset (or dataset rid). The same type of datasets should use the same ref name across runs, since checklists and templates use ref names to reference datasets.
- Parameters:
- Raises:
NominalError – If adding the data source fails.
- add_datasets(datasets, *, series_tags=None, offset=None)#
Add multiple datasets to this run.
Datasets map “ref names” (their name within the run) to a Dataset (or dataset rid). The same type of datasets should use the same ref name across runs, since checklists and templates use ref names to reference datasets.
- Parameters:
- Raises:
NominalError – If adding the data sources fails.
- add_from_io(data_scope_name, data_stream, file_type, *, timestamp_column, timestamp_type, file_name=None, tag_columns=None, tags=None)#
Append to the dataset selected by
data_scope_namefrom a file-like object.This method behaves like
nominal.core.Dataset.add_from_io, except that the data scope’s required tags are merged intotagsbefore ingest (with user-provided tags taking precedence on key collisions).For stream requirements, supported file types, argument semantics, and return value details, see
nominal.core.Dataset.add_from_io.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
- Return type:
- add_journal_json(data_scope_name, path, *, channel=None, timestamp_column=None, timestamp_type=None)#
Add a journald json file to the dataset selected by
data_scope_name.This method behaves like
nominal.core.Dataset.add_journal_json, with one important difference: the journal json ingest request has no field for tags, so a scope’s required tags cannot be applied to the ingested logs. If the selected scope requires tags, this method raisesRuntimeErrorrather than ingesting logs that would be missing them. The file can still be ingested on the dataset directly, if its own contents already carry what the scope needs.Pass both
timestamp_columnandtimestamp_type, or neither; this wrapper enforces that before delegating.For file expectations, timestamp argument semantics, and return value details, see
nominal.core.Dataset.add_journal_json.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
RuntimeError – If the data scope requires series tags.
ValueError – If only one of
timestamp_columnandtimestamp_typeis given.
- Return type:
- add_mcap(data_scope_name, path, *, include_topics=None, exclude_topics=None, tags=None, ignore_invalid_topics=None)#
Add an MCAP file to the dataset selected by
data_scope_name.This method behaves like
nominal.core.Dataset.add_mcap, except that the data scope’s required tags are merged intotagsbefore ingest (with user-provided tags taking precedence on key collisions).For topic-filtering semantics and return value details, see
nominal.core.Dataset.add_mcap.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
- Return type:
- add_tabular_data(data_scope_name, path, *, timestamp_column, timestamp_type, tag_columns=None, tags=None)#
Append tabular data on-disk to the dataset selected by
data_scope_name.This method behaves like
nominal.core.Dataset.add_tabular_data, except that the data scope’s required tags are merged intotagsbefore ingest (with user-provided tags taking precedence on key collisions).For supported file types, argument semantics, and return value details, see
nominal.core.Dataset.add_tabular_data.- Raises:
NominalNotFoundError – If no readable dataset has this data scope name.
- Return type:
- add_video(ref_name, video)#
Add a video to a run via video object or RID.
- Raises:
NominalError – If adding the data source fails.
- archive()#
Archive this run. Archived runs are not deleted, but are hidden from the UI.
Note
This does not update the instance in place; call
refresh()to see the change reflected.- Raises:
NominalError – If the archive request fails.
- create_event(name, type, start, duration=0, *, description=None, properties=None, labels=())#
Create an event associated with all associated assets of this run at a given point in time.
- Parameters:
name (str)
Name of the event
type (EventType)
Verbosity level of the event.
-
Starting timestamp of the event
-
Duration of the event, or 0 for an event without duration.
description (str | None)
Optionally, a human readable description of the event to create
properties (Mapping[str, str | float] | None)
String or numeric properties for the created event. Integers are stored as floats.
-
Sequence of labels to use on the created event.
- Returns:
The created event that is associated with all of the assets associated with this run..
- Raises:
TypeError – If a property value is a boolean or is not a string, integer, or float.
- Return type:
- get_dataset(ref_name)#
Get a dataset for this run by its ref name.
- Parameters:
ref_name (str)
Name of the run datasource reference to resolve.
- Returns:
Dataset associated with the ref name.
- Raises:
NominalNotFoundError – If no readable dataset has this ref name.
- Return type:
- get_video(ref_name)#
Get a video for this run by its ref name.
- Parameters:
ref_name (str)
Name of the run datasource reference to resolve.
- Returns:
Video associated with the ref name.
- Raises:
NominalNotFoundError – If no readable video has this ref name.
- Return type:
- list_assets()#
List assets associated with this run.
- Return type:
Sequence[’Asset’]
- list_attachments()#
List a sequence of Attachments associated with this Run.
Attachments that the caller cannot access are left out.
- Return type:
- list_datasets()#
List the datasets associated with this run.
- list_videos()#
List the videos associated with this run.
- remove_attachments(attachments)#
Remove attachments from this run. Does not remove the attachments from Nominal.
attachmentscan beAttachmentinstances, or attachment RIDs.- Raises:
NominalError – If removing the attachments fails.
- remove_data_sources(*, ref_names=None, data_sources=None)#
Remove data sources from this run.
The list data_sources can contain Dataset or Video instances, or rids as string. A spatial can be removed by passing its rid.
- Raises:
NominalError – If retrieving or updating the run’s data sources fails.
- search_events(*, search_text=None, after=None, before=None, labels=None, properties=None, created_by_rid=None, workbook_rid=None, data_review_rid=None, assignee_rid=None, event_type=None, priority=None, origin_types=None, archive_status=ArchiveStatusFilter.NOT_ARCHIVED)#
Search for events associated with any of the assets of this run.
The run’s assets are matched as a union: an event is included if it is associated with at least one of the run’s assets. The remaining filters are ANDed together with that asset filter and with each other.
- Parameters:
search_text (str | None)
Searches for a string in the event’s metadata.
after (str | datetime | int | None)
Filters to end times after this time, exclusive.
before (str | datetime | int | None)
Filters to start times before this time, exclusive.
-
A list of labels that must ALL be present on an event to be included.
properties (Mapping[str, str | float] | None)
Property equalities that must ALL match. String values match string properties; numeric values match numeric properties, without coercing strings to numbers. Integer values are converted to floats.
created_by_rid (str | None)
Rid of the author that must be present on an event to be included.
workbook_rid (str | None)
Search for events on the given workbook.
data_review_rid (str | None)
Search for events from the given data review.
assignee_rid (str | None)
Search for events with the given assignee.
event_type (EventType | None)
Search for events of the given type.
priority (Priority | None)
Filter events by disposition priority. None leaves priority unrestricted.
origin_types (Iterable[SearchEventOriginType] | None)
Search for events created by any of the given origin types.
archive_status (ArchiveStatusFilter)
Filter by archive status. Defaults to NOT_ARCHIVED.
- Returns:
Events associated with any of this run’s assets that match all of the provided filters. Returns an empty sequence if the run has no associated assets.
- Raises:
TypeError – If a property value is a boolean or is not a string, integer, or float.
- Return type:
- search_workbooks(*, exact_match=None, search_text=None, labels=None, properties=None, asset_rid=None, created_by_rid=None, include_drafts=False, archive_status=ArchiveStatusFilter.NOT_ARCHIVED)#
Search for workbooks associated with this Run. See nominal.core.NominalClient.search_workbooks for details
- unarchive()#
Unarchive this run, allowing it to appear on the UI.
Note
This does not update the instance in place; call
refresh()to see the change reflected.- Raises:
NominalError – If the unarchive request fails.
- update(*, name=None, start=None, end=None, description=None, properties=None, labels=None, links=None, assets=None)#
Replace run metadata. Updates the current instance, and returns it. Only the metadata passed in will be replaced, the rest will remain untouched.
Links can be URLs, tuples of (URL, name), or dicts of {url=URL, title=name}.
- Parameters:
name (str | None)
Replacement name.
start (datetime | IntegralNanosecondsUTC | None)
Replacement start timestamp.
end (datetime | IntegralNanosecondsUTC | None)
Replacement end timestamp.
description (str | None)
Replacement description.
properties (NominalProperties | None)
String or numeric properties. Integers are stored as floats. None leaves properties unchanged; an empty mapping clears them.
labels (Sequence[str] | None)
Replacement labels.
links (Sequence[str | Link | LinkDict] | None)
Replacement links.
assets (Sequence[Asset | str] | None)
Replacement assets or asset RIDs.
- Return type:
Self
Note
This replaces the metadata rather than appending it. To append to labels or properties, merge them before calling this method. E.g.:
new_labels = ["new-label-a", "new-label-b"] for old_label in run.labels: new_labels.append(old_label) run = run.update(labels=new_labels)
Note
When
assetsis provided it fully replaces the run’s asset list. To append an asset, merge with the existing list first:run = run.update(assets=[*run.assets, new_asset])- Raises:
TypeError – If a property value is a boolean or is not a string, integer, or float.
NominalError – If the update request fails.
- Return type:
Self