asset

class virtualitics_sdk.assets.asset.Asset(object, label, type, metadata=None, name=None, description=None, version=None, **kwargs)

Bases: object

Class for storing objects along with their metadata. Supported object types are AssetTypes. Assets are created by specifying the type of object being stored and a label for the object. The label is intended to describe objects relevant to a specific project, an example would be ‘Jet Engine subsystem N41’. An additional name can be specified to differentiate between different versions of a specific object. Assets can be stored and retrieved through the store interface. Assets also allow users to write any notes/important information relevant to an object. They can also be linked to other persistence or asset objects, such as linking a model to the dataset it was trained on.

The type field describes what kind of object is being stored. Please see the AssetType class for the full list of available AssetTypes. In order to store a generic python object, please create an asset with this class with type AssetType.OTHER.

Parameters:
  • object (Any) – The object which is stored by the asset.

  • label (str) – Label for the object, can be used later to identify the object.

  • type (AssetType) – The type of object being stored.

  • metadata (Optional[Dict]) – Any additional metadata to be stored along with the object.

  • name (Optional[str]) – Identifier to differentiate Assets with the same label.

  • description (Optional[str]) – A description of the asset.

  • version (Optional[int]) – Version of the asset.

EXAMPLE:

# Imports 
from virtualitics_sdk.assets.asset import Asset, AssetType
. . .
# Example usage
acc = Asset(object=[1, 2, 3], label="ex", type=AssetType.OTHER, name="ex-1")
store_interface.save_asset(acc)
add_engineer_notes(key=None, notes=None)
Return type:

None

add_notes(dict_type, key=None, notes=None)

Add key value pair to specified notes dictionary. If key is not specified, notes is assumed to be text written by the engineer which is added to a log.

Return type:

None

add_user_notes(key=None, notes=None)
Return type:

None

static from_bytes(bytes, encrypted)
Return type:

Asset

classmethod from_metadata(asset_metadata, asset_object, training_data=None)
classmethod from_pickle(pickle=None, **kwargs)
Return type:

Asset

get_object()
Return type:

Any

Function to link asset to other persistence objects. Example use case: linking a model to its training dataset. model_asset = asset(…) model_asset.link_asset(“training dataset”, X_train_asset)

Return type:

None

set_description(description)
Return type:

None

set_time_to_live(time_to_live)
Return type:

None

to_bytes()
Return type:

bytes

class virtualitics_sdk.assets.asset.AssetType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

DATASET = 'dataset'
EXPLAINER = 'explainer'
KNOWLEDGE_GRAPH = 'knowledge-graph'
MODEL = 'model'
NLPROCESSOR = 'language-processor'
OTHER = 'other'
SCHEMA = 'schema'
virtualitics_sdk.assets.asset.update_asset(asset)
Return type:

Asset