kappa_sdk.Well#
- class kappa_sdk.Well(field_id, well_group_id, well_id, name, uwi, data_types_catalog, well_properties_catalog, cluster_apis, dto_converter)[source]#
Well object.
Presents a KAPPA Automate well object that can be queried for contained data, documents and every existing object under the well. Returned as a result of the
Field.wellsquery.Note
Should not be instantiated directly.
Note
Well.data,Well.shutin, andWell.documentsproperties are populated on-demand and are cached for the duration of theConnection.Attributes
Gets the corrected production folders that contains this
Well.Gets the list of corrected production phases contained in this
Well.Gets the list of custom workflows contained in this
Well.Gets the list of data contained in this
Well.Gets the list of data folders contained in this
Well.Gets the list of KW documents contained in this
Well.Gets the id of the field that contains this
Well.Gets the list of file folders contained in this
Well.Gets the list of files contained in this
Well.Gets the list of filters contained in this
Well.Gets the list of functions contained in this
Well.Gets the list of gauges contained in this
Well.Gets the id of the
Wellobject.Gets the list of incremental PTA workflows contained in this
Well.Gets the list of incremental RTA workflows contained in this
Well.Gets the labels of the
Wellobject.Gets the list of model book contained in this
Well.Gets the name of the
Well.Gets the list of plots contained in this
Well.Gets the raw production folders that contains this
Well.Returns the production type of the well
Gets the list of production phases contained in this
Well.Gets the list of PVTs contained in this
Well.Gets the shut-in data for this
Well.Gets the list of surveys contained in this
Well.Gets the list of user tasks contained in this
Well.Gets the UWI of the
Wellobject.Gets the well group id that contains this
Well.Gets the list of well log contained in this
Well.Gets the list of well property containers contained in this
Well.Gets the wellbore of the
Wellobject.Methods
Well.compute_forward_rates(pvt_id, ...[, ...])Computes forward rates based on well and reservoir parameters, including pressure, temperature, velocity vs depth, and optional reservoir properties.
Well.copy_file(file[, new_name, field_id, ...])Copy this document to the current file folder or to another field/well file folder
Well.create_corrected_production(...[, ...])Creates a corrected production dataset based on the given parameters.
Well.create_data(name, data_type[, labels, ...])Creates and returns a new data object with specified parameters.
Well.create_data_folder(name[, ...])Creates a data folder within the current context, either as a direct child of a parent folder or at the well level, depending on the specified parameters.
Well.create_document(document_type, ...[, ...])Well.create_file_folder(name[, folder_parent_id])Creates a new file folder within the specified parent folder or within the default parent folder if none is specified.
Well.create_filter(data, filter_type[, ...])Create a wavelet filter under the gauge associated to this
Dataobject.Well.create_incremental_pta(name, ...[, ...])Create an incremental pta workflow
Well.create_incremental_rta(name, ...[, ...])Create an incremental rta workflow
Well.create_model_book(document, name)Creates a new model book associated with this well.
Well.create_plot(plot_name[, pane_name, ...])Create a Kappa Automate Plot instance under the well
Creates a new production folder in the well :param name: :type name:
The nameofthe production folderWell.create_pvt_from_file(pvt_name, file_id)Creates a PVT (Pressure-Volume-Temperature) object from a file.
Well.create_pvt_from_kw_document(pvt_name, ...)Create a pvt object in the well
Well.create_shut_in(input_type, input_gauge, ...)Creates a shut-in event based on the given parameters.
Well.create_step_data(name, data_type, first_x)Creates and initializes a step data object with the provided parameters.
Well.create_survey(name, date)Create a new survey in the well.
Creates a new well property container for this
Well.Well.create_wellbore(geometries[, ...])Creates or updates a wellbore with the specified geometries and perforations.
Well.delete_data(data)Deletes a specified data object from the current field and updates the internal data list by removing the corresponding object.
Well.delete_file(file)Deletes a specified file from the cluster and updates the local file list.
Well.delete_model_book(model_book)Deletes a model book from this well.
Well.delete_survey(survey)Deletes the current wellbore if the well has one.
Extracts well properties from a given document.
Well.find_gauge_by_id(vector_id)Finds a gauge by id.
Well.find_gauge_by_type(data_type[, label, ...])Finds the first matching gauge by data-type and/or label.
Well.get_shut_in_extractions(...[, ...])Extract a loglog given the shut-in dates, pressure gauge and a corrected rate gauge.
Well.load_gauge(datasource_name, ...[, ...])Loads a gauge with the provided attributes into the system.
Clean all the well attributes and dto from the cache, to grab updated attributes.
Well.rename(new_well_name)Rename the current well object.
Well.upload_file(file_path[, ...])Uploads a file to this
Well.- Parameters:
field_id (str)
well_group_id (str | None)
well_id (str)
name (str)
uwi (str | None)
data_types_catalog (FieldDataTypesCatalog)
well_properties_catalog (FieldWellPropertiesCatalog)
cluster_apis (ClusterAPIS)
dto_converter (WellDtoConverter)
- __init__(field_id, well_group_id, well_id, name, uwi, data_types_catalog, well_properties_catalog, cluster_apis, dto_converter)[source]#
- Parameters:
field_id (str)
well_group_id (str | None)
well_id (str)
name (str)
uwi (str | None)
data_types_catalog (FieldDataTypesCatalog)
well_properties_catalog (FieldWellPropertiesCatalog)
cluster_apis (ClusterAPIS)
dto_converter (WellDtoConverter)
- Return type:
None
- property production_folders: List[ProductionFolder]#
Gets the raw production folders that contains this
Well.
- property corrected_production_folders: List[ProductionFolder]#
Gets the corrected production folders that contains this
Well.
- property shut_in: Data | None#
Gets the shut-in data for this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property gauges: List[Data]#
Gets the list of gauges contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property data: List[Data]#
Gets the list of data contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property filters: List[Data]#
Gets the list of filters contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property productions: List[Data]#
Gets the list of production phases contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property corrected_productions: List[Data]#
Gets the list of corrected production phases contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property files: List[File]#
Gets the list of files contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property documents: List[Document]#
Gets the list of KW documents contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property user_tasks: List[UserTask]#
Gets the list of user tasks contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property functions: List[Data]#
Gets the list of functions contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property incremental_pta_workflows: List[IncrementalPTA]#
Gets the list of incremental PTA workflows contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property incremental_rta_workflows: List[IncrementalRTA]#
Gets the list of incremental RTA workflows contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property well_property_containers: List[WellPropertyContainer]#
Gets the list of well property containers contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property plots: List[Plot]#
Gets the list of plots contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property production_type: WellProductionTypeEnum#
Returns the production type of the well
Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property wellbore: Wellbore | None#
Gets the wellbore of the
Wellobject.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property custom_workflows: List[CustomWorkflow]#
Gets the list of custom workflows contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property pvts: List[PVT]#
Gets the list of PVTs contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property file_folders: List[FileFolder]#
Gets the list of file folders contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property data_folders: List[DataFolder]#
Gets the list of data folders contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property surveys: List[Survey]#
Gets the list of surveys contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property model_books: List[ModelBook]#
Gets the list of model book contained in this
Well.Note
This property is populated on-demand and is cached for the duration of the
Connection.
- property well_logs: List[WellLogs]#
Gets the list of well log contained in this
Well.- Returns:
List[WellLogs]: A list of WellLogs objects containing well logging data.
- create_data(name, data_type, labels=None, folder_id=None, measure_depth=0, true_vertical_depth=0, true_vertical_depth_sub_sea=0)[source]#
Creates and returns a new data object with specified parameters. This method serves as an interface to initialize a data entity with the provided attributes and configuration settings.
- Parameters:
name (
str) – The name of the data entity to create.data_type (
str) – The type of data.labels (
listofstr, optional) – A list of labels associated with the data.folder_id (
str, optional) – The identifier of the production folder where the data is stored.measure_depth (
float) – The measured depth of the data.true_vertical_depth (
float) – The true vertical depth of the data.true_vertical_depth_sub_sea (
float) – The true vertical depth of the data below sea level.
- Returns:
Data– The newly created data object.- Return type:
- create_step_data(name, data_type, first_x, labels=None, folder_id=None, measure_depth=0, true_vertical_depth=0, true_vertical_depth_sub_sea=0)[source]#
Creates and initializes a step data object with the provided parameters.
The function generates a step data object by initializing it with essential details like name, data type and associated parameters. It requires a ’first_x’ value to be explicitly specified and uses it to update the step data object after creation. The function optionally accepts additional metadata such as labels or production folder identifier.
- Parameters:
name (
str) – The name of the step data to be created.data_type (
str) – The type specifying the data format or classification.first_x (
datetime) – The datetime object representing the first x-coordinate for the step data. This parameter must not be None.labels (
listofstr, optional) – A list of labels to associate with the step data. Defaults to None.folder_id (
str, optional) – Identifier for the production folder to associate the step data with. Defaults to None.measure_depth (
float) – The measured depth of the data.true_vertical_depth (
float) – The true vertical depth of the data.true_vertical_depth_sub_sea (
float) – The true vertical depth of the data below sea level.
- Returns:
Data– The created step data object initialized with the given parameters.- Return type:
- upload_file(file_path, file_folder_id=None, overwrite=False, automatic_extraction=False)[source]#
Uploads a file to this
Well.- Parameters:
file_path (str) – Full path and name of the file to upload.
overwrite (bool) – A value indicating whether to overwrite a file with the same name if it already exists in the well.
automatic_extraction (bool) – A value indicating whether to perform automatic extraction of well properties if uploading a KW file.
file_folder_id (str | None) – id of the file folder to upload the file
- Returns:
File– An uploaded file object.- Return type:
- create_plot(plot_name, pane_name=None, square_log_cycles=False, stacked_bars=False, x_label='', is_x_log=False, labels=None)[source]#
Create a Kappa Automate Plot instance under the well
- Parameters:
plot_name (str) – Name of plot
pane_name (str | None) – Name of the pane
square_log_cycles (bool) – Whether or not use Square log cycles
stacked_bars (bool) – Whether or not use stacked bars
x_label (str) – x label
is_x_log (bool) – Whether or not use logarithmic scale for x values
labels (List[str] | None) – Add some labels to the plot
- Returns:
Plot– The new Plot instance created under the well.- Return type:
- find_gauge_by_id(vector_id)[source]#
Finds a gauge by id.
- Parameters:
vector_id (str) – The id of a vector to search for.
- Return type:
- find_gauge_by_type(data_type, label=None, is_reference=True, default_value=None)[source]#
Finds the first matching gauge by data-type and/or label.
- Parameters:
data_type (
Optional[str]) – The type of the gauge to find.label (
Optional[str], optional) – The label of the gauge, if any (default is None).is_reference (
bool, optional) – Whether the gauge is a reference gauge (default is True).default_value (
Optional[Data], optional) – The default value to return if the gauge is not found (default is None).
- Returns:
Data– The found gauge.- Return type:
- refresh_data()[source]#
Clean all the well attributes and dto from the cache, to grab updated attributes.
- Return type:
None
- create_incremental_pta(name, workflow_type, shutin_id, pressure_id, pta_document_id, improve_settings=None, min_shutin_duration=10, replication_of_results=False, save_strategy=None, labels=None, auto_compute_semilog_pstar=False, shut_in_types=None, shut_in_categories=None)[source]#
Create an incremental pta workflow
- Parameters:
name (str) – Name of the ipta.
workflow_type (IncrementalPTAType) – A workflow-type to use.
shutin_id (str) – Vector id of the shutin input
pressure_id (str) – Vector id of the pressure
pta_document_id (str) – Id of the reference pta document
improve_settings (WorkflowImproveSettings | None) – Improve Settings parameter when using an improve ipta
min_shutin_duration (float) – Minimum shutin duration
replication_of_results (bool) – If we replicate the results in the master container or not
save_strategy (SaveStrategyEnum | None) – save strategy of the output documents
labels (List[str] | None) – a list of labels to add to the ipta, the associated documents and the associated well properties container
auto_compute_semilog_pstar (bool) – Auto compute the semilog pstar
shut_in_types (List[ShutInTypesEnum] | None) – List of shut in types to use
shut_in_categories (List[ShutInCategoriesEnum] | None) – List of shut in categories to use
- Return type:
- create_incremental_rta(name, workflow_type, pressure_id, rta_document, data_hours_to_analyze=2160, improve_settings=None, oil_rate_vector_id=None, gas_rate_vector_id=None, water_rate_vector_id=None, gauge_loading_strategy=None, is_improved_only_on_new_data=None, replication_of_results=False)[source]#
Create an incremental rta workflow
- Parameters:
name (str) – Name of the ipta.
workflow_type (IncrementalRTAType) – A workflow-type to use.
pressure_id (str) – Vector id of the pressure
rta_document (Document) – reference rta document
data_hours_to_analyze (float) – number of hours to analyze
improve_settings (WorkflowImproveSettings | None) – Improve Settings parameter when using an improve ipta
oil_rate_vector_id (str | None) – Vector id of the oil rate data
gas_rate_vector_id (str | None) – Vector id of the gas rate data
water_rate_vector_id (str | None) – Vector id of the water rate data
gauge_loading_strategy (GaugeLoadingStrategy | None) – gauge loading strategy of the output documents
is_improved_only_on_new_data (bool | None) – If the improve irta is only on new data
replication_of_results (bool) – If we replicate the results in the master container or not
- Return type:
- load_gauge(datasource_name, datasource_gauge_name, dimension, data_type, unit, time_format, gauge_name=None, children_datasource_names=None, last_step_duration_hours=None, is_high_frequency=True, gauge_model='', measure_depth=0, true_vertical_depth=0, true_vertical_depth_sub_sea=0, serial_number='', labels=None, comment='', read_from=None, read_to=None, folder_id=None)[source]#
Loads a gauge with the provided attributes into the system.
This method integrates with external data APIs to fetch required data sources and constructs a payload with given attributes for the automation API to register a new gauge. The method ensures the new gauge is properly loaded by continuously checking the system until it appears in the available gauges list.
- Parameters:
datasource_name (
str) – Name of the data source where the gauge data is stored.datasource_gauge_name (
str) – Name of the specific gauge within the data source.dimension (
MeasureEnum) – The dimension of the data measured by the gauge.data_type (
str) – The type of the data being processed (e.g., float, int).unit (
UnitEnum) – The unit of measurement for the gauge.time_format (
TimeFormatEnum) – The time format associated with the gauge data.gauge_name (
str, optional) – The name assigned to the gauge. Defaults to datasource_gauge_name.children_datasource_names (
listofstr, optional) – Names of the child data sources if applicable.last_step_duration_hours (
float, optional) – Duration of the last recorded step in hours. Default is None.is_high_frequency (
bool, defaultTrue) – Boolean indicating if the gauge produces high frequency data.gauge_model (
str, default"") – Model of the gauge being registered.measure_depth (
float, default0) – The depth at which the gauge measurements are taken, in meters.true_vertical_depth (
float, default0) – The true vertical depth of the gauge.true_vertical_depth_sub_sea (
float, default0) – The true vertical depth below sea level for the gauge.serial_number (
str, default"") – Serial number of the gauge, if available.labels (
listofstr, optional) – Labels associated with the gauge, useful for categorization.comment (
str, default"") – An optional comment or description for the gauge.read_from (
datetime, optional) – Start datetime for reading gauge data.read_to (
datetime, optional) – End datetime for reading gauge data.folder_id (
str, optional) – ID of the folder to associate the gauge with.
- Returns:
Data– Returns the newly created gauge object once it is successfully registered.- Return type:
- get_shut_in_extractions(rates_data_list, pressure_id_list, reference_shut_in, compared_shut_in_list=None, document_id=None)[source]#
Extract a loglog given the shut-in dates, pressure gauge and a corrected rate gauge. :param rates_data_list: List of the corrected rate gauges :param pressure_id_list: List of the vector id of the pressure gauges :param reference_shut_in: Reference shut-in :param compared_shut_in_list: List of the compared shut in, this list must contain the start and end dates of each shutin :param document_id: Document id of the reference document
- Parameters:
- Return type:
List[PTAExtraction]
- rename(new_well_name)[source]#
Rename the current well object.
- Parameters:
new_well_name (str) – New name of the well
- Return type:
None
- create_file_folder(name, folder_parent_id=None)[source]#
Creates a new file folder within the specified parent folder or within the default parent folder if none is specified.
This method searches for an existing folder with the specified name in the given parent folder. If such a folder already exists, it will return the existing folder. Otherwise, it creates a new folder under the parent folder, updates the folder hierarchy and appends the new folder to the parent’s list of child folders.
- Parameters:
name (
str) – The name of the new file folder to be created.folder_parent_id (
Optional[str], optional) – The ID of the parent folder under which the new folder should be created. If not provided, the new folder will be created under the default parent folder.
- Returns:
FileFolder– The created or pre-existing file folder object.- Return type:
FileFolder
- create_wellbore(geometries, perforations=None, delete_existing_wellbore=False)[source]#
Creates or updates a wellbore with the specified geometries and perforations. If the delete_existing_wellbore flag is set to True, the existing wellbore will be deleted before creating a new one.
- Parameters:
geometries (
List[WellboreGeometry]) – A list of wellbore geometries to define the structure of the wellbore.perforations (
Optional[List[WellborePerforation]], optional) – A list of perforations to specify the locations where fluid can flow between the wellbore and the reservoir, by default None.delete_existing_wellbore (
bool, optional) – A flag indicating whether to delete the existing wellbore before creating a new one, by default True.
- Return type:
None
- create_production_folder(name)[source]#
Creates a new production folder in the well :param name: :type name:
The nameofthe production folder- Returns:
- Parameters:
name (str)
- Return type:
- create_shut_in(input_type, input_gauge, look_for, minimum_shut_in_duration_hr=10, minimum_value_change=None, requires_validation=False)[source]#
Creates a shut-in event based on the given parameters.
- Parameters:
input_type (
InputTypeEnum) – The type of input data.input_gauge (
Data) – The gauge data to be used for identifying shut-ins.look_for (
LookForEnum) – The criteria to look for in the data.minimum_shut_in_duration_hr (
float) – The minimum duration of the shut-in in hours.minimum_value_change (
float) – The minimum value change to identify a shut-in.requires_validation (
bool, optional) – Whether the Shut-in requires validation (default is False).
- Returns:
Data– Shut-in.- Return type:
- create_corrected_production(production_folder, shut_in, name='Corrected production #1', use_uptime_correction=False, set_to_0_in_shut_ins=True, replace_by=None, constant_value_for_liquid_rate=None, constant_value_for_gas_rate=1, rate_correction_option=None, difference=0.1, delta_p_difference_multiplier=0.8, pressure=None, iqr_multiplier=None, simplify_method=None, delta_y_for_liquid_rate_simplification=0.1, delta_y_for_gas_rate_simplification=0.1, keep_original_rates_before_shut_ins=False, set_rates_to_negative_values=False)[source]#
Creates a corrected production dataset based on the given parameters.
- Parameters:
production_folder (
ProductionFolder) – The production folder to be corrected.shut_in (
Data) – The shut-in data to be used for corrections.name (
str, optional) – The name of the corrected production dataset (default is “Corrected production #1”).use_uptime_correction (
bool, optional) – Whether to use uptime correction (default is False).set_to_0_in_shut_ins (
bool, optional) – Whether to set rates to 0 during shut-ins (default is True).replace_by (
Optional[ReplaceByEnum], optional) – The method to replace values (default is None).constant_value_for_liquid_rate (
Optional[float], optional) – A constant value for liquid rate (default is None).constant_value_for_gas_rate (
Optional[float], optional) – A constant value for gas rate (default is 1).rate_correction_option (
Optional[RateCorrectionOptionEnum], optional) – The option for rate correction (default is None).difference (
float, optional) – The difference value for corrections (default is 0.1).delta_p_difference_multiplier (
float, optional) – The multiplier for delta pressure difference (default is 0.8).pressure (
Optional[Data], optional) – The pressure data to be used (default is None).iqr_multiplier (
Optional[bool], optional) – Whether to use IQR multiplier (default is None).simplify_method (
Optional[SimplifyMethodEnum], optional) – The method for simplification (default is None).delta_y_for_liquid_rate_simplification (
float, optional) – The delta Y value for liquid rate simplification (default is 0.1).delta_y_for_gas_rate_simplification (
float, optional) – The delta Y value for gas rate simplification (default is 0.1).keep_original_rates_before_shut_ins (
bool, optional) – Whether to keep original rates before shut-ins (default is False).set_rates_to_negative_values (
bool, optional) – Whether to set rates to negative values (default is False).
- Returns:
None- Return type:
None
- create_filter(data, filter_type, filter_name='New Filter', labels=None, denoising_threshold_level=None, denoising_threshold_value=2340.80561921557, denoising_threshold_type=DenoisingThresholdTypeEnum.adaptative, delta_t=2.0, delta_p=13789.5, size_of_slice=100000, min_window_x=None, max_window_x=None, min_window_y=None, max_window_y=None, denoising_pre_sampling_type=DenoisingPreSamplingTypeEnum.intermediate, denoising_pre_sampling_duration=0.004166666666666667, denoising_minimum_gap_duration=None, output_decimated_raw_data=False)[source]#
Create a wavelet filter under the gauge associated to this
Dataobject. :param data: Source gauge to create the filter :param filter_type: Type of the wavelet filter to use :param filter_name: Name of the new filter :param labels: Labels of the filter :param denoising_threshold_level: Level of denoising :param denoising_threshold_type: Type of denoising threshold :param denoising_threshold_value: Threshold value (default value is in Pascal) :param delta_t: Delta T value :param delta_p: Delta P value (default value is in Pascal) :param size_of_slice: Size of the slice, minimum is 10000 and maximum is 100000 :param min_window_x: Minimum window x value, must be a datetime :param max_window_x: Maximum window x value, must be a datetime :param min_window_y: Minimum window y value :param max_window_y: Maximum window y value :param denoising_pre_sampling_type: Only works if filter_type == FilterTypeEnum.wavelet_1 and must one of the following value [“Intermediate”, “PTA”, “User”, “PA”] :param denoising_pre_sampling_duration: Only works if filter_type == FilterTypeEnum.wavelet_1, the pre sampling interval duration in seconds :param denoising_minimum_gap_duration: Only works if filter_type == FilterTypeEnum.wavelet_1, denoising minimum gap duration :param output_decimated_raw_data: To output the raw filter- Returns:
Data– New filter- Parameters:
data (Data)
filter_type (FilterTypeEnum)
filter_name (str)
labels (List[str] | None)
denoising_threshold_level (float | None)
denoising_threshold_value (float)
denoising_threshold_type (DenoisingThresholdTypeEnum)
delta_t (float)
delta_p (float)
size_of_slice (int)
min_window_x (datetime | None)
max_window_x (datetime | None)
min_window_y (float | None)
max_window_y (float | None)
denoising_pre_sampling_type (DenoisingPreSamplingTypeEnum)
denoising_pre_sampling_duration (float)
denoising_minimum_gap_duration (float | None)
output_decimated_raw_data (bool)
- Return type:
- copy_file(file, 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:
- extract_well_properties_from_document(document, analyses_to_extract=None, extract_in_master_container=False)[source]#
Extracts well properties from a given document.
- Parameters:
document (
Document) – The document from which to extract well properties.analyses_to_extract (
Optional[List[Analysis]], optional) – List of analyses to extract. If None, all analyses from the document are extracted. Default is None.extract_in_master_container (
bool, optional) – Flag indicating whether to extract properties into the master container. Default is False.
- Returns:
WellPropertyContainer– The container holding the extracted well properties. If extract_in_master_container is True, returns the master container; otherwise, returns the container matching the document name.- Return type:
- create_pvt_from_kw_document(pvt_name, document_id, analysis_id)[source]#
Create a pvt object in the well
- Parameters:
pvt_name (
str) – Name of the PVT object to createdocument_id (
str) – Id of the document to useanalysis_id (str) – Id of the analysis to use
- Returns:
PVT– The PVT object created.- Return type:
- create_pvt_from_file(pvt_name, file_id, start_date=None, reservoir_pressure=None, reservoir_temperature=None, gas_oil_type=None, unit_system=None)[source]#
Creates a PVT (Pressure-Volume-Temperature) object from a file. You can define fallback parameters when the gas oil type is undetermined.
- Parameters:
pvt_name (
str) – The name of the PVT object to be created.file_id (
str) – The identifier of the file from which the PVT object will be created.start_date (
datetime, optional) – The start date for the PVT data coverage. Defaults to None.reservoir_pressure (
float, optional) – The pressure of the reservoir associated with the PVT object. Defaults to None.reservoir_temperature (
float, optional) – The temperature of the reservoir associated with the PVT object. Defaults to None.gas_oil_type (
GasOilTypeEnum, optional) – The type of gas or oil associated with the PVT object, as per the enumerated GasOilTypeEnum. Defaults to None.unit_system (
UnitSystemPvtEnum, optional) – The unit system used for the PVT object, as per the enumerated UnitSystemPvtEnum. Defaults to None.
- Returns:
PVT– An instance of the PVT object created using the provided parameters and data from the specified text file.- Return type:
- create_well_property_container(name)[source]#
Creates a new well property container for this
Well.- Parameters:
name (str) – Name of the new well property container.
- Returns:
WellPropertyContainer– The newly created well property container.- Return type:
- create_survey(name, date)[source]#
Create a new survey in the well.
This method creates a new survey to store well logs at a specific date..
- Parameters:
name (
str) – The name of the survey container.date (datetime) – Date of the survey
- Returns:
Survey– The newly created survey container object.- Return type:
Survey
- create_model_book(document, name)[source]#
Creates a new model book associated with this well.
- Parameters:
document (
Document) – The document to use as the basis for creating the model book.name (
str) – The name to assign to the new model book.
- Returns:
ModelBook– The newly created model book instance.- Return type:
ModelBook
- delete_model_book(model_book)[source]#
Deletes a model book from this well.
- Parameters:
model_book (
ModelBook) – The model book instance to delete.- Returns:
None– This method doesn’t return any value.- Return type:
None
- delete_file(file)[source]#
Deletes a specified file from the cluster and updates the local file list.
This method removes a file either provided directly as a File object or indirectly as a Document object. In the case of a Document, it searches for and locates the equivalent File object within the local file list. Once found, the file is deleted from both the remote cluster via the underlying API and the local files list, keeping the data in sync.
- Parameters:
file (
Union[File,Document]) – The file object to be deleted. It can be provided either directly as a File object or as a Document object, which is then matched to a File for deletion.- Return type:
None
Warning
Calling this method while iterating over a collection containing the file (e.g., for file in self.files:) can lead to unexpected behavior, as it modifies the collection during iteration. To avoid this issue, create a copy of the collection before iteration (e.g., for file in list(well.files):) or collect the files to delete first, then delete them in a separate step.
- compute_forward_rates(pvt_id, wellbore_id, computation_date, pressure_vs_depth_vector, temperature_vs_depth_vector, velocity_vs_depth_vector, heat_transfer_coefficient=None, reservoir_temperature=None, reservoir_temperature_gradient=None, reservoir_depth=None)[source]#
Computes forward rates based on well and reservoir parameters, including pressure, temperature, velocity vs depth, and optional reservoir properties. Ensures consistency in providing all optional reservoir parameters as a single block or none. Converts the input data into specific data transfer objects (DTOs), makes a remote API request for computation, and processes the results into output DTO.
- Parameters:
pvt_id (
str) – The PVT (Pressure-Volume-Temperature) identifier associated with the computation.wellbore_id (
str) – The wellbore identifier for the computation.computation_date (
datetime) – The date on which the computation is being carried out.pressure_vs_depth_vector (
VsDepthVector) – A vector representing pressure values vs depth in the wellbore.temperature_vs_depth_vector (
VsDepthVector) – A vector representing temperature values vs depth in the wellbore.velocity_vs_depth_vector (
VsDepthVector) – A vector representing velocity values vs depth in the wellbore.heat_transfer_coefficient (
Optional[float]) – The heat transfer coefficient for reservoir interaction, if provided.reservoir_temperature (
Optional[float]) – The temperature of the reservoir, if provided.reservoir_temperature_gradient (
Optional[float]) – The gradient of temperature across the reservoir, if provided.reservoir_depth (
Optional[float]) – The depth of the reservoir, if provided.
- Returns:
ForwardRatesOutputs– The computed forward rates encapsulated in an output DTO.- Raises:
ValueError – If any but not all the optional parameters (heat_transfer_coefficient, reservoir_temperature, reservoir_temperature_gradient, reservoir_depth) are provided.
- Return type:
ForwardRatesOutputs
- create_document(document_type, target_folder_id, name, well_radius, porosity, pay_zone, rock_compressibility, top_reservoir_depth, pvt_id=None, pressure_id=None, oil_rate_id=None, gas_rate_id=None, water_rate_id=None)[source]#
- Parameters:
document_type (KWModuleEnum)
target_folder_id (str)
name (str)
well_radius (float)
porosity (float)
pay_zone (float)
rock_compressibility (float)
top_reservoir_depth (float)
pvt_id (str | None)
pressure_id (str | None)
oil_rate_id (str | None)
gas_rate_id (str | None)
water_rate_id (str | None)
- Return type:
- delete_data(data)[source]#
Deletes a specified data object from the current field and updates the internal data list by removing the corresponding object.
- Parameters:
data (
Data) – The data object to be deleted, defined by its unique identifier (vector_id). The data object must already exist in the cluster, and it should match an object retrieved by the current field’s internal data list.- Returns:
None– This method does not return a value.- Return type:
None
- create_data_folder(name, folder_parent_id=None, is_subfolder=True)[source]#
Creates a data folder within the current context, either as a direct child of a parent folder or at the well level, depending on the specified parameters.
This method allows hierarchical organization of data folders. If is_subfolder is set to False, the data folder is created at the well level irrespective of folder_parent_id. Otherwise, the folder is created under the specified parent folder, or under a default folder with the name “Gauges” if no parent folder ID is provided.
- Parameters:
name (
str) – The name of the data folder to be created.folder_parent_id (
Optional[str], optional) – The ID of the parent folder under which the new folder is created, by default None. If None, the folder is created under the “Gauges” folder, unless is_subfolder is set to False, in which case the folder is created at the well level.is_subfolder (
bool, optional) – A flag indicating whether the folder should be created as a subfolder (default: True). If False, the folder is created at the well level regardless of folder_parent_id.
- Returns:
DataFolder– The created DataFolder object.- Raises:
ValueError – If folder_parent_id is provided but does not correspond to an existing folder in the current structure.
- Return type:
DataFolder