Event#

class nominal.core.Event(rid: str, asset_rids: Sequence[str], name: str, description: str, start: IntegralNanosecondsUTC, duration: IntegralNanosecondsDuration, properties: NominalProperties, labels: Sequence[str], type: EventType, is_archived: bool, disposition: EventDisposition | None)#

Bases: HasRid, RefreshableGrpcMixin[Event]

An annotation at a point or interval in time, optionally associated with assets.

rid: str#
asset_rids: Sequence[str]#
name: str#
description: str#
start: IntegralNanosecondsUTC#
duration: IntegralNanosecondsDuration#
properties: NominalProperties#
labels: Sequence[str]#
type: EventType#
is_archived: bool#
disposition: EventDisposition | None#

None until the event is opened for disposition.

Checklist-fired events are opened automatically. Any event can be opened.

archive() → None#

Archives the event, preventing it from showing up in workbooks.

Note

This does not update the instance in place; call refresh() to see the change reflected.

refresh() → Self#
unarchive() → None#

Unarchives the event, allowing it to show up in workbooks.

Note

This does not update the instance in place; call refresh() to see the change reflected.

update(*, name: str | None = None, description: str | None = None, assets: Iterable[Asset | str] | None = None, start: datetime | int | None = None, duration: timedelta | int | None = None, properties: Mapping[str, str | float] | None = None, labels: Iterable[str] | None = None, type: EventType | None) → Self#

Replace event metadata, updating the current instance and returning it.

Metadata is replaced rather than appended. To add to labels or properties, merge them before calling. E.g.:

new_labels = ["new-label-a", "new-label-b"]
for old_label in event.labels:
    new_labels.append(old_label)
event = event.update(labels=new_labels)
Parameters:
  • name – New name for the event.

  • description – New description for the event.

  • assets – Assets or asset rids the event applies to. An empty sequence clears them.

  • start – New starting timestamp for the event.

  • duration – New duration for the event.

  • properties – String or numeric properties. Integers are stored as floats. None leaves properties unchanged; an empty mapping clears them.

  • labels – Labels replacing the existing ones. An empty sequence clears them.

  • type – New verbosity level for the event.

Returns:

This event, updated in place.

Note

Every argument left as None is omitted from the request and the corresponding field is left unchanged. That is distinct from passing an empty collection, which clears the field.

Raises:
  • TypeError – If a property value is a boolean or is not a string, integer, or float.

  • ValueError – If the backend does not echo back exactly one updated event.

  • NominalError – If the update request fails.