kappa_sdk.Document#

class kappa_sdk.Document(field_id, well_group_id, well_id, custom_workflow_id, file_id, name, module_type, parent_ipta, labels, cluster_apis, document_dto_converter)[source]#

KW document object.

Presents a KW document that can be queried for contained analyses and results.

Note

Should not be instantiated directly.

Note

Document.analyses property is populated on-demand and is cached for the duration of the Connection.

If you need to get actual values, use the Document.update_analyses() method.

Attributes

Document.analyses

Gets the list of analyses contained in this document that has log-log data inside.

Document.analysis_results

Returns a wrapper for the "resultsSI.xml" in this document.

Document.file_id

Gets the id of the KW Document file.

Document.labels

Gets the list of labels of the KA Document.

Document.name

Gets the name of the KW Document.

Document.parent_ipta

Gets the parent ipta of the KW Document file.

Document.type

Gets the type of the KW module for this Document.

Document.well_group_id

Gets the well_group_id of the KA File.

Methods

Document.add_labels(labels)

Add labels to this document

Document.copy([new_name, field_id, well_id, ...])

Copy this document to the current file folder or to another field/well file folder

Document.copy_analysis(...)

Copy the current Analysis from the document

Document.delete()

Delete the current document

Document.delete_analyses(analysis_names)

Delete analyses from the document :param analysis_names: Name of analyses to delete

Document.get_artm_parameters()

Document.get_improve_parameters()

Get improve parameters to run an IPTA or IRTA

Document.get_log_log_data()

Get all loglog plots from all analyses in the document

Document.get_model_book_parameters()

Document.get_model_xml([action])

Returns analysis model definition(s) in KW-KA exchange XML format for all analyses in the document.

Document.get_possible_outputs()

Get possible dataset outputs to run an IPTA or IRTA

Document.get_pseudo_pressures(pressure_id[, ...])

Calculate pseudo-pressures from pressures

Document.get_results_xml()

Returns the content of the "resultsSI.xml" in this document.

Document.get_results_xml_legacy()

Returns the content of the "results.xml" in this document.

Document.get_well_intake_template_xml(...)

Get a well intake template xml :param intake_type: :type intake_type: Well intake type

Document.refresh_analyses()

Refresh the cached value of the Document.analyses property.

Document.rename(name)

Rename this document

Document.reset_pressure(pressure_id)

Reset pressures values

Document.reset_rate(rates_id, rate_type)

Reset rates values

Document.run_kw_script(script[, ...])

Runs a KW script.

Document.set_model_xml(model_xml[, action])

Applies given analysis model definition(s) in KW-KA exchange XML format to the document.

Document.update_models_parameters(...[, ...])

Update all xml model in the document

Parameters:
  • field_id (str)

  • well_group_id (str | None)

  • well_id (str | None)

  • custom_workflow_id (str | None)

  • file_id (str)

  • name (str)

  • module_type (KWModuleEnum)

  • parent_ipta (str | None)

  • labels (List[str])

  • cluster_apis (ClusterAPIS)

  • document_dto_converter (DocumentDtoConverter)

__init__(field_id, well_group_id, well_id, custom_workflow_id, file_id, name, module_type, parent_ipta, labels, cluster_apis, document_dto_converter)[source]#
Parameters:
  • field_id (str)

  • well_group_id (str | None)

  • well_id (str | None)

  • custom_workflow_id (str | None)

  • file_id (str)

  • name (str)

  • module_type (KWModuleEnum)

  • parent_ipta (str | None)

  • labels (List[str])

  • cluster_apis (ClusterAPIS)

  • document_dto_converter (DocumentDtoConverter)

property parent_ipta: str | None#

Gets the parent ipta of the KW Document file.

property file_id: str#

Gets the id of the KW Document file.

property well_group_id: str | None#

Gets the well_group_id of the KA File.

property name: str#

Gets the name of the KW Document.

property type: KWModuleEnum#

Gets the type of the KW module for this Document.

property analyses: List[Analysis]#

Gets the list of analyses contained in this document that has log-log data inside.

Note

This property is populated on-demand and is cached for the duration of the Connection unless updated by calling the Document.update_analyses() method.

Returns:

