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)
Copyright 2017-2024 SensiML Corporation
This file is part of SensiML™ Piccolo AI™.
SensiML Piccolo AI is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
SensiML Piccolo AI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with SensiML Piccolo AI. If not, see <https://www.gnu.org/licenses/>.
- class sensiml.datamanager.captures.Captures(connection: Connection, project: Project)
Base class for a collection of Captures.
- build_capture_list(force: bool = True) dict
Populates the function_list property from the server.
- create_capture(filename: str, filepath: str, asynchronous: bool = True, capture_info: Optional[dict] = None) Capture
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: str, force: bool = False) Capture
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: str) Capture
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() list[sensiml.datamanager.capture.Capture]
Gets all captures from the server.
- Returns
list of captures for the project
- get_captures_by_metadata(key: str, value: any)
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() list[str]
Gets all the label names within a project.
- Returns
list of label names
- get_label_names_and_values() dict
Gets all the label names and possible values for a project.
- Returns
list(dict) containing metadata names and values
- get_metadata_names() list[str]
Gets all the metadata names within a project.
- Returns
list of metadata names
- get_metadata_names_and_values() list[dict]
Gets all the metadata names and possible values for a project.
- Returns
list(dict) containing metadata names and values
- get_or_create(filename: str, filepath: str, asynchronous: bool = True, capture_info: Optional[dict] = None) Capture
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() Tuple[DataFrame, bool]
Gets all capture statistics for the project.
- Returns
DataFrame of capture statistics
Copyright 2017-2024 SensiML Corporation
This file is part of SensiML™ Piccolo AI™.
SensiML Piccolo AI is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
SensiML Piccolo AI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with SensiML Piccolo AI. If not, see <https://www.gnu.org/licenses/>.
- class sensiml.datamanager.capture.Capture(connection: Connection, project: Project, filename: str = '', path: str = '', uuid: str = '', capture_configuration_uuid: Optional[str] = None, capture_info: Optional[dict] = None, created_at: Optional[str] = None, **kwargs)
Base class for a Capture.
- await_ready(sleep: int = 3, retries: int = 0) bool
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: dict
Info about capture
- delete() Response
Calls the REST API to delete the capture from the server.
- download(outdir: Optional[str] = None) Response
Downloads the capture file from the server.
- classmethod initialize_from_dict(capture_dict: dict) Capture
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: bool = False) Response
Calls the REST API to insert a new Capture.
- property path: str
The local or server path to the Capture file data
- property ready: bool
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() Response
Calls the REST API and self populates properties from the server.
- update() Response
Calls the REST API to update the capture.
- property uuid: str
Auto generated unique identifier for the Capture object