cecil 0.0.7__tar.gz → 0.0.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.
Potentially problematic release.
This version of cecil might be problematic. Click here for more details.
- {cecil-0.0.7 → cecil-0.0.9}/PKG-INFO +1 -1
- cecil-0.0.9/__about__.py +1 -0
- {cecil-0.0.7 → cecil-0.0.9}/src/cecil/client.py +6 -2
- {cecil-0.0.7 → cecil-0.0.9}/src/cecil/models.py +6 -3
- {cecil-0.0.7 → cecil-0.0.9}/tests/test_client.py +15 -9
- cecil-0.0.7/__about__.py +0 -1
- {cecil-0.0.7 → cecil-0.0.9}/.gitignore +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/CONTRIBUTING.md +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/LICENSE.txt +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/Makefile +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/README.md +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/pyproject.toml +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/src/cecil/__init__.py +0 -0
- {cecil-0.0.7 → cecil-0.0.9}/tests/__init__.py +0 -0
cecil-0.0.9/__about__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.9"
|
|
@@ -22,9 +22,13 @@ from .models import (
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class Client:
|
|
25
|
-
def __init__(self, env=
|
|
25
|
+
def __init__(self, env=None):
|
|
26
26
|
self._api_auth = None
|
|
27
|
-
self._base_url =
|
|
27
|
+
self._base_url = (
|
|
28
|
+
"https://api.cecil.earth"
|
|
29
|
+
if env is None
|
|
30
|
+
else f"https://{env}-api.cecil.earth"
|
|
31
|
+
)
|
|
28
32
|
self._snowflake_creds = None
|
|
29
33
|
|
|
30
34
|
def create_aoi(self, name: str, geometry: Dict) -> AOI:
|
|
@@ -24,7 +24,8 @@ class AOI(BaseModel):
|
|
|
24
24
|
name: str
|
|
25
25
|
geometry: Dict
|
|
26
26
|
hectares: float
|
|
27
|
-
|
|
27
|
+
created_at: datetime.datetime
|
|
28
|
+
created_by: str
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class AOICreate(BaseModel):
|
|
@@ -48,7 +49,8 @@ class DataRequest(BaseModel):
|
|
|
48
49
|
dataset_id: str
|
|
49
50
|
sub_requests: List[SubRequest]
|
|
50
51
|
status: DataRequestStatus
|
|
51
|
-
|
|
52
|
+
created_at: datetime.datetime
|
|
53
|
+
created_by: str
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
class DataRequestCreate(BaseModel):
|
|
@@ -63,7 +65,8 @@ class Reprojection(BaseModel):
|
|
|
63
65
|
data_request_id: str
|
|
64
66
|
crs: str
|
|
65
67
|
resolution: float
|
|
66
|
-
|
|
68
|
+
created_at: datetime.datetime
|
|
69
|
+
created_by: str
|
|
67
70
|
|
|
68
71
|
|
|
69
72
|
class ReprojectionCreate(BaseModel):
|
|
@@ -8,21 +8,22 @@ FROZEN_TIME = "2024-01-01T00:00:00.000Z"
|
|
|
8
8
|
|
|
9
9
|
def test_client_class():
|
|
10
10
|
client = Client()
|
|
11
|
-
assert client._base_url == "https://
|
|
11
|
+
assert client._base_url == "https://api.cecil.earth"
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@responses.activate
|
|
15
15
|
def test_client_create_data_request():
|
|
16
16
|
responses.add(
|
|
17
17
|
responses.POST,
|
|
18
|
-
"https://
|
|
18
|
+
"https://api.cecil.earth/v0/data-requests",
|
|
19
19
|
json={
|
|
20
20
|
"id": "id",
|
|
21
21
|
"aoiId": "aoi_id",
|
|
22
22
|
"datasetId": "dataset_id",
|
|
23
23
|
"subRequests": [],
|
|
24
24
|
"status": "processing",
|
|
25
|
-
"
|
|
25
|
+
"created_at": FROZEN_TIME,
|
|
26
|
+
"created_by": "user_id",
|
|
26
27
|
},
|
|
27
28
|
status=201,
|
|
28
29
|
)
|
|
@@ -36,7 +37,8 @@ def test_client_create_data_request():
|
|
|
36
37
|
datasetId="dataset_id",
|
|
37
38
|
subRequests=[],
|
|
38
39
|
status="processing",
|
|
39
|
-
|
|
40
|
+
created_at="2024-01-01T00:00:00.000Z",
|
|
41
|
+
created_by="user_id",
|
|
40
42
|
)
|
|
41
43
|
|
|
42
44
|
|
|
@@ -44,7 +46,7 @@ def test_client_create_data_request():
|
|
|
44
46
|
def test_client_list_data_requests():
|
|
45
47
|
responses.add(
|
|
46
48
|
responses.GET,
|
|
47
|
-
"https://
|
|
49
|
+
"https://api.cecil.earth/v0/data-requests",
|
|
48
50
|
json={
|
|
49
51
|
"records": [
|
|
50
52
|
{
|
|
@@ -53,7 +55,8 @@ def test_client_list_data_requests():
|
|
|
53
55
|
"datasetId": "dataset_id",
|
|
54
56
|
"subRequests": [], # TODO: Add some SubRequests
|
|
55
57
|
"status": "processing",
|
|
56
|
-
"
|
|
58
|
+
"created_at": "2024-09-19T04:45:57.561Z",
|
|
59
|
+
"created_by": "user_id",
|
|
57
60
|
},
|
|
58
61
|
{
|
|
59
62
|
"id": "data_request_id_2",
|
|
@@ -61,7 +64,8 @@ def test_client_list_data_requests():
|
|
|
61
64
|
"datasetId": "dataset_id",
|
|
62
65
|
"subRequests": [], # TODO: Add some SubRequests
|
|
63
66
|
"status": "completed",
|
|
64
|
-
"
|
|
67
|
+
"created_at": "2024-09-19T04:54:38.252Z",
|
|
68
|
+
"created_by": "user_id",
|
|
65
69
|
},
|
|
66
70
|
]
|
|
67
71
|
},
|
|
@@ -77,7 +81,8 @@ def test_client_list_data_requests():
|
|
|
77
81
|
datasetId="dataset_id",
|
|
78
82
|
subRequests=[],
|
|
79
83
|
status=DataRequestStatus.PROCESSING,
|
|
80
|
-
|
|
84
|
+
created_at="2024-09-19T04:45:57.561Z",
|
|
85
|
+
created_by="user_id",
|
|
81
86
|
),
|
|
82
87
|
DataRequest(
|
|
83
88
|
id="data_request_id_2",
|
|
@@ -85,6 +90,7 @@ def test_client_list_data_requests():
|
|
|
85
90
|
datasetId="dataset_id",
|
|
86
91
|
subRequests=[],
|
|
87
92
|
status=DataRequestStatus.COMPLETED,
|
|
88
|
-
|
|
93
|
+
created_at="2024-09-19T04:54:38.252Z",
|
|
94
|
+
created_by="user_id",
|
|
89
95
|
),
|
|
90
96
|
]
|
cecil-0.0.7/__about__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.7"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|