The progress_handler.py module#

Summary#

IProgressHandler

Interface for simulation progress updates.

Progress

Progress information.

DefaultSingleSimulationProgressHandler

Creates a progress bar for a single simulation.

ProgressState

Simulation progress status.

Description#

Provides progress updates.

Module detail#

class progress_handler.Progress(/, **data: Any)#

Bases: pydantic.BaseModel

Progress information.

Overview#

from_proto_msg

Create a Progress object from a progress protobuf message.

Import detail#

from ansys.additive.core.progress_handler import Progress

Attribute detail#

Progress.sim_id: str#
Progress.state: ProgressState#
Progress.percent_complete: int#
Progress.message: str#
Progress.context: str#

Method detail#

classmethod Progress.from_proto_msg(sim_id: str, progress: ansys.api.additive.v0.additive_domain_pb2.Progress)#

Create a Progress object from a progress protobuf message.

class Progress.DefaultSingleSimulationProgressHandler#

Bases: IProgressHandler

Creates a progress bar for a single simulation.

Parameters:
sim_idstr

Simulation ID.

Overview#

update

Update the progress bar.

Import detail#

from ansys.additive.core.progress_handler import DefaultSingleSimulationProgressHandler

Method detail#

DefaultSingleSimulationProgressHandler.update(progress: Progress)#

Update the progress bar.

Parameters:
progress: Progress

Latest progress.

class DefaultSingleSimulationProgressHandler.IProgressHandler#

Bases: abc.ABC

Interface for simulation progress updates.

Overview#

update

Update progress.

Import detail#

from ansys.additive.core.progress_handler import IProgressHandler

Method detail#

abstract IProgressHandler.update(progress: Progress)#

Update progress.

Parameters:
progressProgress

Progress information.

class IProgressHandler.ProgressState#

Bases: enum.IntEnum

Simulation progress status.

Overview#

WAITING

Waiting for the simulation to start.

RUNNING

Simulation is running.

COMPLETED

Simulation has completed.

ERROR

Simulation has errored.

Import detail#

from ansys.additive.core.progress_handler import ProgressState

Attribute detail#

ProgressState.WAITING#

Waiting for the simulation to start.

ProgressState.RUNNING#

Simulation is running.

ProgressState.COMPLETED#

Simulation has completed.

ProgressState.ERROR#

Simulation has errored.