Captures

The sensor data files you add to a Project are called Captures. A Capture can contain multiple time series columns corresponding to different devices, sensors, channels, or axes, as long as all of the columns in the capture describe the same period of time.

Examples:

# to list all capture files

client.list_captures()

my_capture = client.project.captures.get_capture_by_filename("Capture Name")

my_capture = client.project.captures.get_capture_by_uuid(uuid)
class sensiml.datamanager.captures.Captures(connection, project)

Base class for a collection of Captures.

build_capture_list(force: bool = True)

Populates the function_list property from the server.

create_capture(filename, filepath, asynchronous=True, capture_info=None)

Creates a capture object from the given filename and filepath.

Parameters
  • filename (str) – desired name of the file on the server

  • filepath (str) – local path to the file to be uploaded

  • asynchronous (bool) – Whether to process asynchronously

Returns

capture object

Raises

CaptureExistsError, if the Capture already exists on the server

get_capture_by_filename(filename, force=False)

Gets a capture object from the server using its filename property.

Parameters
  • filename (str) – the capture’s name

  • force (bool) – rebuild the cached list of files

Returns

capture object or None if it does not exist

get_capture_by_uuid(uuid)

Gets a capture object from the server using its filename property.

Parameters

filename (str) – the capture’s name

Returns

capture object or None if it does not exist

get_captures()

Gets all captures from the server.

Returns

list of captures for the project

get_captures_by_metadata(key, value)

Gets captures by existing metadata key-values.

Parameters
  • key (str) – the name of the metadata item

  • value (str, int, or float) – the value to search for

Returns

list of captures that have the desired metadata key-value pair

get_label_names()

Gets all the label names within a project.

Returns

list of label names

get_label_names_and_values()

Gets all the label names and possible values for a project.

Returns

list(dict) containing metadata names and values

get_metadata_names()

Gets all the metadata names within a project.

Returns

list of metadata names

get_metadata_names_and_values()

Gets all the metadata names and possible values for a project.

Returns

list(dict) containing metadata names and values

get_or_create(filename, filepath, asynchronous=True, capture_info=None)

Creates a capture object from the given filename and filepath.

Parameters
  • filename (str) – desired name of the file on the server

  • filepath (str) – local path to the file to be uploaded

  • asynchronous (bool) – Whether to process asynchronously

Returns

capture object

Raises

CaptureExistsError, if the Capture already exists on the server

get_statistics()

Gets all capture statistics for the project.

Returns

DataFrame of capture statistics

class sensiml.datamanager.capture.Capture(connection, project, filename='', path='', uuid='', capture_configuration_uuid=None, capture_info=None, created_at=None, **kwargs)

Base class for a Capture.

await_ready(sleep=3, retries=0)

Blocks until Capture (Capture) is ready or failed

Parameters
  • sleep (int) – Number of seconds to sleep between polling

  • retries (int) – Number of times to retry before unblocking and returning False. Use 0 for infinite.

Returns

None or raises CaptureUploadFailureError if upload failed.

property capture_info

Info about capture

delete()

Calls the REST API to delete the capture from the server.

download(outdir=None)

Downloads the capture file from the server.

classmethod initialize_from_dict(capture_dict)

Reads a dictionary or properties and populates a single capture.

Parameters

capture_dict (dict) – contains the capture’s ‘name’ property

Returns

capture object

insert(asynchronous=False)

Calls the REST API to insert a new Capture.

property path

The local or server path to the Capture file data

property ready

Returns if Capture (Capture) is ready or not

Returns

True if task is ready or False if task is pending. Raises Exception if task failed.

Return type

Boolean

refresh()

Calls the REST API and self populates properties from the server.

update()

Calls the REST API to update the capture.

property uuid

Auto generated unique identifier for the Capture object