terrakio-core 0.4.98.1b12__tar.gz → 0.4.98.1b14__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 terrakio-core might be problematic. Click here for more details.
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/PKG-INFO +1 -1
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/pyproject.toml +1 -1
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/__init__.py +4 -5
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/mass_stats.py +17 -20
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/model_management.py +7 -7
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/README.md +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/__init__.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/async_client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/config.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/convenience_functions/convenience_functions.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/auth.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/dataset_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/group_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/mass_stats.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/model_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/space_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/endpoints/user_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/exceptions.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/helper/bounded_taskgroup.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/helper/decorators.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/helper/tiles.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/__editable__.terrakio_core-0.3.9-py3-none-any/terrakio_core/sync_client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/__init__.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/accessors.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/async_client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/config.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/convenience_functions/convenience_functions.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/auth.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/dataset_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/group_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/mass_stats.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/model_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/space_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/user_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/exceptions.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/helper/bounded_taskgroup.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/helper/decorators.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/helper/tiles.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/sync_client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/accessors.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/async_client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/config.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/convenience_functions/create_dataset_file.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/convenience_functions/geoquries.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/convenience_functions/zonal_stats.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/auth.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/dataset_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/group_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/space_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/user_management.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/exceptions.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/helper/bounded_taskgroup.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/helper/decorators.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/helper/tiles.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/sync_client.py +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/PKG-INFO +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/SOURCES.txt +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/dependency_links.txt +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/requires.txt +0 -0
- {terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/top_level.txt +0 -0
|
@@ -5,16 +5,15 @@ Terrakio Core
|
|
|
5
5
|
Core components for Terrakio API clients.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# Suppress ONNX Runtime GPU device discovery warnings - MUST BE FIRST!
|
|
9
|
+
import os
|
|
10
|
+
os.environ['ORT_LOGGING_LEVEL'] = '3'
|
|
11
|
+
__version__ = "0.4.98.1"
|
|
9
12
|
|
|
10
13
|
from .async_client import AsyncClient
|
|
11
14
|
from .sync_client import SyncClient as Client
|
|
12
15
|
from . import accessors
|
|
13
16
|
|
|
14
|
-
# Suppress ONNX Runtime GPU device discovery warnings
|
|
15
|
-
import os
|
|
16
|
-
os.environ['ORT_LOGGING_LEVEL'] = '3'
|
|
17
|
-
|
|
18
17
|
__all__ = [
|
|
19
18
|
"AsyncClient",
|
|
20
19
|
"Client"
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/mass_stats.py
RENAMED
|
@@ -669,9 +669,8 @@ class MassStats:
|
|
|
669
669
|
CollectionNotFoundError: If the collection is not found
|
|
670
670
|
GetTaskError: If the API request fails due to unknown reasons
|
|
671
671
|
"""
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
)
|
|
672
|
+
|
|
673
|
+
await self.get_collection(collection = collection)
|
|
675
674
|
|
|
676
675
|
upload_urls = await self._upload_requests(
|
|
677
676
|
collection = collection
|
|
@@ -719,9 +718,8 @@ class MassStats:
|
|
|
719
718
|
CollectionNotFoundError: If the collection is not found
|
|
720
719
|
GetTaskError: If the API request fails due to unknown reasons
|
|
721
720
|
"""
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
)
|
|
721
|
+
|
|
722
|
+
await self.get_collection(collection = collection)
|
|
725
723
|
|
|
726
724
|
with open(consumer, 'rb') as f:
|
|
727
725
|
form = aiohttp.FormData()
|
|
@@ -749,7 +747,7 @@ class MassStats:
|
|
|
749
747
|
@require_api_key
|
|
750
748
|
async def training_samples(
|
|
751
749
|
self,
|
|
752
|
-
|
|
750
|
+
collection: str,
|
|
753
751
|
aoi: str,
|
|
754
752
|
expression_x: str,
|
|
755
753
|
filter_x: str = "skip",
|
|
@@ -765,7 +763,6 @@ class MassStats:
|
|
|
765
763
|
skip_test: bool = False,
|
|
766
764
|
start_year: int = None,
|
|
767
765
|
end_year: int = None,
|
|
768
|
-
bucket: str = None,
|
|
769
766
|
server: str = None,
|
|
770
767
|
extra_filters: list[str] = None,
|
|
771
768
|
extra_filters_rate: list[float] = None,
|
|
@@ -775,7 +772,7 @@ class MassStats:
|
|
|
775
772
|
Generate an AI dataset using specified parameters.
|
|
776
773
|
|
|
777
774
|
Args:
|
|
778
|
-
|
|
775
|
+
collection: The collection name where we save the results
|
|
779
776
|
aoi: Path to GeoJSON file containing area of interest
|
|
780
777
|
expression_x: Expression for X data (features)
|
|
781
778
|
filter_x: Filter expression for X data (default: "skip")
|
|
@@ -791,7 +788,6 @@ class MassStats:
|
|
|
791
788
|
skip_test: Skip expression validation test (default: False)
|
|
792
789
|
start_year: Start year for temporal filtering
|
|
793
790
|
end_year: End year for temporal filtering
|
|
794
|
-
bucket: Storage bucket name
|
|
795
791
|
server: Server to use for processing
|
|
796
792
|
extra_filters: Additional filter expressions
|
|
797
793
|
extra_filters_rate: Rates for additional filters
|
|
@@ -846,11 +842,9 @@ class MassStats:
|
|
|
846
842
|
|
|
847
843
|
with open(aoi, 'r') as f:
|
|
848
844
|
aoi_data = json.load(f)
|
|
849
|
-
|
|
850
|
-
await self.
|
|
851
|
-
collection =
|
|
852
|
-
bucket = bucket,
|
|
853
|
-
collection_type = "basic"
|
|
845
|
+
|
|
846
|
+
await self.get_collection(
|
|
847
|
+
collection = collection,
|
|
854
848
|
)
|
|
855
849
|
|
|
856
850
|
payload = {
|
|
@@ -866,18 +860,18 @@ class MassStats:
|
|
|
866
860
|
"server": server
|
|
867
861
|
}
|
|
868
862
|
|
|
869
|
-
task_id_dict, status = await self._client._terrakio_request("POST", f"collections/{
|
|
863
|
+
task_id_dict, status = await self._client._terrakio_request("POST", f"collections/{collection}/training_samples", json=payload)
|
|
870
864
|
|
|
871
865
|
if status != 200:
|
|
872
866
|
if status == 404:
|
|
873
|
-
raise CollectionNotFoundError(f"Collection {
|
|
867
|
+
raise CollectionNotFoundError(f"Collection {collection} not found", status_code=status)
|
|
874
868
|
raise GetTaskError(f"Training sample failed with status {status}", status_code=status)
|
|
875
869
|
|
|
876
870
|
task_id = task_id_dict["task_id"]
|
|
877
871
|
|
|
878
872
|
await self._client.mass_stats.track_progress(task_id)
|
|
879
873
|
|
|
880
|
-
return {"task_id": task_id, "collection":
|
|
874
|
+
return {"task_id": task_id, "collection": collection}
|
|
881
875
|
|
|
882
876
|
@require_api_key
|
|
883
877
|
async def download_files(
|
|
@@ -1075,6 +1069,7 @@ class MassStats:
|
|
|
1075
1069
|
@require_api_key
|
|
1076
1070
|
async def create_pyramids(
|
|
1077
1071
|
self,
|
|
1072
|
+
collection: str,
|
|
1078
1073
|
name: str,
|
|
1079
1074
|
levels: int,
|
|
1080
1075
|
config: Dict[str, Any]
|
|
@@ -1083,6 +1078,7 @@ class MassStats:
|
|
|
1083
1078
|
Create pyramid tiles for a dataset.
|
|
1084
1079
|
|
|
1085
1080
|
Args:
|
|
1081
|
+
collection: Name of collection
|
|
1086
1082
|
name: Dataset name
|
|
1087
1083
|
levels: Maximum zoom level for pyramid (e.g., 8)
|
|
1088
1084
|
config: Full pyramid configuration dictionary containing:
|
|
@@ -1104,9 +1100,10 @@ class MassStats:
|
|
|
1104
1100
|
Raises:
|
|
1105
1101
|
GetTaskError: If the API request fails
|
|
1106
1102
|
"""
|
|
1107
|
-
await self.
|
|
1108
|
-
|
|
1103
|
+
await self.get_collection(collection = collection)
|
|
1104
|
+
|
|
1109
1105
|
pyramid_request = {
|
|
1106
|
+
'collection_name': collection,
|
|
1110
1107
|
'name': name,
|
|
1111
1108
|
'max_zoom': levels,
|
|
1112
1109
|
**config
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/model_management.py
RENAMED
|
@@ -919,13 +919,13 @@ class ModelManagement:
|
|
|
919
919
|
if not SKL2ONNX_AVAILABLE:
|
|
920
920
|
raise ImportError("skl2onnx is not installed. Please install it with: pip install skl2onnx")
|
|
921
921
|
return self._convert_sklearn_to_onnx(model, input_shape), "random_forest"
|
|
922
|
-
elif isinstance(model, ort.InferenceSession):
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
922
|
+
# elif isinstance(model, ort.InferenceSession):
|
|
923
|
+
# if model_type is None:
|
|
924
|
+
# raise ValueError(
|
|
925
|
+
# "For ONNX InferenceSession models, you must specify the 'model_type' parameter. Currently 'nerual network' and 'random forest' are supported."
|
|
926
|
+
# "Example: model_type='random forest' or model_type='neural network'"
|
|
927
|
+
# )
|
|
928
|
+
# return model.SerializeToString(), model_type
|
|
929
929
|
else:
|
|
930
930
|
model_type = type(model).__name__
|
|
931
931
|
raise ValueError(f"Unsupported model type: {model_type}. Supported types: PyTorch nn.Module, sklearn BaseEstimator")
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/accessors.py
RENAMED
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/async_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/endpoints/auth.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/helper/decorators.py
RENAMED
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/helper/tiles.py
RENAMED
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/build/lib/terrakio_core/sync_client.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
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/group_management.py
RENAMED
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/space_management.py
RENAMED
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/endpoints/user_management.py
RENAMED
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core/helper/bounded_taskgroup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{terrakio_core-0.4.98.1b12 → terrakio_core-0.4.98.1b14}/terrakio_core.egg-info/top_level.txt
RENAMED
|
File without changes
|