webviz-subsurface 0.2.39__py3-none-any.whl → 0.2.40__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. webviz_subsurface/_figures/timeseries_figure.py +1 -1
  2. webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_lazy.py +3 -1
  3. webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_presampled.py +3 -1
  4. webviz_subsurface/_providers/ensemble_table_provider/ensemble_table_provider_impl_arrow.py +3 -1
  5. webviz_subsurface/_utils/dataframe_utils.py +1 -1
  6. webviz_subsurface/_version.py +34 -0
  7. webviz_subsurface/plugins/_bhp_qc/views/_view_functions.py +5 -5
  8. webviz_subsurface/plugins/_co2_leakage/_utilities/co2volume.py +1 -1
  9. webviz_subsurface/plugins/_disk_usage.py +19 -8
  10. webviz_subsurface/plugins/_line_plotter_fmu/controllers/build_figure.py +4 -4
  11. webviz_subsurface/plugins/_map_viewer_fmu/map_viewer_fmu.py +1 -1
  12. webviz_subsurface/plugins/_parameter_analysis/_utils/_parameters_model.py +5 -5
  13. webviz_subsurface/plugins/_property_statistics/property_statistics.py +1 -1
  14. webviz_subsurface/plugins/_relative_permeability.py +6 -6
  15. webviz_subsurface/plugins/_reservoir_simulation_timeseries_regional.py +12 -12
  16. webviz_subsurface/plugins/_running_time_analysis_fmu.py +6 -1
  17. webviz_subsurface/plugins/_seismic_misfit.py +2 -3
  18. webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_utils/vector_statistics.py +4 -4
  19. webviz_subsurface/plugins/_structural_uncertainty/views/intersection_and_map.py +1 -1
  20. webviz_subsurface/plugins/_swatinit_qc/_business_logic.py +1 -1
  21. webviz_subsurface-0.2.40.dist-info/METADATA +822 -0
  22. {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.40.dist-info}/RECORD +27 -78
  23. {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.40.dist-info}/WHEEL +1 -1
  24. {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.40.dist-info}/top_level.txt +0 -1
  25. tests/integration_tests/__init__.py +0 -0
  26. tests/integration_tests/test_parameter_filter.py +0 -28
  27. tests/integration_tests/test_surface_selector.py +0 -53
  28. tests/unit_tests/__init__.py +0 -0
  29. tests/unit_tests/abbreviations_tests/__init__.py +0 -0
  30. tests/unit_tests/abbreviations_tests/test_reservoir_simulation.py +0 -94
  31. tests/unit_tests/data_input/__init__.py +0 -0
  32. tests/unit_tests/data_input/test_calc_from_cumulatives.py +0 -178
  33. tests/unit_tests/data_input/test_image_processing.py +0 -11
  34. tests/unit_tests/mocks/__init__.py +0 -0
  35. tests/unit_tests/mocks/ensemble_summary_provider_dummy.py +0 -67
  36. tests/unit_tests/model_tests/__init__.py +0 -0
  37. tests/unit_tests/model_tests/test_ensemble_model.py +0 -176
  38. tests/unit_tests/model_tests/test_ensemble_set_model.py +0 -105
  39. tests/unit_tests/model_tests/test_gruptree_model.py +0 -89
  40. tests/unit_tests/model_tests/test_property_statistics_model.py +0 -42
  41. tests/unit_tests/model_tests/test_surface_set_model.py +0 -48
  42. tests/unit_tests/model_tests/test_well_attributes_model.py +0 -110
  43. tests/unit_tests/model_tests/test_well_set_model.py +0 -70
  44. tests/unit_tests/plugin_tests/__init__.py +0 -0
  45. tests/unit_tests/plugin_tests/test_grouptree.py +0 -175
  46. tests/unit_tests/plugin_tests/test_simulation_time_series/__init__.py +0 -0
  47. tests/unit_tests/plugin_tests/test_simulation_time_series/mocks/__init__.py +0 -0
  48. tests/unit_tests/plugin_tests/test_simulation_time_series/mocks/derived_vectors_accessor_ensemble_summary_provider_mock.py +0 -60
  49. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/__init__.py +0 -0
  50. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_create_vector_traces_utils.py +0 -530
  51. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_dataframe_utils.py +0 -119
  52. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_datetime_utils.py +0 -51
  53. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_delta_ensemble_utils.py +0 -222
  54. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_delta_ensemble_vectors_accessor_impl.py +0 -319
  55. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_ensemble_vectors_accessor_impl.py +0 -271
  56. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_ensemble_vectors_accessor_utils.py +0 -78
  57. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_vector_accessor.py +0 -57
  58. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_ensemble_summary_provider_set_utils.py +0 -213
  59. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_from_timeseries_cumulatives.py +0 -322
  60. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_history_vectors.py +0 -201
  61. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_trace_line_shape.py +0 -56
  62. tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_vector_statistics.py +0 -171
  63. tests/unit_tests/plugin_tests/test_tornado_data.py +0 -130
  64. tests/unit_tests/plugin_tests/test_well_completions.py +0 -158
  65. tests/unit_tests/provider_tests/__init__.py +0 -0
  66. tests/unit_tests/provider_tests/test_ensemble_summary_provider.py +0 -255
  67. tests/unit_tests/provider_tests/test_ensemble_summary_provider_impl_arrow_lazy.py +0 -388
  68. tests/unit_tests/provider_tests/test_ensemble_summary_provider_impl_arrow_presampled.py +0 -160
  69. tests/unit_tests/provider_tests/test_ensemble_summary_provider_resampling.py +0 -320
  70. tests/unit_tests/provider_tests/test_ensemble_table_provider.py +0 -190
  71. tests/unit_tests/utils_tests/__init__.py +0 -0
  72. tests/unit_tests/utils_tests/test_dataframe_utils.py +0 -281
  73. tests/unit_tests/utils_tests/test_ensemble_summary_provider_set/__init__.py +0 -0
  74. tests/unit_tests/utils_tests/test_ensemble_summary_provider_set/test_ensemble_summary_provider_set.py +0 -306
  75. tests/unit_tests/utils_tests/test_formatting.py +0 -10
  76. tests/unit_tests/utils_tests/test_simulation_timeseries.py +0 -51
  77. webviz_subsurface-0.2.39.dist-info/METADATA +0 -147
  78. {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.40.dist-info}/entry_points.txt +0 -0
  79. {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.40.dist-info/licenses}/LICENSE +0 -0
  80. {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.40.dist-info/licenses}/LICENSE.chromedriver +0 -0