List [:class:`Analysis]` – A list of Analysis.

property analysis_results: AnalysisResults#

Returns a wrapper for the “resultsSI.xml” in this document.

Returns:

AnalysisResults – AnalysisResults wrapper

property labels: List[str]#

Gets the list of labels of the KA Document.

Returns:

List [str] – List of labels.

get_results_xml()[source]#

Returns the content of the “resultsSI.xml” in this document.

Returns:

str – resultsSI xml

Return type:

str

get_results_xml_legacy()[source]#

Returns the content of the “results.xml” in this document.

Returns:

str – results xml legacy

Return type:

str

refresh_analyses()[source]#

Refresh the cached value of the Document.analyses property.

Return type:

List[Analysis]

get_model_xml(action=ModelActionEnum.model_generation)[source]#

Returns analysis model definition(s) in KW-KA exchange XML format for all analyses in the document.

Parameters:

action (ModelActionEnum) – Type of Model Action

Returns:

str – model xml

Return type:

str

set_model_xml(model_xml, action=ModelActionEnum.model_generation)[source]#

Applies given analysis model definition(s) in KW-KA exchange XML format to the document.

Parameters:
  • model_xml (str) – Model xml as a string

  • action (ModelActionEnum) – Type of Model Action.

Return type:

None

get_pseudo_pressures(pressure_id, start_date=datetime.datetime(1900, 1, 1, 0, 0))[source]#

Calculate pseudo-pressures from pressures

Parameters:
  • pressure_id (str) – Vector Id of the original pressures

  • start_date (datetime) – Start date of the pseudo pressures

Returns:

Vector – A Vector object which contains a list of pseudo-pressures dates and list of pseudo-pressures values

Return type:

Vector

reset_pressure(pressure_id)[source]#

Reset pressures values

Parameters:

pressure_id (str) – Vector Id of the pressures

Return type:

None

reset_rate(rates_id, rate_type)[source]#

Reset rates values

Parameters:
  • rates_id (str) – Vector Id of the rate

  • rate_type (str) – Type of the rate to reset

Return type:

None

run_kw_script(script, additional_content=None, name='Custom KW script', time_to_live=0.0001)[source]#

Runs a KW script.

Parameters:
  • script (str) – The KW script to execute.

  • time_to_live (float) – Life duration of the script in days

  • additional_content (str | None) – Additional content that is supplied with the script (optional).

  • name (str | None) – The name of the script (optional).

Returns:

ScriptResult – tells whether the KW script was successfully run, and contains error information (if any).

Return type:

ScriptResult

rename(name)[source]#

Rename this document

Parameters:

name (str) – new name of the document

Return type:

None

copy(new_name=None, field_id=None, well_id=None, well_group_id=None, user_task_id=None)[source]#

Copy this document to the current file folder or to another field/well file folder

Parameters:
  • new_name (str | None) – Use this parameter if you want to rename the copied document

  • field_id (str | None) – Specify the field id to copy the file under a different field folder

  • well_id (str | None) – Specify the well id to copy the file under a different field folder

  • well_group_id (str | None) – Specify the well group id to copy the file under a well group

  • user_task_id (str | None) – Specify the user task id to copy the file under a user task

Returns:

str – id of the new copied file

Return type:

str

add_labels(labels)[source]#

Add labels to this document

Parameters:

labels (List[str]) – List of labels to add to the document

Return type:

None

get_improve_parameters()[source]#

Get improve parameters to run an IPTA or IRTA

Returns:

List[Dict[str, Any]] – List of improve parameters

Return type:

List[Dict[str, Any]]

get_possible_outputs()[source]#

Get possible dataset outputs to run an IPTA or IRTA

Returns:

List[Dict[str, Any]] – List of possible dataset outputs

Return type:

List[Dict[str, Any]]

delete_analyses(analysis_names)[source]#

Delete analyses from the document :param analysis_names: Name of analyses to delete

Parameters:

analysis_names (List[str])

Return type:

None

copy_analysis(reference_analysis_name, new_names)[source]#

Copy the current Analysis from the document

Parameters:
  • reference_analysis_name (str) – Name of the reference analysis

  • new_names (List[str]) – List of copied analysis names

Returns:

List[:class:`Analysis]` – Updated list of analyses in this document

Return type:

None

get_log_log_data()[source]#

Get all loglog plots from all analyses in the document

Return type:

List[Analysis]

update_models_parameters(models_parameters, model_xml=None)[source]#

Update all xml model in the document

Parameters:
Return type:

None

delete()[source]#

Delete the current document

Return type:

None

get_well_intake_template_xml(intake_type)[source]#

Get a well intake template xml :param intake_type: :type intake_type: Well intake type

Returns:

str – well intake template xml as string

Parameters:

intake_type (WellIntakeType)

Return type:

str

get_model_book_parameters()[source]#
Return type:

List[ModelBookParameter]

get_artm_parameters()[source]#
Return type:

AutomaticRtmParametersDto