Skip to main content

core.project

Project Objects

class Project()

add_model

def add_model(model_name: str,
model_file_path: str,
model_description: str = None) -> ModelObj

Upload a model to project.

Arguments:

  • model_name (str): Name of model
  • model_file_path (str): Path to model file to be uploaded.
  • model_description (str): Optional description of your model.

Returns:

ModelObj: Returns the uploaded ModelObj object.

get_model

def get_model(model: Union[str, ModelObj, ModelDto]) -> ModelObj

Get model information as ModelDto.

Arguments:

  • model (str|ModelDto): Can either be a model id string or a ModelDto object.

Returns:

ModelObj: Returns the ModelObj object.

get_models

def get_models() -> List[ModelDto]

Get all models associated with this project.

Returns:

list[ModelDto]: Returns a list of ModelDto objects.

delete_model

def delete_model(model: Union[str, ModelDto, ModelObj])

Delete model from project.

Arguments:

  • model (str|ModelDto|ModelObj): Can either be a model id string, ModelDto or a ModelObj object.

add_device

def add_device(device_name: str,
device_file_path: str,
device_description=None) -> DeviceObj

Upload a device to project.

Arguments:

  • device_name (str): Name of device
  • device_file_path (str): Path to device file to be uploaded
  • device_description (str): Description of device

Returns:

DeviceObj: Returns the uploaded DeviceObj object.

get_device

def get_device(device: Union[str, DeviceObj, DeviceDto]) -> DeviceObj

Get device information as DeviceObj.

Arguments:

  • device (str|DeviceDto|DeviceObj): Can either be a device id string, DeviceObj or a DeviceDto object.

Returns:

DeviceObj: Returns a DeviceObj object

get_devices

def get_devices() -> List[DeviceDto]

Get all devices associated with this project.

Returns:

list[DeviceDto]: Returns s list of DeviceDto objects.

delete_device

def delete_device(device: Union[str, DeviceDto, DeviceObj])

Delete device from project.

Arguments:

  • model (str|DeviceDto|DeviceObj): Can either be a device id string, DeviceDto or a DeviceObj object.

get_simulations

def get_simulations(
simulation_status: SimulationStatus = None) -> List[Simulation]

Get all simulations in project.

Optional filter on simulation status, available values: created, starting, queued, in_progress, processing_results, completed, completed_with_source_errors, cancelled, error

Returns:

list[Simulation]: Returns a list of Simulation objects

get_simulation

def get_simulation(simulation_id: str) -> Simulation

Get a project simulation by simulation id.

Arguments:

  • simulation_id (str): Id of the simulation to fetch

Returns:

Simulation: Returns a Simulation object.

add_simulation

def add_simulation(definition: SimulationDefinition) -> Simulation

Create a simulation and add it to project.

Arguments:

  • definition (SimulationDefinition): Simulation definition.

Returns:

Simulation: Returns a Simulation object which can be used to start and monitor the simulation

add_simulations

def add_simulations(
definitions: List[SimulationDefinition]) -> List[Simulation]

Add multiple simulations from a list of SimulationDefinition objects

Arguments:

  • definitions (list[SimulationDefinition]): List of Simulations to create.

Returns:

list[Simulation]: Returns a list of simulation objects.

estimate

def estimate() -> ProjectEstimateDto

Estimate simulation runtime and tokens for the project.

Returns:

ProjectEstimateDto: Returns ProjectEstimateDto containing total estimated runtime and total estimated cost in tokens, as well as estimations for each simulation.

wait_for_estimate

def wait_for_estimate(max_retries=200) -> ProjectEstimateDto

Wait for project estimate. Returns estimate object either if estimate is ready or if max_retries seconds have elapsed.

Arguments:

  • max_retries (int): Maximum number of retries for getting estimate, defaults to 200.

get_progress

def get_progress() -> ProjectProgressDto

Get progress of running simulations in a project.

Returns:

ProjectProgressDto: Returns ProjectProgressDto object with total project progress percentage as well as progress for each simulation.

start_simulations

def start_simulations() -> StartProjectDto

Start all the simulations added to this project.

The simulations are run in the cloud and do thus not keep your computer busy The simulations can be monitored, cancelled or the results can be downloaded once the simulations are completed.

Returns:

StartProjectDto: Data container with information on the simulations which were started

cancel_simulations

def cancel_simulations() -> CancelSimulationDto

Cancel a simulation which has already been started

Returns:

CancelSimulationDto: Data container with information about the cancelled simulation

update

def update(name: Union[str, None], description: Union[str, None])

Update project.

Arguments:

  • name: New name, if None the name will not be updated.
  • description: New description, if None the description will not be updated.

download_results

def download_results(destination_directory: Union[str, Path],
result_type: SimulationType = None,
rename_rule: ResultRenameRule = ResultRenameRule.none,
data_filter: ResultDataFilter = ResultDataFilter.none,
include_subtasks: bool = False)

Download results for all simulations in the project to the destination directory.

Arguments:

  • destination_directory (str|Path): Destination directory to download results to.
  • result_type (str): Optional filter for result type.

validate

def validate()

Validate all simulations in the project.

as_live_progress

def as_live_progress()

Uses the display_data module to show simulation progress automatically updated until simulation finished.