fmu-sumo 2.3.7__py3-none-any.whl → 2.3.8__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.
@@ -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.8'
21
+ __version_tuple__ = version_tuple = (2, 3, 8)
@@ -1,11 +1,12 @@
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
9
10
 
10
11
 
11
12
  class Explorer(SearchContext):
@@ -25,9 +26,9 @@ class Explorer(SearchContext):
25
26
  def __init__(
26
27
  self,
27
28
  env: str = "prod",
28
- token: str = None,
29
+ token: Optional[str] = None,
29
30
  interactive: bool = True,
30
- keep_alive: str = None,
31
+ keep_alive: Optional[str] = None,
31
32
  http_client=None,
32
33
  async_http_client=None,
33
34
  ):
@@ -58,7 +59,7 @@ class Explorer(SearchContext):
58
59
  def cases(self):
59
60
  return self._context_for_class("case")
60
61
 
61
- def get_permissions(self, asset: str = None):
62
+ def get_permissions(self, asset: Optional[str] = None):
62
63
  """Get permissions
63
64
 
64
65
  Args:
@@ -74,7 +75,7 @@ class Explorer(SearchContext):
74
75
 
75
76
  return res
76
77
 
77
- async def get_permissions_async(self, asset: str = None):
78
+ async def get_permissions_async(self, asset: Optional[str] = None):
78
79
  """Get permissions
79
80
 
80
81
  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 = {
@@ -1,18 +1,19 @@
1
1
  """Sumo cases and child objects"""
2
2
 
3
- from fmu.sumo.explorer.objects._child import Child
4
- from fmu.sumo.explorer.objects._metrics import Metrics
5
- from fmu.sumo.explorer.objects._search_context import SearchContext
6
- from fmu.sumo.explorer.objects.case import Case
7
- from fmu.sumo.explorer.objects.cases import Cases
8
- from fmu.sumo.explorer.objects.cpgrid import CPGrid
9
- from fmu.sumo.explorer.objects.cpgrid_property import CPGridProperty
10
- from fmu.sumo.explorer.objects.cube import Cube
11
- from fmu.sumo.explorer.objects.dictionary import Dictionary
12
- from fmu.sumo.explorer.objects.iteration import Iteration
13
- from fmu.sumo.explorer.objects.iterations import Iterations
14
- from fmu.sumo.explorer.objects.polygons import Polygons
15
- from fmu.sumo.explorer.objects.realization import Realization
16
- from fmu.sumo.explorer.objects.realizations import Realizations
17
- from fmu.sumo.explorer.objects.surface import Surface
18
- from fmu.sumo.explorer.objects.table import Table
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 .iteration import Iteration
14
+ from .iterations import Iterations
15
+ from .polygons import Polygons
16
+ from .realization import Realization
17
+ from .realizations import Realizations
18
+ from .surface import Surface
19
+ 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):
@@ -40,7 +40,7 @@ class Child(Document):
40
40
  return self._blob
41
41
 
42
42
  @property
43
- def timestamp(self) -> str:
43
+ def timestamp(self) -> Union[str, None]:
44
44
  """Object timestmap data"""
45
45
  t0 = self._get_property(["data", "time", "t0", "value"])
46
46
  t1 = self._get_property(["data", "time", "t1", "value"])
@@ -51,7 +51,7 @@ class Child(Document):
51
51
  return None
52
52
 
53
53
  @property
54
- def interval(self) -> str:
54
+ def interval(self) -> Union[str, Tuple[str, str], None]:
55
55
  """Object interval data"""
56
56
  t0 = self._get_property(["data", "time", "t0", "value"])
57
57
  t1 = self._get_property(["data", "time", "t1", "value"])
@@ -62,7 +62,7 @@ class Child(Document):
62
62
  return None
63
63
 
64
64
  @property
65
- def template_path(self):
65
+ def template_path(self) -> str:
66
66
  return "/".join(
67
67
  ["{realization}", "{iteration}"]
68
68
  + self.relative_path.split("/")[2:]
@@ -40,7 +40,11 @@ class Document:
40
40
  curr = self._metadata
41
41
 
42
42
  for key in path:
43
- if (isinstance(curr, list) and key < len(curr)) or key in curr:
43
+ if (
44
+ isinstance(curr, list)
45
+ and isinstance(key, int)
46
+ and key < len(curr)
47
+ ) or key in curr:
44
48
  curr = curr[key]
45
49
  else:
46
50
  return None
@@ -52,3 +56,7 @@ class Document:
52
56
 
53
57
  def __getitem__(self, key: str):
54
58
  return self._metadata[key]
59
+
60
+ @property
61
+ def template_path(self) -> str:
62
+ return ""