PetrelContext#
- class cegalprizm.hub.PetrelContext(hub_client: cegalprizm.hub.client.HubClient, wellknown_connector_id: str, connector_filter: Optional[cegalprizm.hub.connector_filter.ConnectorFilter] = None)#
A context or handle to a Cegal Hub Petrel Connector(s). Connectors may be targted by providing a ConnectorFilter
Creates a PetrelContext from the specified parameters.
- Parameters
hub_client (HubClient) – The HubClient which makes client requests to Cegal Hub Server.
wellknown_connector_id (str) – The wellknown string that represents the type of connector. i.e cegal.hub.petrel or cegal.hub.agent etc
connector_filter – A Connector filter to target a specific instance or instances of a Connector. Defaults to None.
- close_project(use_ref_project: bool = False, close_both_projects: bool = False)#
Close the Petrel project in the running Petrel instance.
- Parameters
use_ref_project (bool, optional) – If True close the secondary Petrel project otherwise close the primary Petrel project. Defaults to False.
close_both_projects (bool, optional) – If True close both the primary and secondary Petrel projects. Defaults to False.
- Raises
Exception – If there was a problem closing the Petrel project.
- Returns
An object representing the result of closing the Petrel project.
- Return type
CloseProjectResult
- load_project(path: str, read_only: bool = True, use_ref_project: bool = False)#
Load a Petrel project into the running instance of Petrel
- Parameters
path (str) – The path to .pet Petrel project file
read_only (bool, optional) – True if the project should be opened in readonly mode. Defaults to True.
use_ref_project (bool, optional) – True if the project should be opened as a secondary project in Petrel. Defaults to False.
- Raises
Exception – If there was a problem loading the Petrel project
- Returns
An object representing the result of loading a Petrel project
- Return type
LoadProjectResult
- new_project()#
Create a new project in the running instance of Petrel.
- Raises
Exception – If there was a problem creating the new Petrel project.
- Returns
An object representing the result of creating a new Petrel project.
- Return type
NewProjectResult
- poison_petrel()#
Kill the running instance of Petrel
- Raises
Exception – If there was a problem trying to kill Petrel
- Returns
An object representing the result of attempting to kill Petrel
- Return type
PoisonPetrelResult
- project_info(use_ref_project: bool = False)#
Summary information of the Petrel project.
- Parameters
use_ref_project (bool, optional) – If True use the secondary project loaded in Petrel(if available), otherwise use the primary project. Defaults to False.
- Raises
Exception – If there was a problem obtaining the Petrel project information
- Returns
An object containing the Petrel project information.
- Return type
ProjectInfoResult
- save_as_project(path: str, use_ref_project: bool = False)#
Perform a save as on the running Petrel project.
- Parameters
path (str) – The path including the name of the project for the save as
use_ref_project (bool, optional) – If True perform save as on the secondary Petrel project, otherwise perform save as on the primary Petrel project. Defaults to False.
- Raises
Exception – It there was a problem performing the save as
- Returns
An object representing the result of performing a save as.
- Return type
SaveAsProjectResult
- save_project(use_ref_project: bool = False, allow_project_version_upgrade: bool = False)#
Save the Petrel project.
- Parameters
use_ref_project (bool, optional) – If True save the secondary petrel project, otherwise save the primary Petrel project. Defaults to False.
allow_project_version_upgrade (bool, optional) – If True allow Petrel to save the project in a newer version of Petrel otherwise fail
False. (if this scenario is encountered. Defaults to) –
- Raises
Exception – If there was a problem saving the Petrel project.
- Returns
An object representing the result of saving the Petrel project.
- Return type
SaveProjectResult
- property available#
Get the available Cegal Hub Connectors
- Raises
Exception – If there was a problem obtaining the available Cegal Hub Connectors
- Returns
An enumeration of objects for available Connectors
- Return type
Connector[]
- property connection_parameters#
Get a deep copy of the ConnectionParameters corresponding to the running Cegal Hub Server
- Returns
The ConnectionParameters object.
- Return type
- property connector_filter#
Get the ConnectorFilter associated with the context.
- Returns
The ConnectorFilter object.
- Return type