fmu-sumo 2.3.7__tar.gz → 2.3.9__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 (84) hide show
  1. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.github/workflows/run_tests.yaml +0 -2
  2. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.gitignore +3 -0
  3. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/PKG-INFO +3 -2
  4. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/_version.py +2 -2
  5. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/explorer.py +9 -6
  6. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/filters.py +5 -0
  7. fmu_sumo-2.3.9/src/fmu/sumo/explorer/objects/__init__.py +21 -0
  8. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/_child.py +42 -5
  9. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/_document.py +27 -1
  10. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/_search_context.py +385 -105
  11. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/case.py +4 -4
  12. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/cases.py +6 -4
  13. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/cpgrid.py +4 -4
  14. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/cpgrid_property.py +2 -2
  15. fmu_sumo-2.3.9/src/fmu/sumo/explorer/objects/cube.py +69 -0
  16. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/dictionary.py +17 -9
  17. fmu_sumo-2.3.9/src/fmu/sumo/explorer/objects/ensemble.py +76 -0
  18. fmu_sumo-2.3.9/src/fmu/sumo/explorer/objects/ensembles.py +81 -0
  19. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/iteration.py +29 -4
  20. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/iterations.py +17 -8
  21. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/polygons.py +1 -1
  22. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/realization.py +30 -4
  23. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/realizations.py +9 -8
  24. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/surface.py +1 -1
  25. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/table.py +1 -1
  26. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/timefilter.py +3 -2
  27. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu_sumo.egg-info/PKG-INFO +3 -2
  28. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu_sumo.egg-info/SOURCES.txt +3 -17
  29. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/tests/test_explorer.py +1 -1
  30. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_affiliate_login.yaml +0 -49
  31. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_manage_login.yaml +0 -49
  32. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_manage_sharedkey.yaml +0 -45
  33. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_read_login.yaml +0 -49
  34. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_read_sharedkey.yaml +0 -45
  35. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_write_login.yaml +0 -49
  36. fmu_sumo-2.3.7/.github/workflows/run_tests_access_drogon_write_sharedkey.yaml +0 -45
  37. fmu_sumo-2.3.7/.github/workflows/run_tests_access_no_access_login.yaml +0 -49
  38. fmu_sumo-2.3.7/src/fmu/sumo/explorer/objects/__init__.py +0 -18
  39. fmu_sumo-2.3.7/src/fmu/sumo/explorer/objects/cube.py +0 -115
  40. fmu_sumo-2.3.7/src/fmu/sumo/explorer/objects/table_aggregated.py +0 -123
  41. fmu_sumo-2.3.7/tests/data/test_case_080/case2.json +0 -64
  42. fmu_sumo-2.3.7/tests/test_access/README.md +0 -114
  43. fmu_sumo-2.3.7/tests/test_access/tst_access_drogon_affiliate_login.py +0 -310
  44. fmu_sumo-2.3.7/tests/test_access/tst_access_drogon_manage_login.py +0 -217
  45. fmu_sumo-2.3.7/tests/test_access/tst_access_drogon_read_login.py +0 -244
  46. fmu_sumo-2.3.7/tests/test_access/tst_access_drogon_write_login.py +0 -217
  47. fmu_sumo-2.3.7/tests/test_access/tst_access_no_access_login.py +0 -210
  48. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.github/pull_request_template.md +0 -0
  49. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.github/workflows/build_docs.yaml +0 -0
  50. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.github/workflows/check_formatting.yml +0 -0
  51. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.github/workflows/publish_release.yaml +0 -0
  52. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.pre-commit-config.yaml +0 -0
  53. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/.readthedocs.yml +0 -0
  54. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/CONTRIBUTING.md +0 -0
  55. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/LICENSE +0 -0
  56. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/README.md +0 -0
  57. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/SECURITY.md +0 -0
  58. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/_static/equinor-logo.png +0 -0
  59. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/_static/equinor-logo2.jpg +0 -0
  60. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/_static/equinor_logo.jpg +0 -0
  61. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/_static/equinor_logo_only.jpg +0 -0
  62. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/_templates/layout.html +0 -0
  63. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/conf.py +0 -0
  64. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/explorer.rst +0 -0
  65. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/docs/index.rst +0 -0
  66. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/examples/explorer.ipynb +0 -0
  67. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/examples/explorer2.ipynb +0 -0
  68. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/examples/grids-and-properties.ipynb +0 -0
  69. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/examples/metrics.ipynb +0 -0
  70. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/examples/table-aggregation.ipynb +0 -0
  71. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/examples/tables.ipynb +0 -0
  72. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/pyproject.toml +0 -0
  73. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/setup.cfg +0 -0
  74. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/__init__.py +0 -0
  75. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/__init__.py +0 -0
  76. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/__init__.py +0 -0
  77. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/cache.py +0 -0
  78. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu/sumo/explorer/objects/_metrics.py +0 -0
  79. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu_sumo.egg-info/dependency_links.txt +0 -0
  80. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu_sumo.egg-info/requires.txt +0 -0
  81. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/src/fmu_sumo.egg-info/top_level.txt +0 -0
  82. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/tests/conftest.py +0 -0
  83. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/tests/context.py +0 -0
  84. {fmu_sumo-2.3.7 → fmu_sumo-2.3.9}/tests/test_objects_table.py +0 -0
