Project

class rips.Project(pb2_object: PdmObject | None = None, channel: Channel | None = None)

Bases: PdmObjectBase

The ResInsight Project

Methods Summary

case(case_id)

Get a specific grid case from the provided case Id

cases()

Get a list of all grid cases in the project

close()

Close the current project (and open new blank project)

color_legend_collection()

Get the project's color legend collection

create()

create_corner_point_grid(name, nx, ny, nz, ...)

Creates a corner point grid from given parameters.

create_generic_view([name])

Create a case-less 3D view

create_grid_case_group([case_paths])

Create a grid case group from a list of grid files with identical grids

create_grid_from_key_values([name, nx, ny, ...])

Create Grid From Key Values

export_multi_case_snapshots(grid_list_file)

Export snapshots for a set of cases

export_snapshots([snapshot_type, prefix, ...])

Export all snapshots of a given type

export_well_paths([well_paths, md_step_size])

Export a set of well paths

grid_case_group(group_id)

Get a particular grid case group belonging to a project

grid_case_groups()

Get a list of all grid case groups in the project

import_formation_names([formation_files, ...])

Import formation names into project and apply it to all grid cases in the project

import_summary_case([file_name])

Import Summary Case

import_summary_ensemble([file_names, ...])

Import summary files as one ensemble

import_well_log_files([well_log_files, ...])

Import well log files into project

import_well_paths([well_path_files, ...])

Import well paths into project

key_values(key)

Get float values for a given key.

key_values_async(key)

Get float values for a given key.

link_views([views])

Link the specified 3D views

load_case([path, grid_only])

Load a grid case from file and add it to the project

open(path)

Open a new project from the given path

plot(view_id)

Get a particular plot by providing view id

plots()

Get a list of all plots belonging to a project

remove_key_values(key)

Remove the values for a given key in the key-value store.

replace_source_cases(grid_list_file[, ...])

Replace all source grid cases within a case group

run_octave_script([path, cases])

Run an Octave script once per case.

save([path])

Save the project to the existing project file, or to a new file

scale_fracture_template(template_id, ...)

Scale fracture template parameters

selected_cases()

Get a list of all grid cases selected in the project tree

set_fracture_containment(template_id, ...)

Set fracture template containment parameters

set_key_values(key, values)

Sets values for a given key in the key-value store.

summary_case([case_id])

Find Summary Case

summary_cases()

Get a list of all summary cases in the Project

summary_ensembles()

Get all summary ensembles in the project

summary_plot_collection()

Get the summary plot collection of the project

surface_by_name(name, surface_type, folder)

Get a surface by name

surface_folder([folder_name])

Get the top surface folder, or one of its direct sub folders by name.

surfaces(surface_type, include_ensembles)

Get all surfaces in the project, from the top surface folder and its sub folders

tile_views()

Tile all visible 3D view windows

unlink_views([views])

Unlink the specified 3D views

valve_templates()

Get Valve Template Collection

view(view_id)

Get a particular view belonging to a case by providing view id

views()

Get a list of views belonging to a project

well_path_by_name(well_path_name)

Get a specific well path by name from the project

well_path_collection()

Get Well Path Collection

well_paths()

Get a list of all well paths in the project

Methods Documentation

case(case_id: int) → Reservoir | None

Get a specific grid case from the provided case Id

Parameters:

id (int) -- case id

Returns:

rips.generated.resinsight_classes.Case

cases() → List[Reservoir]

Get a list of all grid cases in the project

Returns:

A list of rips.generated.generated_classes.Case

close() → None

Close the current project (and open new blank project)

color_legend_collection() → ColorLegendCollection | None

Get the project's color legend collection

Returns:

rips.generated.generated_classes.ColorLegendCollection

create() → Project
create_corner_point_grid(name: str, nx: int, ny: int, nz: int, coord: List[float], zcorn: List[float], actnum: List[int])

Creates a corner point grid from given parameters.

Parameters:
  • name (str) -- Name of the grid.

  • nx (int) -- Number of cells in x direction

  • ny (int) -- Number of cells in y direction

  • nz (int) -- Number of cells in z direction

  • coord (list[float]) -- Coordinate lines as COORD keyword in Eclipse. Each coordinate line is defined by two points (top and bottom). Size: (nx+1) * (ny+1) * 2 * 3. Points are ordered as in Eclipse.

  • zcorn (list[float]) -- Corner depths as defined by the Eclipse keyword ZCORN. Size: nx * ny * nz * 8

  • actnum (list[int]) -- Active cell info: cells with values > 0 are active. Size: nx * ny * nz

create_generic_view(name: str = '') → GenericView

Create a case-less 3D view

Parameters:

name (str)

Returns:

GenericView

create_grid_case_group(case_paths: List[str] = []) → GridCaseGroup

Create a grid case group from a list of grid files with identical grids

Parameters:

case_paths (List[str]) -- Paths to the grid files

Returns:

GridCaseGroup

create_grid_from_key_values(name: str = '', nx: int = 0, ny: int = 0, nz: int = 0, coord_key: str = '', zcorn_key: str = '', actnum_key: str = '') → CornerPointCase

Create Grid From Key Values

Parameters:
  • name (str)

  • nx (int)

  • ny (int)

  • nz (int)

  • coord_key (str)

  • zcorn_key (str)

  • actnum_key (str)

Returns:

CornerPointCase

export_multi_case_snapshots(grid_list_file)

Export snapshots for a set of cases

Parameters:

grid_list_file (str) -- Path to a file containing a list of grids to export snapshot for

export_snapshots(snapshot_type='ALL', prefix='', plot_format='PNG', width=-1, height=-1, content_type=None, export_folder='', plot_file_format=None)

Export all snapshots of a given type

Parameters:
  • snapshot_type (str) -- Deprecated, use content_type. Enum string ('ALL', 'VIEWS' or 'PLOTS')

  • prefix (str) -- Exported file name prefix

  • plot_format (str) -- Deprecated, use plot_file_format. Enum string, 'PNG' or 'PDF'

  • width (int) -- The width of the exported snapshots. By default will use the existing size.

  • height (int) -- The height of the exported snapshots. By default will use the existing size.

  • content_type (SnapshotContentType) -- 'ALL', 'VIEWS' or 'PLOTS'

  • export_folder (str) -- The path to export to. By default will use the 'snapshots' folder next to the project file.

  • plot_file_format (SnapshotFileFormat) -- 'PNG' or 'PDF'

export_well_paths(well_paths=None, md_step_size=5.0)

Export a set of well paths

Deprecated: use WellPath.export_geometry(export_folder=..., md_step_size=...) on each well path instead. This method writes to the WELLPATHS folder set by Instance.set_export_folder().

Parameters:
  • well_paths (list) -- List of strings of well paths. If none, export all.

  • md_step_size (double) -- resolution of the exported well path

grid_case_group(group_id)

Get a particular grid case group belonging to a project

Parameters:

groupId (int) -- group id

Returns:

rips.generated.generated_classes.GridCaseGroup

grid_case_groups()

Get a list of all grid case groups in the project

Returns:

List of rips.generated.generated_classes.GridCaseGroup

import_formation_names(formation_files=None, apply_to_all_cases=True)

Import formation names into project and apply it to all grid cases in the project

Parameters:
  • formation_files (list) -- list of files to import

  • apply_to_all_cases (bool) -- assign the imported formation names to all grid cases. Use Case.set_formation_names() for finer control.

Returns:

rips.generated.generated_classes.FormationNames

import_summary_case(file_name: str = '') → FileSummaryCase

Import Summary Case

Parameters:

file_name (str)

Returns:

FileSummaryCase

import_summary_ensemble(file_names: List[str] = [], ensemble_name: str = '') → SummaryEnsemble

Import summary files as one ensemble

Parameters:
  • file_names (List[str]) -- Summary files (SMSPEC), one for each realization

  • ensemble_name (str) -- Ensemble name. Automatically generated if empty

Returns:

SummaryEnsemble

import_well_log_files(well_log_files=None, well_log_folder='')

Import well log files into project

Parameters:
  • well_log_files (list) -- list of file paths to import

  • well_log_folder (str) -- A folder path containing files to import

Returns:

A list of well path names (strings)

import_well_paths(well_path_files=None, well_path_folder='')

Import well paths into project

Parameters:
  • well_path_files (list) -- list of file paths to import

  • well_path_folder (str) -- A folder path containing files to import

Returns:

List of rips.generated.generated_classes.WellPath

key_values(key)

Get float values for a given key. Synchronous: returns a list. `

Parameters:

key (str) -- The key to get.

Returns:

A list of float values

key_values_async(key)

Get float values for a given key. Async: returns an iterator.

Parameters:

key (str) -- The key to get.

Returns:

An iterator to a chunk object containing an array of float values Loop through the chunks and then the values within the chunk to get all values.

Link the specified 3D views

Parameters:

views (List[View])

Returns:

load_case(path: str = '', grid_only: bool = False) → Case

Load a grid case from file and add it to the project

Parameters:
  • path (str) -- Path to the grid file (EGRID, GRID, GRDECL or ROFF) or geomechanical case (ODB, INP or PVD)

  • grid_only (bool) -- Load the grid geometry only, without results

Returns:

Case

open(path)

Open a new project from the given path

Parameters:

path (str) -- path to project file

plot(view_id)

Get a particular plot by providing view id

Parameters:

view_id (int) -- view id

Returns:

rips.generated.generated_classes.Plot

plots()

Get a list of all plots belonging to a project

Returns:

List of rips.generated.generated_classes.Plot

remove_key_values(key)

Remove the values for a given key in the key-value store.

Parameters:

key (str) -- The key.

replace_source_cases(grid_list_file, case_group_id=0)

Replace all source grid cases within a case group

Deprecated: use GridCaseGroup.replace_source_cases(grid_files=[...]) on the group object instead, which takes the grid file paths directly.

Parameters:
  • grid_list_file (str) -- path to file containing a list of cases

  • case_group_id (int) -- id of the case group to replace

run_octave_script(path: str = '', cases: List[Case] = []) → None

Run an Octave script once per case. Empty case list means all Eclipse cases.

Parameters:
  • path (str) -- Path to the Octave script

  • cases (List[Case]) -- Cases to run the script for. Empty means all Eclipse cases.

Returns:

save(path='')

Save the project to the existing project file, or to a new file

Parameters:

path (str) -- File path to the file to save the project to. If empty, saves to the active project file

scale_fracture_template(template_id, half_length, height, d_factor, conductivity)

Scale fracture template parameters

Deprecated: use FractureTemplate.set_scale_factors(...) on the template object instead.

Parameters:
  • template_id (int) -- ID of fracture template

  • half_length (double) -- Half Length scale factor

  • height (double) -- Height scale factor

  • d_factor (double) -- D-factor scale factor

  • conductivity (double) -- Conductivity scale factor

selected_cases() → List[Case]

Get a list of all grid cases selected in the project tree

Returns:

A list of rips.generated.generated_classes.Case

set_fracture_containment(template_id, top_layer, base_layer)

Set fracture template containment parameters

Deprecated: use FractureTemplate.set_containment(...) on the template object instead.

Parameters:
  • template_id (int) -- ID of fracture template

  • top_layer (int) -- Top layer containment

  • base_layer (int) -- Base layer containment

set_key_values(key, values)

Sets values for a given key in the key-value store.

Parameters:
  • key (str) -- The key (should be unique).

  • values (list) -- a list of double precision floating point numbers

summary_case(case_id: int = -1) → FileSummaryCase | None

Find Summary Case

Parameters:

case_id (int)

Returns:

FileSummaryCase

summary_cases()

Get a list of all summary cases in the Project

Returns: A list of rips.generated.resinsight_classes.SummaryCase

summary_ensembles() → List[SummaryEnsemble]

Get all summary ensembles in the project

Returns:

Summary case groups flagged as ensembles

Return type:

List[SummaryEnsemble]

summary_plot_collection() → SummaryPlotCollection

Get the summary plot collection of the project

Returns:

The collection used to create summary plots

Return type:

SummaryPlotCollection

surface_by_name(name: str, surface_type: Type[SurfaceT] = <class 'rips.generated.generated_classes.SurfaceInterface'>, folder: SurfaceCollection | None = None) → SurfaceT | None

Get a surface by name

Names are only unique within one folder. Without a folder the first match is returned, searching the top surface folder first and then its sub folders. In that case ensemble surfaces are excluded. The name is matched against surface_user_description, so a depth offset shown in the tree does not affect the match.

Parameters:
  • name (str) -- The surface name (surface_user_description)

  • surface_type (class) -- Only consider surfaces of this class, subclasses included

  • folder (SurfaceCollection) -- Only look in this folder, sub folders excluded. Any folder can be passed, including a rips.EnsembleSurface. Note that project.surface_folder(name) only finds direct sub folders of the top folder; use folder.sub_collections() to reach nested folders.

Returns:

The surface, or None when no surface has that name

surface_folder(folder_name: str = '') → SurfaceCollection | None

Get the top surface folder, or one of its direct sub folders by name. Nested sub folders are not searched. Returns None if no direct sub folder has the given name.

Parameters:

folder_name (str) -- Name of a direct sub folder of the top surface folder. Empty returns the top folder.

Returns:

SurfaceCollection

surfaces(surface_type: Type[SurfaceT] = <class 'rips.generated.generated_classes.SurfaceInterface'>, include_ensembles: bool = False) → List[SurfaceT]

Get all surfaces in the project, from the top surface folder and its sub folders

Parameters:
  • surface_type (class) -- Only return surfaces of this class, subclasses included. rips.SurfaceInterface (the default) returns every surface, rips.Surface returns file surfaces only, and rips.RegularSurface also returns rips.RegularFileSurface.

  • include_ensembles (bool) -- Also return the statistics and realization surfaces of ensemble surfaces (rips.EnsembleSurface). Off by default.

Returns:

List of surfaces of the requested class

tile_views() → None

Tile all visible 3D view windows

Arguments:

Returns:

Unlink the specified 3D views

Parameters:

views (List[View])

Returns:

valve_templates() → ValveTemplateCollection

Get Valve Template Collection

Arguments:

Returns:

ValveTemplateCollection

view(view_id)

Get a particular view belonging to a case by providing view id

Parameters:

view_id (int) -- view id

Returns:

rips.generated.generated_classes.View

views()

Get a list of views belonging to a project

well_path_by_name(well_path_name)

Get a specific well path by name from the project

Returns:

rips.generated.generated_classes.WellPath

well_path_collection() → WellPathCollection

Get Well Path Collection

Arguments:

Returns:

WellPathCollection

well_paths()

Get a list of all well paths in the project

Returns:

List of rips.generated.generated_classes.WellPath