Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

ScenarioProxy

Object to simplify scenario creation, configuration and run. This can be used in a Jupyter Notebook

:raises Exception: [description] :return: [description] :rtype: [type]

Functions
__init__

This create a scenario in the database with the provided Task or Protocol

protocol_type : type[gws_core.protocol.protocol.Protocol] | None
folder : gws_core.folder.space_folder.SpaceFolder | None
scenario title
title : str - ''
scenario title
creation_type : ScenarioCreationType - ScenarioCreationType.AUTO
type of the created scenario
scenario_id : str | None
If provided, other parameters are ignored, it loads an existing scenario
add_tag
tag : Tag
add_tags
tags : list
add_to_queue
delete
get_model
Return type : Scenario
get_model_id
Return type : str
get_protocol

retrieve the main protocol of the scenario

Return type : ProtocolProxy
get_url
Return type : str
is_finished
Return type : bool
is_running
Return type : bool
is_success
Return type : bool
refresh
Return type : ScenarioProxy
reset

Reset the scenario to draft and delete all logs and progress

Return type : ScenarioProxy
reset_error_processes

Reset all processes in error of the scenario

Return type : ScenarioProxy
run

execute the scenario, after that the resource should be generated and can be retrieve by process

auto_delete_if_error : bool - False
run_async

Run the scenario in a separate CLI process but don't wait for it to finish.

Uses a CLI subprocess (like the queue runner) instead of fork to avoid inheriting the parent's server socket and event loop state, which can block other HTTP requests.

Return type : ScenarioWaiterBasic
stop
stop_or_remove_from_queue

Stop the scenario or remove it from the queue depending on its current status.

  • If the scenario is running in an external lab, stop all running importing scenarios.
  • If the scenario is running locally, stop it.
  • If the scenario is in queue, remove it from the queue.
Return type : ScenarioProxy
from_existing_scenario @staticmethod

Create a ScenarioProxy from an existing scenario

scenario_id : str
id of the scenario
Return type : ScenarioProxy
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.