@@ -1,70 +0,0 @@
1
- from pathlib import Path
2
-
3
- import numpy as np
4
- import pytest
5
- import xtgeo
6
-
7
- from webviz_subsurface._models import WellSetModel
8
-
9
-
10
- @pytest.mark.usefixtures("app")
11
- def test_well_set_model(testdata_folder: Path) -> None:
12
- wellfiles = [
13
- testdata_folder / "reek_test_data" / "observed_data" / "wells" / well
14
- for well in ["OP_1.w", "OP_2.w", "OP_3.w", "OP_4.w", "OP_5.w", "OP_6.w"]
15
- ]
16
-
17
- wmodel = WellSetModel(wellfiles=wellfiles)
18
- assert set(wmodel.well_names) == set(
19
- ["OP_1", "OP_2", "OP_3", "OP_4", "OP_5", "OP_6"]
20
- )
21
- for name, well in wmodel.wells.items():
22
- assert isinstance(name, str)
23
- assert isinstance(well, xtgeo.Well)
24
- op_6 = wmodel.get_well("OP_6")
25
- assert isinstance(op_6, xtgeo.Well)
26
- assert op_6.name == "OP_6"
27
-
28
-
29
- @pytest.mark.usefixtures("app")
30
- def test_logs(testdata_folder: Path) -> None:
31
- wmodel = WellSetModel(
32
- wellfiles=[
33
- testdata_folder / "reek_test_data" / "observed_data" / "wells" / "OP_6.w"
34
- ],
35
- zonelog="Zonelog",
36
- )
37
- well = wmodel.get_well("OP_6")
38
- assert well.zonelogname == "Zonelog"
39
-
40
-
41
- @pytest.mark.usefixtures("app")
42
- def test_tvd_truncation(testdata_folder: Path) -> None:
43
- wmodel = WellSetModel(
44
- wellfiles=[
45
- testdata_folder / "reek_test_data" / "observed_data" / "wells" / "OP_6.w"
46
- ],
47
- tvdmin=1000,
48
- tvdmax=1500,
49
- )
50
- well = wmodel.get_well("OP_6")
51
- assert well.dataframe["Z_TVDSS"].min() >= 1000
52
- assert well.dataframe["Z_TVDSS"].max() <= 1501
53
-
54
-
55
- @pytest.mark.usefixtures("app")
56
- def test_get_fence(testdata_folder: Path) -> None:
57
- wmodel = WellSetModel(
58
- wellfiles=[
59
- testdata_folder / "reek_test_data" / "observed_data" / "wells" / "OP_6.w"
60
- ],
61
- zonelog="Zonelog",
62
- )
63
- fence = wmodel.get_fence("OP_6")
64
- assert isinstance(fence, np.ndarray)
65
- # Test horizontal length
66
- assert int(fence[:, 3].min()) == -40
67
- assert int(fence[:, 3].max()) == 2713
68
- # Test tvd
69
- assert int(fence[:, 2].min()) == 0
70
- assert int(fence[:, 2].max()) == 1643
File without changes
@@ -1,175 +0,0 @@
1
- import datetime
2
- from pathlib import Path
3
- from typing import List, Tuple
4
-
5
- import pandas as pd
6
- import pytest
7
- from _pytest.fixtures import SubRequest
8
-
9
- from webviz_subsurface._providers import EnsembleSummaryProvider
10
- from webviz_subsurface._providers.ensemble_summary_provider._provider_impl_arrow_presampled import (
11
- ProviderImplArrowPresampled,
12
- )
13
- from webviz_subsurface.plugins._group_tree._utils._ensemble_group_tree_data import (
14
- add_nodetype,
15
- )
16
-
17
- ADD_NODETYPE_CASES = [
18
- # Group leaf nodes:
19
- # NODE1 has summary data>0 and will be classified as prod and inj
20
- # NODE2 has summary data==0 and will be classified as other
21
- # NODE3 has no summary data and will be classified as other
22
- # FIELD and TMPL are classified as all three types
23
- (
24
- pd.DataFrame(
25
- columns=["DATE", "CHILD", "KEYWORD", "PARENT"],
26
- data=[
27
- ["2000-01-01", "FIELD", "GRUPTREE", None],
28
- ["2000-01-01", "TMPL", "GRUPTREE", "FIELD"],
29
- ["2000-01-01", "NODE1", "GRUPTREE", "TMPL"],
30
- ["2000-01-01", "NODE2", "GRUPTREE", "TMPL"],
31
- ["2000-01-01", "NODE3", "GRUPTREE", "TMPL"],
32
- ],
33
- ),
34
- pd.DataFrame(
35
- columns=[
36
- "DATE",
37
- "REAL",
38
- "GGPR:NODE1",
39
- "GGIR:NODE1",
40
- "GGPR:NODE2",
41
- "GGIR:NODE2",
42
- ],
43
- data=[
44
- [datetime.date(2000, 1, 1), 0, 1, 1, 0, 0],
45
- ],
46
- ),
47
- pd.DataFrame(
48
- columns=[
49
- "DATE",
50
- "CHILD",
51
- "KEYWORD",
52
- "PARENT",
53
- "IS_PROD",
54
- "IS_INJ",
55
- "IS_OTHER",
56
- ],
57
- data=[
58
- ["2000-01-01", "FIELD", "GRUPTREE", None, True, True, True],
59
- ["2000-01-01", "TMPL", "GRUPTREE", "FIELD", True, True, True],
60
- ["2000-01-01", "NODE1", "GRUPTREE", "TMPL", True, True, False],
61
- ["2000-01-01", "NODE2", "GRUPTREE", "TMPL", False, False, True],
62
- ["2000-01-01", "NODE3", "GRUPTREE", "TMPL", False, False, True],
63
- ],
64
- ),
65
- ),
66
- # Well leaf nodes:
67
- # WELL1 has WSTAT==1 and will be classified as producer
68
- # WELL2 has WSTAT==2 and will be classified as injector
69
- # WELL3 has first WSTAT==1 and then WSTAT==2 and will be classified as both
70
- # WELL4 has WSTAT==0 and will be classified as other
71
- # TMPL_A is classified as prod and inj
72
- # TMPL_B is classified as other
73
- (
74
- pd.DataFrame(
75
- columns=["DATE", "CHILD", "KEYWORD", "PARENT"],
76
- data=[
77
- ["2000-01-01", "FIELD", "GRUPTREE", None],
78
- ["2000-01-01", "TMPL_A", "GRUPTREE", "FIELD"],
79
- ["2000-01-01", "TMPL_B", "GRUPTREE", "FIELD"],
80
- ["2000-01-01", "WELL1", "WELSPECS", "TMPL_A"],
81
- ["2000-01-01", "WELL2", "WELSPECS", "TMPL_A"],
82
- ["2000-01-01", "WELL3", "WELSPECS", "TMPL_A"],
83
- ["2000-01-01", "WELL4", "WELSPECS", "TMPL_B"],
84
- ],
85
- ),
86
- pd.DataFrame(
87
- columns=[
88
- "DATE",
89
- "REAL",
90
- "WSTAT:WELL1",
91
- "WSTAT:WELL2",
92
- "WSTAT:WELL3",
93
- "WSTAT:WELL4",
94
- ],
95
- data=[
96
- [datetime.date(2000, 1, 1), 0, 1, 2, 1, 0],
97
- [datetime.date(2000, 2, 1), 0, 1, 2, 2, 0],
98
- ],
99
- ),
100
- pd.DataFrame(
101
- columns=[
102
- "DATE",
103
- "CHILD",
104
- "KEYWORD",
105
- "PARENT",
106
- "IS_PROD",
107
- "IS_INJ",
108
- "IS_OTHER",
109
- ],
110
- data=[
111
- ["2000-01-01", "FIELD", "GRUPTREE", None, True, True, True],
112
- ["2000-01-01", "TMPL_A", "GRUPTREE", "FIELD", True, True, False],
113
- ["2000-01-01", "TMPL_B", "GRUPTREE", "FIELD", False, False, True],
114
- ["2000-01-01", "WELL1", "WELSPECS", "TMPL_A", True, False, False],
115
- ["2000-01-01", "WELL2", "WELSPECS", "TMPL_A", False, True, False],
116
- ["2000-01-01", "WELL3", "WELSPECS", "TMPL_A", True, True, False],
117
- ["2000-01-01", "WELL4", "WELSPECS", "TMPL_B", False, False, True],
118
- ],
119
- ),
120
- ),
121
- ]
122
-
123
-
124
- @pytest.fixture(
125
- name="testdata",
126
- params=ADD_NODETYPE_CASES,
127
- )
128
- def fixture_provider(
129
- request: SubRequest, tmp_path: Path
130
- ) -> Tuple[pd.DataFrame, EnsembleSummaryProvider, pd.DataFrame]:
131
- input_py = request.param
132
- storage_dir = tmp_path
133
- gruptree_df = input_py[0]
134
- smry_df = input_py[1]
135
- expected_df = input_py[2]
136
-
137
- ProviderImplArrowPresampled.write_backing_store_from_ensemble_dataframe(
138
- storage_dir, "dummy_key", smry_df
139
- )
140
- new_provider = ProviderImplArrowPresampled.from_backing_store(
141
- storage_dir, "dummy_key"
142
- )
143
-
144
- if not new_provider:
145
- raise ValueError("Failed to create EnsembleSummaryProvider")
146
-
147
- return gruptree_df, new_provider, expected_df
148
-
149
-
150
- def test_add_nodetype(
151
- testdata: Tuple[pd.DataFrame, EnsembleSummaryProvider, pd.DataFrame]
152
- ) -> None:
153
- """Test functionality for the add_nodetype function"""
154
- gruptree_df = testdata[0]
155
- provider = testdata[1]
156
- expected_df = testdata[2]
157
-
158
- columns_to_check = [
159
- "DATE",
160
- "CHILD",
161
- "KEYWORD",
162
- "PARENT",
163
- "IS_PROD",
164
- "IS_INJ",
165
- "IS_OTHER",
166
- ]
167
-
168
- wells: List[str] = gruptree_df[gruptree_df["KEYWORD"] == "WELSPECS"][
169
- "CHILD"
170
- ].unique()
171
-
172
- output = add_nodetype(gruptree_df, provider, wells, "FIELD")
173
- pd.testing.assert_frame_equal(
174
- output[columns_to_check], expected_df[columns_to_check]
175
- )
@@ -1,60 +0,0 @@
1
- from typing import List, Optional, Sequence
2
-
3
- import pandas as pd
4
-
5
- from webviz_subsurface._providers import Frequency
6
-
7
- from ....mocks.ensemble_summary_provider_dummy import EnsembleSummaryProviderDummy
8
-
9
-
10
- class EnsembleSummaryProviderMock(EnsembleSummaryProviderDummy):
11
- """Mock implementation of EnsembleSummaryProvider for testing derived
12
- ensemble vectors accessor.
13
-
14
- Implements necessary methods for obtaining wanted test data
15
- """
16
-
17
- def __init__(self, df: pd.DataFrame) -> None:
18
- super().__init__()
19
- self._df = df
20
- self._vectors: List[str] = [
21
- elm for elm in df.columns if elm not in ["DATE", "REAL"]
22
- ]
23
- self._realizations: List[int] = list(df["REAL"]) if "REAL" in df.columns else []
24
-
25
- #####################################
26
- #
27
- # Override methods
28
- #
29
- #####################################
30
- def supports_resampling(self) -> bool:
31
- return False
32
-
33
- def realizations(self) -> List[int]:
34
- return self._realizations
35
-
36
- def vector_names(self) -> List[str]:
37
- return self._vectors
38
-
39
- def get_vectors_df(
40
- self,
41
- vector_names: Sequence[str],
42
- __resampling_frequency: Optional[Frequency],
43
- realizations: Optional[Sequence[int]] = None,
44
- ) -> pd.DataFrame:
45
- for elm in vector_names:
46
- if elm not in self._vectors:
47
- raise ValueError(
48
- f'Requested vector "{elm}" not among provider vectors!'
49
- )
50
- if realizations:
51
- # Note: Reset index as providers reset index counter when filtering
52
- # realization query.
53
- output = (
54
- self._df[["DATE", "REAL"] + list(vector_names)]
55
- .loc[self._df["REAL"].isin(realizations)]
56
- .reset_index()
57
- )
58
- output.drop("index", inplace=True, axis=1)
59
- return output
60
- return self._df[["DATE", "REAL"] + list(vector_names)]