Workflow#

class cegalprizm.pythontool.Workflow(python_workflow_object: WorkflowGrpc)#

A class holding information about a workflow

Functions

__init__(python_workflow_object)

add_comment(new_comment[, overwrite])

Add a comment to the already existing comments on the PetrelObject, or overwrite the existing comments.

retrieve_history()

The Petrel history for the object.

retrieve_stats()

Retrieves a dictionary summarizing the statistics for the object

run([args])

Executes the workflow in Petrel.

Properties

comments

The comments on the PetrelObject.

droid

The Petrel Droid (object id or guid) for the object

input

The input variables for the workflow

output

The output variables for the workflow

path

The path of this object in Petrel.

petrel_name

Returns the name of this object in Petrel

readonly

The read-only status of this object

template

Returns the Petrel template for the object as a string.

add_comment(new_comment: str, overwrite: bool = False) None#

Add a comment to the already existing comments on the PetrelObject, or overwrite the existing comments.

Parameters
  • new_comment – The new comment to add to the PetrelObject.

  • overwrite – Boolean flag to overwrite all existing comments with the new comment. Default is False.

Raises

PythonToolException – if object is read-only

retrieve_history()#

The Petrel history for the object.

Returns the Petrel history for the object as Pandas dataframe.

Returns

The history of the object as reported by Petrel

Return type

DataFrame

retrieve_stats() Dict[str, str]#

Retrieves a dictionary summarizing the statistics for the object

The statistics are a snapshot of the information in the Statistics page of the Settings panel of the object in the Petrel tree. Both the dict key and value are strings, and may contain punctuation, English phrases or just filler information. Any changes to the dict returned will not be saved or affect anything.

Note: this operation may be slow, since the statistics are ‘live’ - they represent the most up to date information.

Returns

The statistics of the object as reported by Petrel

Return type

dict

run(args: Optional[Dict[Union[str, cegalprizm.pythontool.workflow.ReferenceVariable], Union[str, float, int, bool, datetime.datetime, cegalprizm.pythontool.petrelobject.PetrelObject]]] = None) Dict[cegalprizm.pythontool.workflow.ReferenceVariable, Optional[cegalprizm.pythontool.petrelobject.PetrelObject]]#

Executes the workflow in Petrel.

Parameters

dictionary. (A dictionary with input variables as keys and input as values. It is possible to define additional input variables in this) –

property comments#

The comments on the PetrelObject.

Returns

The comments on the PetrelObject as a string.

Return type

string

property droid: str#

The Petrel Droid (object id or guid) for the object

Returns the Petrel Droid or object id or guid for the object. If not available, will throw a PythonToolException.

This property is planned to be deprecated in favour of a similar but more general id schema in future releases.

Returns

The Petrel Droid of the object

Return type

str

property input: Dict[str, cegalprizm.pythontool.workflow.ReferenceVariable]#

The input variables for the workflow

Returns

the input variables for the workflow

Return type

cegalprizm.pythontool.workflow.ReferenceVariable

property output: Dict[str, cegalprizm.pythontool.workflow.ReferenceVariable]#

The output variables for the workflow

Returns

the output variables for the workflow

Return type

cegalprizm.pythontool.workflow.ReferenceVariable

property path: str#

The path of this object in Petrel. Neither the Petrel name nor the path is guaranteed to be unique.

Returns

The path of the Petrel object

Return type

str

property petrel_name: str#

Returns the name of this object in Petrel

property readonly: bool#

The read-only status of this object

Returns

True if the object is read-only

Return type

bool

property template: str#

Returns the Petrel template for the object as a string. If no template available, will return an empty string.