ModuleVersion Class

Represents the actual computation unit within a Module.

You should not use this class directly. Instead, use one of the publish methods of the Module class.

Initialize ModuleVersion.

Inheritance
builtins.object
ModuleVersion

Constructor

ModuleVersion(workspace, module_entity, version, _module_version_provider)

Parameters

Name Description
workspace
Required

The workspace object this module will belong to.

module_entity
Required
<xref:azureml.pipeline.core._restclients.aeva.models.azure_ml_module_version.AzureMLModuleVersion>

The ModuleEntity object.

_module_version_provider
Required
<xref:azureml.pipeline.core._aeva_provider._AevaMlModuleVersionProvider>

(Internal use only.) The version provider.

version
Required
str

The version number.

workspace
Required

The workspace object this module will belong to.

module_entity
Required
<xref:azureml.pipeline.core._restclients.aeva.models.azure_ml_module_version.AzureMLModuleVersion>

The ModuleEntity object.

version
Required
str

The version number.

_module_version_provider
Required
<xref:azureml.pipeline.core._aeva_provider._AevaMlModuleVersionProvider>

The version provider.

Remarks

The following example shows how to create a ModuleVersion using a publish method of the Module class:


   in1_mid = InputPortDef(name="in1", default_datastore_mode="mount",
                      default_data_reference_name=datastore.name, label="First input number")
   in2_mid = InputPortDef(name="in2", default_datastore_mode="mount",
                      default_data_reference_name=datastore.name, label="Second input number")
   out_sum_mid = OutputPortDef(name="out_sum", default_datastore_name=datastore.name, default_datastore_mode="mount",
                               label="Sum of two numbers")
   out_prod_mid = OutputPortDef(name="out_prod", default_datastore_name=datastore.name, default_datastore_mode="mount",
                                label="Product of two numbers")
   module.publish_python_script(
       "calculate.py", "middle", inputs=[in1_mid, in2_mid], outputs=[out_sum_mid, out_prod_mid], version="2", is_default=True,
       source_directory="./calc")

Full sample is available from https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-modulestep.ipynb

Methods

deprecate

Set the ModuleVersion state to 'Deprecated'.

disable

Set the ModuleVersion state to 'Disabled'.

enable

Set the ModuleVersion state to 'Active'.

get

Get the Module by name or by ID; throws an exception if either is not provided.

module

Return the containing module element.

set_description

Set the description of Module.

deprecate

Set the ModuleVersion state to 'Deprecated'.

deprecate()

disable

Set the ModuleVersion state to 'Disabled'.

disable()

enable

Set the ModuleVersion state to 'Active'.

enable()

get

Get the Module by name or by ID; throws an exception if either is not provided.

static get(workspace, module_version_id=None, _workflow_provider=None)

Parameters

Name Description
workspace
Required

The workspace the Module was created in.

module_version_id
str

The ID of the ModuleVersion.

default value: None
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

Module object.

module

Return the containing module element.

module(_workflow_provider=None)

Parameters

Name Description
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

Module object

set_description

Set the description of Module.

set_description(description)

Parameters

Name Description
description
Required
str

The description to set.

Exceptions

Type Description

Attributes

category

Get the category of the ModuleVersion.

Returns

Type Description
str

The category.

description

Get the description of the ModuleVersion.

Returns

Type Description
str

The description.

interface

Get the interface of the module.

Returns

Type Description
<xref:azureml.pipeline.core._aeva_provider.StructuredInterface>

The structuredInterface.

module_id

Get the ID of the containing module.

Returns

Type Description
str

The ID.

module_version_id

Get the ID of the ModuleVersion.

Returns

Type Description
str

The ID.

runconfig

Get the runconfig of the ModuleVersion.

Returns

Type Description
str

The category.

status

Get the status of the ModuleVersion.

Returns

Type Description
str

The status.

version

Get the version of the containing module.

Returns

Type Description
str

The version.