@@ -3,8 +3,6 @@ name: Build and test fmu-sumo
3
3
  on:
4
4
  pull_request:
5
5
  branches: [main]
6
- schedule:
7
- - cron: "4 4 * * *"
8
6
  workflow_dispatch:
9
7
 
10
8
  jobs:
@@ -106,3 +106,6 @@ testing.ipynb
106
106
 
107
107
  # emacs backup files
108
108
  *~
109
+
110
+ # Ignore macOS system files
111
+ *.DS_Store
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: fmu-sumo
3
- Version: 2.3.7
3
+ Version: 2.3.9
4
4
  Summary: Python package for interacting with Sumo in an FMU setting
5
5
  Author: Equinor
6
6
  License: Apache License
@@ -235,6 +235,7 @@ Requires-Dist: sphinx-rtd-theme; extra == "docs"
235
235
  Requires-Dist: autoapi; extra == "docs"
236
236
  Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
237
237
  Requires-Dist: sphinxcontrib-apidoc; extra == "docs"
238
+ Dynamic: license-file
238
239
 
239
240
  # fmu-sumo
240
241
 
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.3.7'
21
- __version_tuple__ = version_tuple = (2, 3, 7)
20
+ __version__ = version = '2.3.9'
21
+ __version_tuple__ = version_tuple = (2, 3, 9)
@@ -1,11 +1,13 @@
1
1
  """Module containing class for exploring results from sumo"""
2
2
 
3
3
  import warnings
4
+ from typing import Optional
4
5
 
5
6
  import httpx
6
7
  from sumo.wrapper import SumoClient
7
8
 
8
- from fmu.sumo.explorer.objects._search_context import SearchContext
9
+ from .objects._search_context import SearchContext
10
+ from .objects.cases import Cases
9
11
 
10
12
 
11
13
  class Explorer(SearchContext):
@@ -25,9 +27,9 @@ class Explorer(SearchContext):
25
27
  def __init__(
26
28
  self,
27
29
  env: str = "prod",
28
- token: str = None,
30
+ token: Optional[str] = None,
29
31
  interactive: bool = True,
30
- keep_alive: str = None,
32
+ keep_alive: Optional[str] = None,
31
33
  http_client=None,
32
34
  async_http_client=None,
33
35
  ):
@@ -56,9 +58,10 @@ class Explorer(SearchContext):
56
58
 
57
59
  @property
58
60
  def cases(self):
59
- return self._context_for_class("case")
61
+ uuids = self._context_for_class("case").uuids
62
+ return Cases(self, uuids)
60
63
 
61
- def get_permissions(self, asset: str = None):
64
+ def get_permissions(self, asset: Optional[str] = None):
62
65
  """Get permissions
63
66
 
64
67
  Args:
@@ -74,7 +77,7 @@ class Explorer(SearchContext):
74
77
 
75
78
  return res
76
79
 
77
- async def get_permissions_async(self, asset: str = None):
80
+ async def get_permissions_async(self, asset: Optional[str] = None):
78
81
  """Get permissions
79
82
 
80
83
  Args:
@@ -1,3 +1,8 @@
1
+ """
2
+ Complex(ish) filters for use with fmu-sumo Explorer.
3
+ """
4
+
5
+
1
6
  class Filters:
2
7
  # Filter that matches 4d-seismic objects.
