fmu-sumo 2.9.0__tar.gz → 2.11.0__tar.gz

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 (63) hide show
  1. {fmu_sumo-2.9.0/src/fmu_sumo.egg-info → fmu_sumo-2.11.0}/PKG-INFO +1 -1
  2. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/_version.py +3 -3
  3. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/filters.py +1 -1
  4. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/_child.py +3 -9
  5. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/_search_context.py +12 -17
  6. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/case.py +18 -18
  7. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/cpgrid.py +1 -1
  8. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/cpgrid_property.py +1 -1
  9. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/realization.py +8 -8
  10. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0/src/fmu_sumo.egg-info}/PKG-INFO +1 -1
  11. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/tests/test_explorer.py +9 -9
  12. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.github/pull_request_template.md +0 -0
  13. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.github/workflows/build_docs.yaml +0 -0
  14. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.github/workflows/check_formatting.yml +0 -0
  15. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.github/workflows/publish_release.yaml +0 -0
  16. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.github/workflows/run_tests.yaml +0 -0
  17. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.gitignore +0 -0
  18. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.pre-commit-config.yaml +0 -0
  19. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/.readthedocs.yml +0 -0
  20. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/CONTRIBUTING.md +0 -0
  21. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/LICENSE +0 -0
  22. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/README.md +0 -0
  23. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/SECURITY.md +0 -0
  24. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/_static/equinor-logo.png +0 -0
  25. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/_static/equinor-logo2.jpg +0 -0
  26. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/_static/equinor_logo.jpg +0 -0
  27. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/_static/equinor_logo_only.jpg +0 -0
  28. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/_templates/layout.html +0 -0
  29. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/conf.py +0 -0
  30. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/explorer.rst +0 -0
  31. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/docs/index.rst +0 -0
  32. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/examples/explorer.ipynb +0 -0
  33. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/examples/explorer2.ipynb +0 -0
  34. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/examples/grids-and-properties.ipynb +0 -0
  35. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/examples/metrics.ipynb +0 -0
  36. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/examples/table-aggregation.ipynb +0 -0
  37. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/pyproject.toml +0 -0
  38. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/setup.cfg +0 -0
  39. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/__init__.py +0 -0
  40. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/__init__.py +0 -0
  41. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/__init__.py +0 -0
  42. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/cache.py +0 -0
  43. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/explorer.py +0 -0
  44. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/__init__.py +0 -0
  45. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/_document.py +0 -0
  46. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/_metrics.py +0 -0
  47. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/cases.py +0 -0
  48. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/cube.py +0 -0
  49. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/dictionary.py +0 -0
  50. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/ensemble.py +0 -0
  51. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/ensembles.py +0 -0
  52. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/polygons.py +0 -0
  53. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/realizations.py +0 -0
  54. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/surface.py +0 -0
  55. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/objects/table.py +0 -0
  56. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu/sumo/explorer/timefilter.py +0 -0
  57. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu_sumo.egg-info/SOURCES.txt +0 -0
  58. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu_sumo.egg-info/dependency_links.txt +0 -0
  59. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu_sumo.egg-info/requires.txt +0 -0
  60. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/src/fmu_sumo.egg-info/top_level.txt +0 -0
  61. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/tests/conftest.py +0 -0
  62. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/tests/context.py +0 -0
  63. {fmu_sumo-2.9.0 → fmu_sumo-2.11.0}/tests/test_objects_table.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-sumo
3
- Version: 2.9.0
3
+ Version: 2.11.0
4
4
  Summary: Python package for interacting with Sumo in an FMU setting
5
5
  Author: Equinor
6
6
  License: Apache License
@@ -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 = '2.9.0'
32
- __version_tuple__ = version_tuple = (2, 9, 0)
31
+ __version__ = version = '2.11.0'
32
+ __version_tuple__ = version_tuple = (2, 11, 0)
33
33
 
