hydroserverpy 2.0.0b4__tar.gz → 2.0.0b5__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.
- {hydroserverpy-2.0.0b4/src/hydroserverpy.egg-info → hydroserverpy-2.0.0b5}/PKG-INFO +1 -1
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/setup.cfg +1 -1
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/datastream.py +2 -2
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/monitoring_site.py +1 -3
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/observation.py +1 -1
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/base.py +2 -1
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/etl/task.py +4 -4
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/monitoring/task.py +4 -4
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/products/task.py +4 -4
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/products/transformation.py +5 -5
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/datastream.py +8 -7
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/monitoring_site.py +12 -4
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5/src/hydroserverpy.egg-info}/PKG-INFO +1 -1
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/tests/test_api_client.py +25 -6
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/LICENSE +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/README.md +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/pyproject.toml +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/client.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/base.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/data_connection.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/mapping.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/run.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/task.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/account.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/collaborator.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/role.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/service_account.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/workspace.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/monitoring/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/monitoring/rule.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/monitoring/task.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/orchestration/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/orchestration/run.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/products/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/products/rating_curve.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/products/task.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/products/transformation.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/method.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/observed_property.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/processing_level.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/result_qualifier.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/unit.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/etl/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/etl/data_connection.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/etl/mapping.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/iam/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/iam/role.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/iam/workspace.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/monitoring/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/monitoring/rule.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/products/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/products/rating_curve.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/method.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/observed_property.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/processing_level.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/result_qualifier.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/unit.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/utils.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/core/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/core/duration.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/core/timeseries.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/exceptions.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/extractors/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/extractors/base.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/extractors/ftp.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/extractors/http.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/extractors/local.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/hydroserver.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/loaders/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/loaders/base.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/loaders/hydroserver.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/models/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/models/base.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/models/pipeline.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/models/timestamp.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/arithmetic_expression.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/base.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/rating_curve.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/temporal_aggregation.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/transformers/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/transformers/base.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/transformers/csv.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/transformers/json.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/user_facing_errors.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/utils.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/products/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/products/aggregation.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/products/derivation.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/products/rating_curve.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/quality/__init__.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/quality/check.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/quality/correction.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/quality/service.py +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy.egg-info/SOURCES.txt +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy.egg-info/dependency_links.txt +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy.egg-info/requires.txt +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy.egg-info/top_level.txt +0 -0
- {hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy.egg-info/zip-safe +0 -0
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/datastream.py
RENAMED
|
@@ -172,7 +172,7 @@ class Datastream(HydroServerBaseModel):
|
|
|
172
172
|
sortby: List[str] = ...,
|
|
173
173
|
phenomenon_time_max: datetime = ...,
|
|
174
174
|
phenomenon_time_min: datetime = ...,
|
|
175
|
-
|
|
175
|
+
result_qualifiers: str = ...,
|
|
176
176
|
fetch_all: bool = False,
|
|
177
177
|
) -> pd.DataFrame:
|
|
178
178
|
"""Retrieve the observations for this datastream."""
|
|
@@ -184,7 +184,7 @@ class Datastream(HydroServerBaseModel):
|
|
|
184
184
|
sortby=sortby,
|
|
185
185
|
phenomenon_time_max=phenomenon_time_max,
|
|
186
186
|
phenomenon_time_min=phenomenon_time_min,
|
|
187
|
-
|
|
187
|
+
result_qualifiers=result_qualifiers,
|
|
188
188
|
fetch_all=fetch_all
|
|
189
189
|
)
|
|
190
190
|
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/monitoring_site.py
RENAMED
|
@@ -17,9 +17,7 @@ class MonitoringSite(HydroServerBaseModel):
|
|
|
17
17
|
is_private: bool
|
|
18
18
|
latitude: float = Field(..., ge=-90, le=90)
|
|
19
19
|
longitude: float = Field(..., ge=-180, le=180)
|
|
20
|
-
elevation_m: Optional[float] = Field(
|
|
21
|
-
None, ge=-99999, le=99999, alias="elevation_m"
|
|
22
|
-
)
|
|
20
|
+
elevation_m: Optional[float] = Field(None, ge=-99999, le=99999)
|
|
23
21
|
elevation_datum: Optional[str] = Field(
|
|
24
22
|
None, max_length=255
|
|
25
23
|
)
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/observation.py
RENAMED
|
@@ -52,7 +52,7 @@ class ObservationCollection:
|
|
|
52
52
|
)
|
|
53
53
|
self.datastream = datastream
|
|
54
54
|
|
|
55
|
-
COLUMNS = ("phenomenon_time", "result", "
|
|
55
|
+
COLUMNS = ("phenomenon_time", "result", "result_qualifiers")
|
|
56
56
|
|
|
57
57
|
@classmethod
|
|
58
58
|
def _columns(cls, groups: list) -> dict[str, list]:
|
|
@@ -3,6 +3,7 @@ import uuid
|
|
|
3
3
|
from typing import TYPE_CHECKING, Type, List, Union
|
|
4
4
|
from datetime import datetime
|
|
5
5
|
from hydroserverpy.api.models.base import HydroServerBaseModel, HydroServerCollection
|
|
6
|
+
from pydantic.alias_generators import to_camel
|
|
6
7
|
from hydroserverpy.api.utils import sortby_to_camel
|
|
7
8
|
|
|
8
9
|
if TYPE_CHECKING:
|
|
@@ -26,7 +27,7 @@ class HydroServerBaseService:
|
|
|
26
27
|
kwargs = {
|
|
27
28
|
k: v for k, v in kwargs.items() if v is not ...
|
|
28
29
|
}
|
|
29
|
-
params = kwargs.
|
|
30
|
+
params = {to_camel(k): v for k, v in kwargs.items()}
|
|
30
31
|
params.update({
|
|
31
32
|
"offset": offset,
|
|
32
33
|
"limit": limit,
|
|
@@ -141,10 +141,10 @@ class TaskService(HydroServerBaseService):
|
|
|
141
141
|
"limit": limit,
|
|
142
142
|
"sortby": [sortby_to_camel(o) for o in sortby] if sortby is not ... else sortby,
|
|
143
143
|
"status": status,
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
144
|
+
"startedAtMin": started_at_min,
|
|
145
|
+
"startedAtMax": started_at_max,
|
|
146
|
+
"finishedAtMin": finished_at_min,
|
|
147
|
+
"finishedAtMax": finished_at_max,
|
|
148
148
|
}
|
|
149
149
|
params = {k: v for k, v in params.items() if v is not ...}
|
|
150
150
|
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/monitoring/task.py
RENAMED
|
@@ -137,10 +137,10 @@ class MonitoringTaskService(HydroServerBaseService):
|
|
|
137
137
|
"limit": limit,
|
|
138
138
|
"sortby": [sortby_to_camel(o) for o in sortby] if sortby is not ... else sortby,
|
|
139
139
|
"status": status,
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
140
|
+
"startedAtMin": started_at_min,
|
|
141
|
+
"startedAtMax": started_at_max,
|
|
142
|
+
"finishedAtMin": finished_at_min,
|
|
143
|
+
"finishedAtMax": finished_at_max,
|
|
144
144
|
}
|
|
145
145
|
params = {k: v for k, v in params.items() if v is not ...}
|
|
146
146
|
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/products/task.py
RENAMED
|
@@ -137,10 +137,10 @@ class DataProductTaskService(HydroServerBaseService):
|
|
|
137
137
|
"limit": limit,
|
|
138
138
|
"sortby": [sortby_to_camel(o) for o in sortby] if sortby is not ... else sortby,
|
|
139
139
|
"status": status,
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
140
|
+
"startedAtMin": started_at_min,
|
|
141
|
+
"startedAtMax": started_at_max,
|
|
142
|
+
"finishedAtMin": finished_at_min,
|
|
143
|
+
"finishedAtMax": finished_at_max,
|
|
144
144
|
}
|
|
145
145
|
params = {k: v for k, v in params.items() if v is not ...}
|
|
146
146
|
|
|
@@ -42,15 +42,15 @@ class DataProductTransformationService:
|
|
|
42
42
|
output_datastream: Optional[Union[UUID, str]] = None,
|
|
43
43
|
input_datastream: Optional[Union[UUID, str]] = None,
|
|
44
44
|
) -> List[dict]:
|
|
45
|
-
params = {"
|
|
45
|
+
params = {"transformationType": transformation_type}
|
|
46
46
|
if task_id is not None:
|
|
47
|
-
params["
|
|
47
|
+
params["taskId"] = normalize_uuid(task_id)
|
|
48
48
|
if workspace_id is not None:
|
|
49
|
-
params["
|
|
49
|
+
params["workspaceId"] = normalize_uuid(workspace_id)
|
|
50
50
|
if output_datastream is not None:
|
|
51
|
-
params["
|
|
51
|
+
params["outputDatastreamId"] = normalize_uuid(output_datastream)
|
|
52
52
|
if input_datastream is not None:
|
|
53
|
-
params["
|
|
53
|
+
params["inputDatastreamId"] = normalize_uuid(input_datastream)
|
|
54
54
|
|
|
55
55
|
response = self.client.request("get", self._route(), params=params)
|
|
56
56
|
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/datastream.py
RENAMED
|
@@ -5,7 +5,7 @@ from uuid import UUID
|
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
from pydantic.alias_generators import to_camel
|
|
7
7
|
from hydroserverpy.api.models import Datastream, ObservationCollection
|
|
8
|
-
from hydroserverpy.api.utils import normalize_uuid, build_datetime_interval
|
|
8
|
+
from hydroserverpy.api.utils import normalize_uuid, build_datetime_interval, sortby_to_camel
|
|
9
9
|
from ..base import HydroServerBaseService
|
|
10
10
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
COLUMN_PROFILE = "https://hydroserver.org/profiles/observations/column"
|
|
23
|
-
LOADABLE_OBSERVATION_PROPERTIES = ("phenomenonTime", "result", "
|
|
23
|
+
LOADABLE_OBSERVATION_PROPERTIES = ("phenomenonTime", "result", "resultQualifiers")
|
|
24
24
|
READ_ONLY_OBSERVATION_PROPERTIES = ("id", "workspaceId", "datastreamId")
|
|
25
25
|
|
|
26
26
|
|
|
@@ -82,6 +82,7 @@ class DatastreamService(HydroServerBaseService):
|
|
|
82
82
|
collection.filters.update({
|
|
83
83
|
k: v
|
|
84
84
|
for k, v in {
|
|
85
|
+
"tag": tag,
|
|
85
86
|
"phenomenon_time_max": phenomenon_time_max,
|
|
86
87
|
"phenomenon_time_min": phenomenon_time_min,
|
|
87
88
|
}.items()
|
|
@@ -229,18 +230,18 @@ class DatastreamService(HydroServerBaseService):
|
|
|
229
230
|
sortby: List[str] = ...,
|
|
230
231
|
phenomenon_time_max: datetime = ...,
|
|
231
232
|
phenomenon_time_min: datetime = ...,
|
|
232
|
-
|
|
233
|
+
result_qualifiers: str = ...,
|
|
233
234
|
fetch_all: bool = False,
|
|
234
235
|
) -> ObservationCollection:
|
|
235
236
|
"""Retrieve observations of a datastream."""
|
|
236
237
|
|
|
237
238
|
params = {
|
|
238
|
-
"
|
|
239
|
+
"datastreamId": str(uid),
|
|
239
240
|
"offset": offset,
|
|
240
241
|
"limit": limit,
|
|
241
|
-
"sortby": ",".join(sortby) if sortby is not ... else sortby,
|
|
242
|
+
"sortby": ",".join(sortby_to_camel(o) for o in sortby) if sortby is not ... else sortby,
|
|
242
243
|
"datetime": build_datetime_interval(phenomenon_time_min, phenomenon_time_max),
|
|
243
|
-
"
|
|
244
|
+
"resultQualifiers": result_qualifiers,
|
|
244
245
|
"profile": COLUMN_PROFILE,
|
|
245
246
|
"properties": ",".join(LOADABLE_OBSERVATION_PROPERTIES),
|
|
246
247
|
}
|
|
@@ -262,7 +263,7 @@ class DatastreamService(HydroServerBaseService):
|
|
|
262
263
|
for k, v in {
|
|
263
264
|
"phenomenon_time_max": phenomenon_time_max,
|
|
264
265
|
"phenomenon_time_min": phenomenon_time_min,
|
|
265
|
-
"
|
|
266
|
+
"result_qualifiers": result_qualifiers,
|
|
266
267
|
}.items()
|
|
267
268
|
if v is not ...
|
|
268
269
|
},
|
|
@@ -32,7 +32,7 @@ class MonitoringSiteService(HydroServerBaseService):
|
|
|
32
32
|
) -> List["MonitoringSite"]:
|
|
33
33
|
"""Fetch a collection of monitoring_sites."""
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
collection = super().list(
|
|
36
36
|
offset=offset,
|
|
37
37
|
limit=limit,
|
|
38
38
|
sortby=sortby,
|
|
@@ -44,9 +44,17 @@ class MonitoringSiteService(HydroServerBaseService):
|
|
|
44
44
|
type=type,
|
|
45
45
|
tag=[f"{tag[0]}:{tag[1]}"] if tag is not ... else tag,
|
|
46
46
|
is_private=is_private,
|
|
47
|
-
fetch_all=
|
|
47
|
+
fetch_all=False,
|
|
48
48
|
)
|
|
49
49
|
|
|
50
|
+
if tag is not ...:
|
|
51
|
+
collection.filters["tag"] = tag
|
|
52
|
+
|
|
53
|
+
if fetch_all is True:
|
|
54
|
+
collection = collection.fetch_all()
|
|
55
|
+
|
|
56
|
+
return collection
|
|
57
|
+
|
|
50
58
|
def create(
|
|
51
59
|
self,
|
|
52
60
|
workspace: Union["Workspace", UUID, str],
|
|
@@ -79,7 +87,7 @@ class MonitoringSiteService(HydroServerBaseService):
|
|
|
79
87
|
"workspaceId": normalize_uuid(workspace),
|
|
80
88
|
"latitude": latitude,
|
|
81
89
|
"longitude": longitude,
|
|
82
|
-
"
|
|
90
|
+
"elevationM": elevation_m,
|
|
83
91
|
"elevationDatum": elevation_datum,
|
|
84
92
|
"adminArea1": admin_area_1,
|
|
85
93
|
"adminArea2": admin_area_2,
|
|
@@ -118,7 +126,7 @@ class MonitoringSiteService(HydroServerBaseService):
|
|
|
118
126
|
"dataDisclaimer": data_disclaimer,
|
|
119
127
|
"latitude": latitude,
|
|
120
128
|
"longitude": longitude,
|
|
121
|
-
"
|
|
129
|
+
"elevationM": elevation_m,
|
|
122
130
|
"elevationDatum": elevation_datum,
|
|
123
131
|
"adminArea1": admin_area_1,
|
|
124
132
|
"adminArea2": admin_area_2,
|
|
@@ -136,13 +136,13 @@ def test_hydroserver_encodes_boolean_query_params_in_lowercase(fake_session_fact
|
|
|
136
136
|
hs.request(
|
|
137
137
|
"get",
|
|
138
138
|
"/api/ogc/collections/workspaces/items",
|
|
139
|
-
params={"
|
|
139
|
+
params={"isPrivate": True, "isAssociated": False, "workspaceId": ["a", "null"], "limit": 5},
|
|
140
140
|
)
|
|
141
141
|
|
|
142
142
|
assert fake_session_factory[0].last_kwargs["params"] == {
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
143
|
+
"isPrivate": "true",
|
|
144
|
+
"isAssociated": "false",
|
|
145
|
+
"workspaceId": ["a", "null"],
|
|
146
146
|
"limit": 5,
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -158,8 +158,8 @@ def test_workspace_list_sends_lowercase_booleans(fake_session_factory):
|
|
|
158
158
|
url = requests.Request(
|
|
159
159
|
"GET", "https://example.com", params=fake_session_factory[0].last_kwargs["params"]
|
|
160
160
|
).prepare().url
|
|
161
|
-
assert "
|
|
162
|
-
assert "
|
|
161
|
+
assert "isPrivate=true" in url
|
|
162
|
+
assert "isAssociated=false" in url
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
RUN_ID = "01a0e94d-307f-7347-8f40-66fb0327d09e"
|
|
@@ -180,3 +180,22 @@ def test_task_trigger_and_get_run_unwrap_the_item_envelope(fake_session_factory,
|
|
|
180
180
|
assert str(triggered.id) == RUN_ID
|
|
181
181
|
assert triggered.status == "PENDING"
|
|
182
182
|
assert str(fetched.id) == RUN_ID
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def test_list_sends_camel_case_params_and_keeps_public_filter_names(fake_session_factory):
|
|
186
|
+
hs = client_module.HydroServer(host="https://example.com", apikey="hs_test_api_key")
|
|
187
|
+
fake_session_factory[0].queue(
|
|
188
|
+
"get", FakeResponse(content=b'{"data": [], "meta": {"limit": 100, "offset": 0, "totalCount": 0}}')
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
collection = hs.datastreams.list(
|
|
192
|
+
workspace="00000000-0000-0000-0000-000000000001", is_private=False, tag=("river", "green")
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
params = fake_session_factory[0].last_kwargs["params"]
|
|
196
|
+
assert params["workspaceId"] == "00000000-0000-0000-0000-000000000001"
|
|
197
|
+
assert params["isPrivate"] == "false"
|
|
198
|
+
assert params["tag"] == ["river:green"]
|
|
199
|
+
assert not any("_" in key for key in params)
|
|
200
|
+
assert collection.filters["workspace"] == "00000000-0000-0000-0000-000000000001"
|
|
201
|
+
assert collection.filters["tag"] == ("river", "green")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/__init__.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/etl/data_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/collaborator.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/service_account.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/iam/workspace.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/monitoring/__init__.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/monitoring/rule.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/monitoring/task.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/orchestration/run.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/products/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/products/task.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/processing_level.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/models/sta/result_qualifier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/etl/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/etl/mapping.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/iam/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/iam/workspace.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/monitoring/rule.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/products/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/__init__.py
RENAMED
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/api/services/sta/method.py
RENAMED
|
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
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/extractors/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/loaders/hydroserver.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/operations/rating_curve.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy/etl/transformers/__init__.py
RENAMED
|
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
|
|
File without changes
|
{hydroserverpy-2.0.0b4 → hydroserverpy-2.0.0b5}/src/hydroserverpy.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|