3
8
  seismic4d = {
@@ -0,0 +1,21 @@
1
+ """Sumo cases and child objects"""
2
+
3
+ from ._child import Child
4
+ from ._document import Document
5
+ from ._metrics import Metrics
6
+ from ._search_context import SearchContext
7
+ from .case import Case
8
+ from .cases import Cases
9
+ from .cpgrid import CPGrid
10
+ from .cpgrid_property import CPGridProperty
11
+ from .cube import Cube
12
+ from .dictionary import Dictionary
13
+ from .ensemble import Ensemble
14
+ from .ensembles import Ensembles
15
+ from .iteration import Iteration
16
+ from .iterations import Iterations
17
+ from .polygons import Polygons
18
+ from .realization import Realization
19
+ from .realizations import Realizations
20
+ from .surface import Surface
21
+ from .table import Table
@@ -1,11 +1,11 @@
1
1
  """module containing class for child object"""
2
2
 
3
3
  from io import BytesIO
4
- from typing import Dict, List
4
+ from typing import Dict, List, Tuple, Union
5
5
 
6
6
  from sumo.wrapper import SumoClient
7
7
 
8
- from fmu.sumo.explorer.objects._document import Document
8
+ from ._document import Document
9
9
 
10
10
 
11
11
  class Child(Document):
@@ -21,6 +21,33 @@ class Child(Document):
21
21
  self._sumo = sumo
22
22
  self._blob = blob
23
23
 
24
+ def __repr__(self):
25
+ if self.stage == "case" and self.__class__.__name__ != "Case":
26
+ return (
27
+ f"<{self.__class__.__name__}: {self.name} {self.uuid}(uuid) "
28
+ f"in case {self.casename} "
29
+ f"in asset {self.asset}>"
30
+ )
31
+ else:
32
+ if self.realization:
33
+ return (
34
+ f"<{self.__class__.__name__}: {self.name} {self.uuid}(uuid) "
35
+ f"in realization {self.realization} "
36
+ f"in iteration {self.iteration} "
37
+ f"in case {self.casename} "
38
+ f"in asset {self.asset}>"
39
+ )
40
+ if self.operationname:
41
+ return (
42
+ f"<{self.__class__.__name__}: {self.name} {self.uuid}(uuid) "
43
+ f"in operation {self.operationname} "
44
+ f"in iteration {self.iteration} "
45
+ f"in case {self.casename} "
46
+ f"in asset {self.asset}>"
47
+ )
48
+ else:
49
+ return super().__repr__()
50
+
24
51
  @property
25
52
  def blob(self) -> BytesIO:
26
53
  """Object blob"""
@@ -40,7 +67,7 @@ class Child(Document):
40
67
  return self._blob
41
68
 
42
69
  @property
43
- def timestamp(self) -> str:
70
+ def timestamp(self) -> Union[str, None]:
44
71
  """Object timestmap data"""
45
72
  t0 = self._get_property(["data", "time", "t0", "value"])
46
73
  t1 = self._get_property(["data", "time", "t1", "value"])
@@ -51,7 +78,7 @@ class Child(Document):
51
78
  return None
52
79
 
53
80
  @property
54
- def interval(self) -> str:
81
+ def interval(self) -> Union[str, Tuple[str, str], None]:
55
82
  """Object interval data"""
56
83
  t0 = self._get_property(["data", "time", "t0", "value"])
57
84
  t1 = self._get_property(["data", "time", "t1", "value"])
@@ -62,7 +89,7 @@ class Child(Document):
62
89
  return None
63
90
 
64
91
  @property
65
- def template_path(self):
92
+ def template_path(self) -> str:
66
93
  return "/".join(
67
94
  ["{realization}", "{iteration}"]
68
95
  + self.relative_path.split("/")[2:]
@@ -167,3 +194,13 @@ class Child(Document):
167
194
  def name(self) -> str:
168
195
  """Object data name"""
169
196
  return self.get_property("data.name")
197
+
198
+ @property
199
+ def asset(self) -> str:
200
+ """Object asset name"""
201
+ return self.get_property("access.asset.name")
202
+
203
+ @property
204
+ def operationname(self) -> str:
205
+ """Object aggregation operation name"""
206
+ return self.get_property("fmu.aggregation.operation")
@@ -1,5 +1,6 @@
1
1
  """Contains class for one document"""
2
2
 
3
+ import json
3
4
  import re
4
5
  from typing import Any, Dict, List, Union
5
6
 
@@ -18,6 +19,15 @@ class Document:
18
19
  self._uuid = metadata["_id"]
19
20
  self._metadata = metadata["_source"]
20
21
 
22
+ def __str__(self):
23
+ return f"{json.dumps(self.metadata, indent=4)}"
24
+
25
+ def __repr__(self):
26
+ return (
27
+ f"<{self.__class__.__name__}: {self.name} {self.uuid}(uuid) "
28
+ f"in asset {self.asset}>"
29
+ )
30
+
21
31
  @property
22
32
  def uuid(self):
23
33
  """Return uuid
@@ -40,7 +50,11 @@ class Document:
40
50
  curr = self._metadata
41
51
 
42
52
  for key in path:
43
- if (isinstance(curr, list) and key < len(curr)) or key in curr:
53
+ if (
54
+ isinstance(curr, list)
55
+ and isinstance(key, int)
56
+ and key < len(curr)
57
+ ) or key in curr:
44
58
  curr = curr[key]
45
59
  else:
46
60
  return None
@@ -52,3 +66,15 @@ class Document:
52
66
 
53
67
  def __getitem__(self, key: str):
54
68
  return self._metadata[key]
69
+
70
+ @property
71
+ def template_path(self) -> str:
72
+ return ""
73
+
74
+ @property
75
+ def name(self) -> str:
76
+ return "Should not happen"
77
+
78
+ @property
79
+ def asset(self) -> str:
80
+ return self.get_property("access.asset.name")