webviz-subsurface 0.2.43__py3-none-any.whl → 0.2.44__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.
@@ -69,7 +69,7 @@ def read_zone_layer_mapping(
69
69
  )
70
70
  df_real["K1"] = df_real.index
71
71
  df_real["REAL"] = real
72
- zonelist = remove_invalid_colors(zonelist)
72
+ zonelist = remove_invalid_colors(zonelist) if zonelist else []
73
73
  zone_color_mapping = {
74
74
  zonedict["name"]: zonedict["color"]
75
75
  for zonedict in zonelist
@@ -191,16 +191,13 @@ GruptreeDataModel({self._ens_name!r}, {self._ens_path!r}, {self._gruptree_file!r
191
191
  raise ValueError(
192
192
  f"Keyword {self._tree_type.value} not found in {row['FULLPATH']}"
193
193
  )
194
+
195
+ # Only filter if both tree types are present
194
196
  if (
195
- self._tree_type == TreeType.GRUPTREE
197
+ TreeType.GRUPTREE.value in unique_keywords
196
198
  and TreeType.BRANPROP.value in unique_keywords
197
199
  ):
198
- # Filter out BRANPROP entries
199
- df_real = df_real[df_real["KEYWORD"] != TreeType.BRANPROP.value]
200
-
201
- if self._tree_type == TreeType.BRANPROP:
202
- # Filter out GRUPTREE entries
203
- df_real = df_real[df_real["KEYWORD"] != TreeType.GRUPTREE.value]
200
+ df_real = self._filter_by_tree_type(df_real, self._tree_type)
204
201
 
205
202
  if (
206
203
  i > 0
@@ -222,3 +219,30 @@ GruptreeDataModel({self._ens_name!r}, {self._ens_path!r}, {self._gruptree_file!r
222
219
  df["DATE"] = pd.to_datetime(df["DATE"])
223
220
 
224
221
  return df.where(pd.notnull(df), None)
222
+
223
+ @staticmethod
224
+ def _filter_by_tree_type(df: pd.DataFrame, tree_type: TreeType) -> pd.DataFrame:
225
+ """
226
+ Filter dataframe to include only dates where the selected tree type is defined,
227
+ and only include WELSPECS nodes that belong to the selected tree type.
228
+
229
+ A WELSPECS node belongs to a tree if its parent node exists in that tree's definition.
230
+ """
231
+ # Find dates where the selected tree type is defined
232
+ dates_with_tree_type = df[df["KEYWORD"] == tree_type.value]["DATE"].unique()
233
+
234
+ # Filter to only include rows from those dates
235
+ df = df[df["DATE"].isin(dates_with_tree_type)].copy()
236
+
237
+ # Get all nodes that are defined in the selected tree type (across all dates)
238
+ tree_nodes = set(df[df["KEYWORD"] == tree_type.value]["CHILD"].unique())
239
+
240
+ # Keep rows that are:
241
+ # 1. The selected tree type itself (GRUPTREE or BRANPROP)
242
+ # 2. WELSPECS whose parent exists in the selected tree type
243
+ is_selected_tree = df["KEYWORD"] == tree_type.value
244
+ is_welspecs_with_valid_parent = (df["KEYWORD"] == "WELSPECS") & df[
245
+ "PARENT"
246
+ ].isin(tree_nodes)
247
+
248
+ return df[is_selected_tree | is_welspecs_with_valid_parent].copy()
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.2.43'
32
- __version_tuple__ = version_tuple = (0, 2, 43)
31
+ __version__ = version = '0.2.44'
32
+ __version_tuple__ = version_tuple = (0, 2, 44)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -357,5 +357,7 @@ class EnsembleSubplotBuilder(GraphFigureBuilderBase):
357
357
  missing = vectors - set(self._selected_vectors)
358
358
  if missing:
359
359
  raise ValueError(
360
- f"Unexpected vectors found: {missing}. Does not exist among selected vectors: {self._selected_vectors}"
360
+ f"Unexpected vectors found: {missing}."
361
+ f" Does not exist among selected vectors: "
362
+ f"{self._selected_vectors}"
361
363
  )
@@ -241,7 +241,7 @@ def _read_vfp_arrow(filename: str) -> io.BytesIO:
241
241
  source = pa.memory_map(filename, "r")
242
242
  reader = pa.ipc.RecordBatchFileReader(source)
243
243
  pa_table = reader.read_all()
244
- vfp_dict = pyarrow2basic_data(pa_table)
244
+ vfp_dict = pyarrow2basic_data(pa_table) or {}
245
245
 
246
246
  for key, _ in vfp_dict.items():
247
247
  # Convert types to strings
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webviz-subsurface
3
- Version: 0.2.43
3
+ Version: 0.2.44
4
4
  Summary: Webviz config plugins for subsurface data
5
5
  Author: R&T Equinor
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,5 +1,5 @@
1
1
  webviz_subsurface/__init__.py,sha256=XUL8THCPZObkUsxDodKtE_wx-pYmQ4sATXgx5sdYa-A,3824
2
- webviz_subsurface/_version.py,sha256=gGfD04M45bLDbLxKefFz8XrPC5GvdOYOo_ZY_ExXwEg,706
2
+ webviz_subsurface/_version.py,sha256=UE3tuzn9Nb3J7PpIZg2XMsX6cuf1-nUKcp_XLyKP04s,706
3
3
  webviz_subsurface/smry2arrow_batch.py,sha256=zTekRSgkUei6_DGT1ZWibd22PrFkkTQ_pnjZYvzMOL4,4129
4
4
  webviz_subsurface/_abbreviations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  webviz_subsurface/_abbreviations/number_formatting.py,sha256=zElrkv3j3H6i7nbeeyKG1oE6VfNtzfrSJQYrC08Bev0,3479
@@ -36,7 +36,7 @@ webviz_subsurface/_datainput/seismic.py,sha256=7alyU9dezKgrSqiGI1R405hh5ymPDf5Cb
36
36
  webviz_subsurface/_datainput/surface.py,sha256=fxrV65AJBw1dbIyJtnfknk7DriqpotF2oi7ZDNQBheE,348
37
37
  webviz_subsurface/_datainput/units.py,sha256=xBtouLCXa4ZzNSCTjmTRfsHS3GluwTHIBh9SpzxAksA,15902
38
38
  webviz_subsurface/_datainput/well.py,sha256=9_Hi66TMqy4tkwYXugYV_lSyZFQ9SY5rQZvkpPxxnp8,6916
39
- webviz_subsurface/_datainput/well_completions.py,sha256=ckZug0bwoJmIBZC-h8ADnw2Ss68oKj4-DezCbDuPCr0,6269
39
+ webviz_subsurface/_datainput/well_completions.py,sha256=f_VPGoaarXBuJ7Pwjf8RTY-mJHxL21fJgbzvYVQT3VA,6289
40
40
  webviz_subsurface/_datainput/xsection.py,sha256=X3B88ufAANzKOeHelVGIulj3cwRgMMrl6lbAq90QD4U,19126
41
41
  webviz_subsurface/_datainput/eclipse_init_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  webviz_subsurface/_datainput/eclipse_init_io/pvt_common.py,sha256=iH94cMbifEJjGC7Pj4HA8kYMPH4uXLoIlXtWy2oKo7E,30857
@@ -52,7 +52,7 @@ webviz_subsurface/_models/__init__.py,sha256=N2vfEx6bChJu9w_Vax_FslPBhNxbdWBqL6V
52
52
  webviz_subsurface/_models/caching_ensemble_set_model_factory.py,sha256=Jt7lCEpPPBhLB36V-QRyc2cvp2hF85zmiXODqKTza_I,1201
53
53
  webviz_subsurface/_models/ensemble_model.py,sha256=qic5LtPHeWRG3yzITvAihkiIxDZOuKYUFLbzc9peQcM,6288
54
54
  webviz_subsurface/_models/ensemble_set_model.py,sha256=elS5eLpktTJeeSU_44hL9SBHufDQB3SyBllUJZzdSKM,4231
55
- webviz_subsurface/_models/gruptree_model.py,sha256=TkPBTre3Srs7n2SJSVGbj6oWAUEaJJ811XTxCIcHjPQ,8369
55
+ webviz_subsurface/_models/gruptree_model.py,sha256=yrYW-6FwCSJ4ClwJjqP3UeWV7ka6LcPza-Qyfp-O3Qw,9439
56
56
  webviz_subsurface/_models/inplace_volumes_model.py,sha256=AxVJzEeYgDgKfbP6ePpxqwX9I1ybVpho9PSzpzfWzEY,15877
57
57
  webviz_subsurface/_models/observation_model.py,sha256=Z9wO6KfO6FcJ99x8kq1Y2m_2bCsAiWexYjhVoJkqxAY,1629
58
58
  webviz_subsurface/_models/parameter_model.py,sha256=IZOQvEM0zjzFQUsW0MzYfbo8kRVqZNJxzbe_uDW-GJE,7284
@@ -377,7 +377,7 @@ webviz_subsurface/plugins/_simulation_time_series/_views/__init__.py,sha256=47DE
377
377
  webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/__init__.py,sha256=Yt6Piyp2IkXxdlj-alqIKd6TFZjpmOWqSwjnuQxZSmI,31
378
378
  webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_view.py,sha256=HeWZyFM77MSdHCDUhWwXORidxjlqhkD_9u9CVniRdX0,42176
379
379
  webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_property_serialization/__init__.py,sha256=E6_uX-47qAv2qVvtue08xhv4uDhZLLImH4s3WsE-ssw,180
380
- webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_property_serialization/ensemble_subplot_builder.py,sha256=kPInKLVH7i9LoWw0dTB0xaK_etlZA4Jp57JjL_oNcTM,14232
380
+ webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_property_serialization/ensemble_subplot_builder.py,sha256=yrd96RMk2kJlM5CdzQkiazEzXEgDoTglR8_LfOTDMpY,14272
381
381
  webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_property_serialization/graph_figure_builder_base.py,sha256=Ys9_XDUR0fQ-rR_LGEGW8jgp-DGwukec21Mj6VJHchw,5732
382
382
  webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_property_serialization/vector_subplot_builder.py,sha256=d7phNUn2ILx6_3TwfBsL2_1ossTi4-Lfcj_5IXjKXA8,14980
383
383
  webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_settings/__init__.py,sha256=hDqljNMPXr18Dir-7aBnXAiCPlyHB9jLtytq8kAWXT4,298
@@ -471,7 +471,7 @@ webviz_subsurface/plugins/_vfp_analysis/__init__.py,sha256=CF23TDvv2GOK1yhW-gBvU
471
471
  webviz_subsurface/plugins/_vfp_analysis/_plugin.py,sha256=Ni2GxLCFQFpD7VcqWQzy1Oa7sOm45VuLbnM81bYUrBY,1690
472
472
  webviz_subsurface/plugins/_vfp_analysis/_types.py,sha256=t2yKFHT7Y0UL6HJ3Zv0tHdHPtZRRuXo3mUM_YLoqrJU,210
473
473
  webviz_subsurface/plugins/_vfp_analysis/_utils/__init__.py,sha256=2CzWadhrnNQGdrpGSUrvqoTCMYvp3YnXvLPWB-egk8k,52
474
- webviz_subsurface/plugins/_vfp_analysis/_utils/_vfp_data_model.py,sha256=l1F9jlH9ESmXM877fqgrst7A4BPXBpbP1E5e72llXPI,9658
474
+ webviz_subsurface/plugins/_vfp_analysis/_utils/_vfp_data_model.py,sha256=b9w_E4QsEaNyxQgkhq0UZx0i8YpVH7dM3dyEwfbCZVI,9664
475
475
  webviz_subsurface/plugins/_vfp_analysis/_views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
476
476
  webviz_subsurface/plugins/_vfp_analysis/_views/_vfp_view/__init__.py,sha256=S6q3vFDQe98gEuO0Ku1PPjSj_He1GVz6hbuTaPalcZQ,27
477
477
  webviz_subsurface/plugins/_vfp_analysis/_views/_vfp_view/_view.py,sha256=qHkiQMfZDwkUKchM2G1sJVUgKqERCUIujCj-ly-aY1c,10035
@@ -550,10 +550,10 @@ webviz_subsurface/plugins/_well_log_viewer/controllers/_well_controller.py,sha25
550
550
  webviz_subsurface/plugins/_well_log_viewer/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
551
551
  webviz_subsurface/plugins/_well_log_viewer/utils/default_color_tables.py,sha256=0UgrvygPGEAuC15vn73NCXJUQLt9Dpn5QZqqq1IJkfw,4872
552
552
  webviz_subsurface/plugins/_well_log_viewer/utils/xtgeo_well_log_to_json.py,sha256=T44-vFwvvjyo376yoL1QWDc98exG8N1cLTEzrGp-I7A,1608
553
- webviz_subsurface-0.2.43.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
554
- webviz_subsurface-0.2.43.dist-info/licenses/LICENSE.chromedriver,sha256=H5UWVvf6Y7Ul6i35mriz7071dWR01cR9G-5ypnZHnpM,326542
555
- webviz_subsurface-0.2.43.dist-info/METADATA,sha256=qnrO7JsE6b0T_R4AVoeQJry37uayjpE61igtRKkEFoQ,46825
556
- webviz_subsurface-0.2.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
557
- webviz_subsurface-0.2.43.dist-info/entry_points.txt,sha256=Xdu_x9E_hJBueKfSYBFAAVFzKeUrenikc8lydm9C-6A,4135
558
- webviz_subsurface-0.2.43.dist-info/top_level.txt,sha256=ivY5svyqFD5YI8wdJHATxBrkxfcdU2Q6fDh5E_tDrl4,18
559
- webviz_subsurface-0.2.43.dist-info/RECORD,,
553
+ webviz_subsurface-0.2.44.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
554
+ webviz_subsurface-0.2.44.dist-info/licenses/LICENSE.chromedriver,sha256=H5UWVvf6Y7Ul6i35mriz7071dWR01cR9G-5ypnZHnpM,326542
555
+ webviz_subsurface-0.2.44.dist-info/METADATA,sha256=J393mypYv94qKzP6E7dUrWuusDylgi5wBjVu7cFdO5w,46825
556
+ webviz_subsurface-0.2.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
557
+ webviz_subsurface-0.2.44.dist-info/entry_points.txt,sha256=Xdu_x9E_hJBueKfSYBFAAVFzKeUrenikc8lydm9C-6A,4135
558
+ webviz_subsurface-0.2.44.dist-info/top_level.txt,sha256=ivY5svyqFD5YI8wdJHATxBrkxfcdU2Q6fDh5E_tDrl4,18
559
+ webviz_subsurface-0.2.44.dist-info/RECORD,,