2.3.14 Segments

Segments are how to define an event location in the Toolkit. They contain the start and end locations of the event and the Label for the event.

Examples:

from mplabml.datamanager.segment import Segment, SegmentSet

# to see a list of segments associated with a capture
segment_set = SegmentSet(client._connection, client._project, capture)
print(segment_set.segments)

# To create a new segment
segment = Segment(client._connection, project, capture, segmenter, label, label_value)
segment.sample_start = 100
segment.sample_end = 1000
segment.insert()
class mplabml.datamanager.segment. Segment(connection, project, capture, segmenter=None, label=None, label_value=None)

Base class for a label object.

delete()

Calls the REST API and deletes the object from the server

insert()

Calls the REST API and inserts a metadata object onto the server using the local object’s properties

refresh()

Calls the REST API and populates the local object’s properties from the server

property sample_end

The index of the last sample of the label

property sample_start

The index of the first sample of the label

property segmenter

The index of the last sample of the label

update()

Calls the REST API and updates the object on the server

property uuid

Auto generated unique identifier for the metadata object

class mplabml.datamanager.segment. SegmentSet(connection, project, capture, initialize_set=True)

Base class for a collection of segments

property get_set_url

Replace this with the url to call to pull down the set objects