fmu-sumo 2.4.4__py3-none-any.whl → 2.4.6__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.
- fmu/sumo/explorer/_version.py +2 -2
- fmu/sumo/explorer/objects/_search_context.py +56 -14
- {fmu_sumo-2.4.4.dist-info → fmu_sumo-2.4.6.dist-info}/METADATA +1 -1
- {fmu_sumo-2.4.4.dist-info → fmu_sumo-2.4.6.dist-info}/RECORD +7 -7
- {fmu_sumo-2.4.4.dist-info → fmu_sumo-2.4.6.dist-info}/WHEEL +0 -0
- {fmu_sumo-2.4.4.dist-info → fmu_sumo-2.4.6.dist-info}/licenses/LICENSE +0 -0
- {fmu_sumo-2.4.4.dist-info → fmu_sumo-2.4.6.dist-info}/top_level.txt +0 -0
fmu/sumo/explorer/_version.py
CHANGED
|
@@ -1162,6 +1162,46 @@ class SearchContext:
|
|
|
1162
1162
|
def grid_properties(self) -> SearchContext:
|
|
1163
1163
|
return self._context_for_class("cpgrid_property")
|
|
1164
1164
|
|
|
1165
|
+
@property
|
|
1166
|
+
def parameters(self) -> SearchContext:
|
|
1167
|
+
return self.filter(
|
|
1168
|
+
complex={
|
|
1169
|
+
"bool": {
|
|
1170
|
+
"must": [
|
|
1171
|
+
{"term": {"data.name.keyword": "parameters"}},
|
|
1172
|
+
{"term": {"data.content.keyword": "parameters"}},
|
|
1173
|
+
],
|
|
1174
|
+
"should": [
|
|
1175
|
+
{
|
|
1176
|
+
"bool": {
|
|
1177
|
+
"must": [
|
|
1178
|
+
{"term": {"class.keyword": "dictionary"}},
|
|
1179
|
+
{
|
|
1180
|
+
"exists": {
|
|
1181
|
+
"field": "fmu.realization.id"
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
]
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"bool": {
|
|
1189
|
+
"must": [
|
|
1190
|
+
{"term": {"class.keyword": "table"}},
|
|
1191
|
+
{
|
|
1192
|
+
"exists": {
|
|
1193
|
+
"field": "fmu.aggregation.operation"
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
]
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
],
|
|
1200
|
+
"minimum_should_match": 1,
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1165
1205
|
def _get_object_by_class_and_uuid(self, cls, uuid) -> Any:
|
|
1166
1206
|
obj = self.get_object(uuid)
|
|
1167
1207
|
if obj.metadata["class"] != cls:
|
|
@@ -1513,7 +1553,11 @@ class SearchContext:
|
|
|
1513
1553
|
if (
|
|
1514
1554
|
("sum_other_doc_count" in v)
|
|
1515
1555
|
and (v["sum_other_doc_count"] > 0)
|
|
1516
|
-
or
|
|
1556
|
+
or (
|
|
1557
|
+
"buckets" in v
|
|
1558
|
+
and len(v["buckets"]) > 0
|
|
1559
|
+
and v["buckets"][0]["doc_count"] != tot_hits
|
|
1560
|
+
)
|
|
1517
1561
|
)
|
|
1518
1562
|
]
|
|
1519
1563
|
if len(conflicts) > 0:
|
|
@@ -1531,11 +1575,9 @@ class SearchContext:
|
|
|
1531
1575
|
def _verify_aggregation_operation(
|
|
1532
1576
|
self, columns, operation
|
|
1533
1577
|
) -> Tuple[str, str, str, str]:
|
|
1534
|
-
assert (
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
and len(columns) == 1
|
|
1538
|
-
), "Exactly one column required for collection aggregation."
|
|
1578
|
+
assert columns is None or len(columns) == 1, (
|
|
1579
|
+
"Exactly one column required for collection aggregation."
|
|
1580
|
+
)
|
|
1539
1581
|
sc = self if columns is None else self.filter(column=columns)
|
|
1540
1582
|
query = sc.__prepare_verify_aggregation_query()
|
|
1541
1583
|
sres = sc._sumo.post("/search", json=query).json()
|
|
@@ -1574,12 +1616,11 @@ class SearchContext:
|
|
|
1574
1616
|
return self._to_sumo(res)
|
|
1575
1617
|
|
|
1576
1618
|
def aggregate(self, columns=None, operation=None) -> objects.Child:
|
|
1577
|
-
|
|
1578
|
-
|
|
1619
|
+
sc = self.filter(realization=True, column=columns)
|
|
1620
|
+
if len(sc.hidden) > 0:
|
|
1621
|
+
return sc.hidden._aggregate(columns=columns, operation=operation)
|
|
1579
1622
|
else:
|
|
1580
|
-
return
|
|
1581
|
-
columns=columns, operation=operation
|
|
1582
|
-
)
|
|
1623
|
+
return sc.visible._aggregate(columns=columns, operation=operation)
|
|
1583
1624
|
|
|
1584
1625
|
async def _verify_aggregation_operation_async(
|
|
1585
1626
|
self, columns, operation
|
|
@@ -1619,13 +1660,14 @@ class SearchContext:
|
|
|
1619
1660
|
async def aggregate_async(
|
|
1620
1661
|
self, columns=None, operation=None
|
|
1621
1662
|
) -> objects.Child:
|
|
1622
|
-
|
|
1663
|
+
sc = self.filter(realization=True, column=columns)
|
|
1664
|
+
length_hidden = await sc.hidden.length_async()
|
|
1623
1665
|
if length_hidden > 0:
|
|
1624
|
-
return await
|
|
1666
|
+
return await sc.hidden._aggregate_async(
|
|
1625
1667
|
columns=columns, operation=operation
|
|
1626
1668
|
)
|
|
1627
1669
|
else:
|
|
1628
|
-
return await
|
|
1670
|
+
return await sc.visible._aggregate_async(
|
|
1629
1671
|
columns=columns, operation=operation
|
|
1630
1672
|
)
|
|
1631
1673
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
fmu/__init__.py,sha256=ftS-xRPSH-vU7fIHlnZQaCTWbNvs4owJivNW65kzsIM,85
|
|
2
2
|
fmu/sumo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
fmu/sumo/explorer/__init__.py,sha256=Bc1wd1lQO3HP3tsVyPbqaesf2boZwGdtookWp8lmG-k,317
|
|
4
|
-
fmu/sumo/explorer/_version.py,sha256=
|
|
4
|
+
fmu/sumo/explorer/_version.py,sha256=A7m3JGqv6GgWxdlAhxGqiDnKOY6QWqyUQuVpQYGKv-s,511
|
|
5
5
|
fmu/sumo/explorer/cache.py,sha256=uvz8TciwBnDEwJIHa9wneC0WVWuzhUqyF3dzk4kvGNk,1037
|
|
6
6
|
fmu/sumo/explorer/explorer.py,sha256=_3nUTO1E_nf6jqpivjgjKcX6rX1fx_mIG76YOM8xb-8,2931
|
|
7
7
|
fmu/sumo/explorer/filters.py,sha256=_t2PmHeTY9XiBvQeEGM-BpudWUaxIfyUSdNyG70xfRU,875
|
|
@@ -10,7 +10,7 @@ fmu/sumo/explorer/objects/__init__.py,sha256=72G0yfWWMTXA-oZw5GMRkrWvQqAYfadjerE
|
|
|
10
10
|
fmu/sumo/explorer/objects/_child.py,sha256=RrH3W3GF5Nhje7VnhmlEwG_jhX0z6CloJgdGJJzk3po,6035
|
|
11
11
|
fmu/sumo/explorer/objects/_document.py,sha256=uPAkNzcOk8U4LCtXthWkm7kfU9W4HYHrrqV9HERDhe8,1835
|
|
12
12
|
fmu/sumo/explorer/objects/_metrics.py,sha256=WITAFAV-3VRd-AqTg0tUwWpOChW4YFfF8ffT2fvOrAo,8144
|
|
13
|
-
fmu/sumo/explorer/objects/_search_context.py,sha256=
|
|
13
|
+
fmu/sumo/explorer/objects/_search_context.py,sha256=tHOxcOK6Mj1pJRKT6JwIKfZ_ogVugAHs8SP4-hIRKNk,63363
|
|
14
14
|
fmu/sumo/explorer/objects/case.py,sha256=fKp7X43ETLE1RaH3rMYxZiIuduRmf0JSnJ5gRoUgNPE,3813
|
|
15
15
|
fmu/sumo/explorer/objects/cases.py,sha256=i2bnvk7NWIkzbdWMs3BXU7TCqD5tH2r7pg1m1QXUj3o,561
|
|
16
16
|
fmu/sumo/explorer/objects/cpgrid.py,sha256=nuRgZ6FVEOPZT1ibd-rJhlbYYZ6BuUxXZPzovcH0kVc,2548
|
|
@@ -26,8 +26,8 @@ fmu/sumo/explorer/objects/realization.py,sha256=Th3zr_nT2I1HYHkBojOAKnf_RSIPc-Ti
|
|
|
26
26
|
fmu/sumo/explorer/objects/realizations.py,sha256=4agtQFJ5pxLyWMeIzdJbkBMc8__Md-tZOj8Un4ol22c,1562
|
|
27
27
|
fmu/sumo/explorer/objects/surface.py,sha256=zHBtjLCIfkRHBv39OeJjA9lq3puLTfTII6TndZTtxVI,1627
|
|
28
28
|
fmu/sumo/explorer/objects/table.py,sha256=vLor3YTddHkDWZSMyWPQsddFNQ2_VXE_O-stmPIWIaQ,4900
|
|
29
|
-
fmu_sumo-2.4.
|
|
30
|
-
fmu_sumo-2.4.
|
|
31
|
-
fmu_sumo-2.4.
|
|
32
|
-
fmu_sumo-2.4.
|
|
33
|
-
fmu_sumo-2.4.
|
|
29
|
+
fmu_sumo-2.4.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
30
|
+
fmu_sumo-2.4.6.dist-info/METADATA,sha256=YHRaMJwrrPD0zJij7bAC-4voTDVaz4lFxs4a24HEULk,14781
|
|
31
|
+
fmu_sumo-2.4.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
32
|
+
fmu_sumo-2.4.6.dist-info/top_level.txt,sha256=Z-FIY3pxn0UK2Wxi9IJ7fKoLSraaxuNGi1eokiE0ShM,4
|
|
33
|
+
fmu_sumo-2.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|