sdk.analysis_version.create()

elements.sdk.api.analysis_version

Create an Analysis Version.

Given a top level Analysis, create a new version, which must be semantically greater than the previously created version. Once an Analysis Version has been created, it is immutable. Any changes require a new version to be created. The purpose of this is to either upgrade the structure of the Analysis DAG OR update the versions of the algorithms assigned to the Analysis.

Parameters

  • analysis_id (str) - Analysis ID to create version for
  • analysis_manifest (AnalysisManifest) - Analysis Manifest
👍

Analysis Builder

See the Analysis Builder section for more details on how to construct an Analysis Version.

Returns

AnalysisVersion

Example(s)

# Multi-Node Directed Acyclic Graph
manifest = AnalysisManifest()
manifest.metadata(description="Test description for the greatest manifest in the world.",
                  version="0.0.1",
                  tags=["device-visits", "result-test"])
manifest.add_node(name="device-visits",
                  algorithm_version_id="5ee03b8e-ab45-4553-b5f4-a5029254a9de")
manifest.add_node(name="device-tracks",
                  algorithm_version_id="6f7cff18-c2a2-4246-b0d4-21be09673a6b")
# Make device-visits the parent of device tracks
manifest.add_node_edge(parent_index=0, child_index=1)

# Create analysis version
await sdk.analysis_version.create(
  analysis_id="40078e32-27ee-438e-87bf-87063482c7b4",
  analysis_manifest=manifest
)

# Output (AnalysisVersion)
id: "f8aa14a2-35e7-484a-9804-1d05c23642d4"
analysis {
  id: "40078e32-27ee-438e-87bf-87063482c7b4"
  created_on {
  }
}
analysis_manifest {
  manifest_version: "0.1.0"
  metadata {
    description: "Test description for the greatest manifest in the world."
    version: "0.0.1"
    tags: "device-visits"
    tags: "result-test"
  }
}