34
- __commit_id__ = commit_id = 'gbcff66149'
34
+ __commit_id__ = commit_id = 'gb7f4183e8'
@@ -22,7 +22,7 @@ class Filters:
22
22
  observations = {
23
23
  "bool": {
24
24
  "must_not": [
25
- {"exists": {"field": "fmu.iteration.name.keyword"}},
25
+ {"exists": {"field": "fmu.ensemble.name.keyword"}},
26
26
  {"exists": {"field": "fmu.realization.id"}},
27
27
  ]
28
28
  }
@@ -33,7 +33,7 @@ class Child(Document):
33
33
  return (
34
34
  f"<{self.__class__.__name__}: {self.name} {self.uuid}(uuid) "
35
35
  f"in realization {self.realization} "
36
- f"in iteration {self.iteration} "
36
+ f"in ensemble {self.ensemble} "
37
37
  f"in case {self.casename} "
38
38
  f"in asset {self.asset}>"
39
39
  )
@@ -41,7 +41,7 @@ class Child(Document):
41
41
  return (
42
42
  f"<{self.__class__.__name__}: {self.name} {self.uuid}(uuid) "
43
43
  f"in operation {self.operationname} "
44
- f"in iteration {self.iteration} "
44
+ f"in ensemble {self.ensemble} "
45
45
  f"in case {self.casename} "
46
46
  f"in asset {self.asset}>"
47
47
  )
@@ -94,8 +94,7 @@ class Child(Document):
94
94
  @property
95
95
  def template_path(self) -> str:
96
96
  return "/".join(
97
- ["{realization}", "{iteration}"]
98
- + self.relative_path.split("/")[2:]
97
+ ["{realization}", "{ensemble}"] + self.relative_path.split("/")[2:]
99
98
  )
100
99
 
101
100
  @property
@@ -138,11 +137,6 @@ class Child(Document):
138
137
  """Object realization"""
139
138
  return self.get_property("fmu.realization.id")
140
139
 
141
- @property
142
- def iteration(self) -> str:
143
- """Object iteration"""
144
- return self.get_property("fmu.iteration.name")
145
-
146
140
  @property
147
141
  def ensemble(self) -> str:
148
142
  """Object ensemble"""
@@ -64,19 +64,16 @@ def _gen_filter_gen(attr):
64
64
  def _gen_filter_stage(attr):
65
65
  """Match property against either single value or list of values.
66
66
  If the value given is a boolean, tests for existence or not of the property.
67
- In addition, if the value is or includes either "iteration" or "ensemble",
68
- expand to include both values.
67
+ In addition, if the value is or includes "ensemble" expand to include it.
69
68
  """
70
69
 
71
70
  _inner = _gen_filter_gen(attr)
72
71
 
73
72
  def _fn(value):
74
- if value == "iteration" or value == "ensemble":
75
- return _inner(["iteration", "ensemble"])
76
- elif isinstance(value, list) and set(value).intersection(
77
- {"iteration", "ensemble"}
78
- ):
79
- return _inner(list(set(value).union({"iteration", "ensemble"})))
73
+ if value == "ensemble":
74
+ return _inner(["ensemble"])
75
+ elif isinstance(value, list) and set(value).intersection({"ensemble"}):
76
+ return _inner(list(set(value).union({"ensemble"})))
80
77
  else:
81
78
  return _inner(value)
82
79
 
@@ -156,10 +153,6 @@ _filterspec = {
156
153
  "relative_path": [_gen_filter_gen, "file.relative_path.keyword"],
157
154
  "tagname": [_gen_filter_gen, "data.tagname.keyword"],
158
155
  "dataformat": [_gen_filter_gen, "data.format.keyword"],
159
- "iteration": [
160
- _gen_filter_gen,
161
- "fmu.iteration.name.keyword",
162
- ], # FIXME: to be removed
163
156
  "ensemble": [_gen_filter_gen, "fmu.ensemble.name.keyword"],
164
157
  "realization": [_gen_filter_gen, "fmu.realization.id"],
165
158
  "aggregation": [_gen_filter_gen, "fmu.aggregation.operation.keyword"],
@@ -1285,8 +1278,8 @@ class SearchContext:
1285
1278
  "must": [
1286
1279
  {"term": {"class.keyword": "dictionary"}},
1287
1280
  {
1288
- "exists": {
1289
- "field": "fmu.realization.id"
1281
+ "term": {
1282
+ "fmu.context.stage.keyword": "realization"
1290
1283
  }
1291
1284
  },
1292
1285
  ]
@@ -1297,8 +1290,11 @@ class SearchContext:
1297
1290
  "must": [
1298
1291
  {"term": {"class.keyword": "table"}},
1299
1292
  {
1300
- "exists": {
1301
- "field": "fmu.aggregation.operation"
1293
+ "terms": {
1294
+ "fmu.context.stage.keyword": [
1295
+ "ensemble",
1296
+ "iteration",
1297
+ ]
1302
1298
  }
1303
1299
  },
1304
1300
  ]
@@ -1550,7 +1546,6 @@ class SearchContext:
1550
1546
  "class": classname,
1551
1547
  "entity_uuid": entityuuid,
1552
1548
  "ensemble_name": ensemblename,
1553
- "iteration_name": ensemblename,
1554
1549
  "operations": [operation],
1555
1550
  }
1556
1551
  if columns is not None:
@@ -12,19 +12,19 @@ def _make_overview_query(id) -> Dict:
12
12
  return {
13
13
  "query": {"term": {"fmu.case.uuid.keyword": id}},
14
14
  "aggs": {
15
- "iteration_uuids": {
16
- "terms": {"field": "fmu.iteration.uuid.keyword", "size": 100}
15
+ "ensemble_uuids": {
16
+ "terms": {"field": "fmu.ensemble.uuid.keyword", "size": 100}
17
17
  },
18
- "iteration_names": {
19
- "terms": {"field": "fmu.iteration.name.keyword", "size": 100}
18
+ "ensemble_names": {
19
+ "terms": {"field": "fmu.ensemble.name.keyword", "size": 100}
20
20
  },
21
21
  "data_types": {"terms": {"field": "class.keyword", "size": 100}},
22
- "iterations": {
23
- "terms": {"field": "fmu.iteration.uuid.keyword", "size": 100},
22
+ "ensembles": {
23
+ "terms": {"field": "fmu.ensemble.uuid.keyword", "size": 100},
24
24
  "aggs": {
25
- "iteration_name": {
25
+ "ensemble_name": {
26
26
  "terms": {
27
- "field": "fmu.iteration.name.keyword",
27
+ "field": "fmu.ensemble.name.keyword",
28
28
  "size": 100,
29
29
  }
30
30
  },
@@ -49,7 +49,7 @@ class Case(Document, SearchContext):
49
49
  self, sumo, must=[{"term": {"fmu.case.uuid.keyword": self.uuid}}]
50
50
  )
51
51
  self._overview = None
52
- self._iterations = None
52
+ self._ensembles = None
53
53
 
54
54
  @property
55
55
  def overview(self) -> Dict:
@@ -63,27 +63,27 @@ class Case(Document, SearchContext):
63
63
  res = self._sumo.post("/search", json=query)
64
64
  data = res.json()
65
65
  aggs = data["aggregations"]
66
- iteration_names = extract_bucket_keys(aggs, "iteration_names")
67
- iteration_uuids = extract_bucket_keys(aggs, "iteration_uuids")
66
+ ensemble_names = extract_bucket_keys(aggs, "ensemble_names")
67
+ ensemble_uuids = extract_bucket_keys(aggs, "ensemble_uuids")
68
68
  data_types = extract_bucket_keys(aggs, "data_types")
69
- iterations = {}
70
- for bucket in aggs["iterations"]["buckets"]:
69
+ ensembles = {}
70
+ for bucket in aggs["ensembles"]["buckets"]:
71
71
  iterid = bucket["key"]
72
- itername = extract_bucket_keys(bucket, "iteration_name")
72
+ itername = extract_bucket_keys(bucket, "ensemble_name")
73
73
  minreal = bucket["minreal"]["value"]
74
74
  maxreal = bucket["maxreal"]["value"]
75
75
  numreal = bucket["numreal"]["value"]
76
- iterations[iterid] = {
76
+ ensembles[iterid] = {
77
77
  "name": itername,
78
78
  "minreal": minreal,
79
79
  "maxreal": maxreal,
80
80
  "numreal": numreal,
81
81
  }
82
82
  self._overview = {
83
- "iteration_names": iteration_names,
84
- "iteration_uuids": iteration_uuids,
83
+ "ensemble_names": ensemble_names,
84
+ "ensemble_uuids": ensemble_uuids,
85
85
  "data_types": data_types,
86
- "iterations": iterations,
86
+ "ensembles": ensembles,
87
87
  }
88
88
 
89
89
  return self._overview
@@ -61,7 +61,7 @@ class CPGrid(Child):
61
61
  """
62
62
  sc = SearchContext(self._sumo).grid_properties.filter(
63
63
  uuid=self.caseuuid,
64
- iteration=self.iteration,
64
+ ensemble=self.ensemble,
65
65
  realization=self.realization,
66
66
  )
67
67
  return sc.filter(
@@ -61,7 +61,7 @@ class CPGridProperty(Child):
61
61
  """
62
62
  sc = SearchContext(self._sumo).grids.filter(
63
63
  uuid=self.caseuuid,
64
- iteration=self.iteration,
64
+ ensemble=self.ensemble,
65
65
  realization=self.realization,
66
66
  )
67
67
  should = [
@@ -26,7 +26,7 @@ class Realization(Document, SearchContext):
26
26
  def __str__(self):
27
27
  return (
28
28
  f"<{self.__class__.__name__}: {self.realizationid} {self.uuid}(uuid) "
29
- f"in iteration {self.iterationname} "
29
+ f"in ensemble {self.ensemblename} "
30
30
  f"in case {self.casename} "
31
31
  f"in asset {self.asset}>"
32
32
  )
@@ -46,7 +46,7 @@ class Realization(Document, SearchContext):
46
46
 
47
47
  @property
48
48
  def user(self) -> str:
49
- """Name of user who uploaded iteration."""
49
+ """Name of user who uploaded ensemble."""
50
50
  return self.get_property("fmu.case.user.id")
51
51
 
52
52
  @property
@@ -60,14 +60,14 @@ class Realization(Document, SearchContext):
60
60
  return self.get_property("fmu.case.name")
61
61
 
62
62
  @property
63
- def iterationuuid(self) -> str:
64
- """FMU iteration uuid"""
65
- return self.get_property("fmu.iteration.uuid")
63
+ def ensembleuuid(self) -> str:
64
+ """FMU ensemble uuid"""
65
+ return self.get_property("fmu.ensemble.uuid")
66
66
 
67
67
  @property
68
- def iterationname(self) -> str:
69
- """FMU iteration name"""
70
- return self.get_property("fmu.iteration.name")
68
+ def ensemblename(self) -> str:
69
+ """FMU ensemble name"""
70
+ return self.get_property("fmu.ensemble.name")
71
71
 
72
72
  @property
73
73
  def realizationuuid(self) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-sumo
3
- Version: 2.9.0
3
+ Version: 2.11.0
4
4
  Summary: Python package for interacting with Sumo in an FMU setting
5
5
  Author: Equinor
6
6
  License: Apache License
@@ -213,13 +213,13 @@ def test_case_surfaces_filter(test_case: Case):
213
213
  real_surfs = test_case.surfaces.filter(realization=True)
214
214
  assert len(real_surfs) == 212
215
215
 
216
- # filter on iteration
217
- real_surfs = real_surfs.filter(iteration="iter-0")
216
+ # filter on ensemble
217
+ real_surfs = real_surfs.filter(ensemble="iter-0")
218
218
  assert len(real_surfs) == 212
219
219
 
220
220
  # for surf in real_surfs:
221
- # assert surf.iteration == "iter-0"
222
- its = real_surfs.get_field_values("fmu.iteration.name.keyword")
221
+ # assert surf.ensemble == "iter-0"
222
+ its = real_surfs.get_field_values("fmu.ensemble.name.keyword")
223
223
  assert len(its) == 1 and its[0] == "iter-0"
224
224
 
225
225
  # filter on name
@@ -230,9 +230,9 @@ def test_case_surfaces_filter(test_case: Case):
230
230
  assert len(real_surfs) == 56
231
231
 
232
232
  # for surf in real_surfs:
233
- # assert surf.iteration == "iter-0"
233
+ # assert surf.ensemble == "iter-0"
234
234
  # assert surf.name == "Valysar Fm."
235
- its = real_surfs.get_field_values("fmu.iteration.name.keyword")
235
+ its = real_surfs.get_field_values("fmu.ensemble.name.keyword")
236
236
  assert len(its) == 1 and its[0] == "iter-0"
237
237
  names = real_surfs.get_field_values("data.name.keyword")
238
238
  assert len(names) == 1 and names[0] == "Valysar Fm."
@@ -252,10 +252,10 @@ def test_case_surfaces_filter(test_case: Case):
252
252
  assert len(real_surfs) == 4
253
253
 
254
254
  # for surf in real_surfs:
255
- # assert surf.iteration == "iter-0"
255
+ # assert surf.ensemble == "iter-0"
256
256
  # assert surf.name == "Valysar Fm."
257
257
  # assert surf.tagname == "FACIES_Fraction_Channel"
258
- its = real_surfs.get_field_values("fmu.iteration.name.keyword")
258
+ its = real_surfs.get_field_values("fmu.ensemble.name.keyword")
259
259
  assert len(its) == 1 and its[0] == "iter-0"
260
260
  names = real_surfs.get_field_values("data.name.keyword")
261
261
  assert len(names) == 1 and names[0] == "Valysar Fm."
@@ -273,7 +273,7 @@ def test_case_surfaces_filter(test_case: Case):
273
273
  real_surfs = real_surfs.filter(realization=0)
274
274
  assert len(real_surfs) == 1
275
275
 
276
- assert real_surfs[0].iteration == "iter-0"
276
+ assert real_surfs[0].ensemble == "iter-0"
277
277
  assert real_surfs[0].name == "Valysar Fm."
278
278
  assert real_surfs[0].tagname == "FACIES_Fraction_Channel"
279
279
  assert real_surfs[0].realization == 0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes