Skip to content

Commit

Permalink
New WellCompletions plugin (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindjoha authored Apr 27, 2021
1 parent 1f7eca1 commit 2427301
Show file tree
Hide file tree
Showing 6 changed files with 543 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED] - YYYY-MM-DD
### Changed
- [#612](https://github.com/equinor/webviz-subsurface/pull/612) - New features in ReservoirSimulationTimeSeries: Statistical lines, option to remove history trace, histogram available when plotting individual realizations.
- [#612](https://github.com/equinor/webviz-subsurface/pull/612) - New features in `ReservoirSimulationTimeSeries`: Statistical lines, option to remove history trace, histogram available when plotting individual realizations.

### Fixed
- [#615](https://github.com/equinor/webviz-subsurface/pull/615) - Improve table performance of AssistedHistoryMatchingAnalysis.
- [#615](https://github.com/equinor/webviz-subsurface/pull/615) - Improve table performance of `AssistedHistoryMatchingAnalysis`.

### Added
- [#605](https://github.com/equinor/webviz-subsurface/pull/605) - New plugin to analyze structural uncertainty from FMU ensembles.
- [#610](https://github.com/equinor/webviz-subsurface/pull/610) - New plugin `WellCompletions` to visualize completion data of simulation wells.

## [0.2.0] - 2021-03-28
- [#604](https://github.com/equinor/webviz-subsurface/pull/604) - Consolidates surface loading and statistical calculation of surfaces by introducing a shared
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"WellCrossSection = webviz_subsurface.plugins:WellCrossSection",
"WellCrossSectionFMU = webviz_subsurface.plugins:WellCrossSectionFMU",
"AssistedHistoryMatchingAnalysis = webviz_subsurface.plugins:AssistedHistoryMatchingAnalysis",
"WellCompletions = webviz_subsurface.plugins:WellCompletions",
]
},
install_requires=[
Expand All @@ -76,7 +77,7 @@
"scipy>=1.2",
"statsmodels>=0.12.1", # indirect dependency through https://plotly.com/python/linear-fits/
"webviz-config>=0.2.7",
"webviz-subsurface-components>=0.3.0",
"webviz-subsurface-components>=0.4.2",
"xtgeo>=2.14",
],
extras_require={"tests": TESTS_REQUIRE},
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/test_raw_data_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def test_full_example(
"parameterdistribution",
"parametercorrelation",
"reservoirsimulationtimeseries",
"wellcompletions",
]:
dash_duo.wait_for_element(f"#{page}").click()
logs = [
Expand Down
63 changes: 63 additions & 0 deletions webviz_subsurface/_datainput/well_completions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from typing import Optional, Dict
import json
from pathlib import Path
import glob

import ecl2df


def read_zone_layer_mapping(
ensemble_path: str, zone_layer_mapping_file: str
) -> Optional[Dict[int, str]]:
"""Searches for a zone layer mapping file (lyr format) on the scratch disk. \
If one file is found it is parsed using functionality from the ecl2df \
library.
"""
for filename in glob.glob(f"{ensemble_path}/{zone_layer_mapping_file}"):
return ecl2df.EclFiles("").get_zonemap(filename=filename)
return None


def read_well_attributes(
ensemble_path: str, well_attributes_file: str
) -> Optional[dict]:
"""Searches for a well attributes json file on the scratch disk. \
if one file is found it is parsed and returned as a dictionary.
The file needs to follow the format below. The categorical attributes \
are optional.
{
"version" : "0.1",
"wells" : [
{
"alias" : {
"eclipse" : "OP_1"
},
"attributes" : {
"mlt_singlebranch" : "mlt",
"structure" : "East",
"welltype" : "producer"
},
"name" : "OP_1"
},
{
"alias" : {
"eclipse" : "GI_1"
},
"attributes" : {
"mlt_singlebranch" : "singlebranch",
"structure" : "West",
"welltype" : "gas injector"
},
"name" : "GI_1"
},
]
}
"""
for filename in glob.glob(f"{ensemble_path}/{well_attributes_file}"):
file_content = json.loads(Path(filename).read_text())
return {
well_data["alias"]["eclipse"]: well_data["attributes"]
for well_data in file_content["wells"]
}
return None
1 change: 1 addition & 0 deletions webviz_subsurface/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@
from ._well_cross_section import WellCrossSection
from ._well_cross_section_fmu import WellCrossSectionFMU
from ._assisted_history_matching_analysis import AssistedHistoryMatchingAnalysis
from ._well_completions import WellCompletions
Loading

0 comments on commit 2427301

Please sign in to comment.