Case#
- class Case[source]#
Bases:
CaseBase,Flow360ResourceCase component
Properties
- params: Flow360Params | SimulationParams#
returns case params
- parent: Case#
parent case
- Returns:
parent case object
- Return type:
- Raises:
RuntimeError – When case does not have parent
- info: CaseMetaV2#
returns metadata info for case
- info_v2: CaseMetaV2#
returns metadata v2 info for case
- volume_mesh: VolumeMeshV2#
returns volume mesh
- volume_mesh_id#
returns volume mesh id
- results: CaseResultsModel#
returns results object to managing case results
- usage: ResourceUsage#
Usage recorded for the case, fetched from the cloud on every access.
usage.computestays None until the case finishes, so callwait()first. Read it once (usage = case.usage) rather than once per field.
Additional Constructors
- classmethod from_local_storage(local_storage_path, meta_data)[source]#
Create a Case instance from local storage.
- Parameters:
local_storage_path (str) – The path to the local storage directory.
meta_data (CaseMeta) –
Case metadata containing:
id (str): The unique identifier for the case.
name (str): The name of the case.
user_id (str): The user ID associated with the case, can be “local”.
- Returns:
An instance of Case with data loaded from local storage.
- Return type:
Methods
- has_parent()[source]#
Check if case has parent case
- Returns:
True when case has parent, False otherwise
- Return type:
- move_to_folder(folder)[source]#
Move the current case to the specified folder.
- Parameters:
folder (Folder) – The destination folder where the item will be moved.
- Returns:
Returns the modified item after it has been moved to the new folder.
- Return type:
self
Notes
This method sends a REST API request to move the current item to the specified folder. The folder parameter should be an instance of the Folder class with a valid ID.
- rename(new_name)[source]#
Rename the current case.
- Parameters:
new_name (str) – The new name for the case.
- delete()[source]#
Delete the current case.
Goes through the v2 endpoint. The v1 one runs the S3 cleanup inline before it stops the pipeline job, so a failed cleanup leaves a deleted case still running.
- stop()[source]#
Stop the running case, the same way Stop does in the web UI.
The solver stops at an upcoming step, its results are uploaded as usual, and the case finishes as
completed. This returns once the request is sent; callwait()to block until the case finishes. As in the web UI, stopping a case re-creates its draft in the project.- Raises:
Flow360RuntimeError – If the case is not running: it has not started yet, or it has already finished.
- classmethod create(name, params, volume_mesh_id=None, tags=None, parent_id=None, other_case=None, parent_case=None, solver_version=None)[source]#
Create new case :param name: :param params: :param volume_mesh_id: :param other_case: :param tags: :param parent_id: :param parent_case: :return:
- retry(name=None, params=None, solver_version=None, tags=None)#
Retry case :param name: :param params: :param tags: :return:
- continuation(name=None, params=None, tags=None)#
Alias for fork a case to continue simulation :param name: :param params: :param tags: :return: