evo-objects 0.4.0__tar.gz → 0.4.2__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.
- {evo_objects-0.4.0 → evo_objects-0.4.2}/PKG-INFO +1 -1
- {evo_objects-0.4.0 → evo_objects-0.4.2}/pyproject.toml +1 -1
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/utils/data.py +29 -3
- {evo_objects-0.4.0 → evo_objects-0.4.2}/.gitignore +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/LICENSE.md +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/_model_config.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/client/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/client/api_client.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/client/object_client.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/client/parse.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/data.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/api/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/api/data_api.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/api/metadata_api.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/api/objects_api.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/api/stages_api.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/endpoints/models.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/exceptions.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/io.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/parquet/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/parquet/loader.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/py.typed +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/_data.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/_grid.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/_model.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/_utils.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/attributes.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/base.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/block_model_ref.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/exceptions.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/pointset.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/regular_grid.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/regular_masked_grid.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/spatial.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/tensor_grid.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/types.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/typed/variogram.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/utils/__init__.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/utils/table_formats.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/utils/tables.py +0 -0
- {evo_objects-0.4.0 → evo_objects-0.4.2}/src/evo/objects/utils/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: evo-objects
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Python SDK for using the Seequent Evo Geoscience Object API
|
|
5
5
|
Project-URL: Source, https://github.com/SeequentEvo/evo-python-sdk
|
|
6
6
|
Project-URL: Tracker, https://github.com/SeequentEvo/evo-python-sdk/issues
|
|
@@ -67,6 +67,26 @@ def _iter_refs(target: Any, _key: str | None = None) -> Iterator[str]:
|
|
|
67
67
|
yield str(value)
|
|
68
68
|
|
|
69
69
|
|
|
70
|
+
def _get_schema_from_dataframe(dataframe: "pd.DataFrame") -> pa.Schema:
|
|
71
|
+
"""Get a normalized pyarrow schema from a pandas dataframe.
|
|
72
|
+
|
|
73
|
+
This hook centralizes dataframe-to-Arrow schema adjustments before the
|
|
74
|
+
dataframe is converted to a table. It currently performs these conversions:
|
|
75
|
+
- large_string -> string
|
|
76
|
+
|
|
77
|
+
:param dataframe: The pandas dataframe to get the schema from.
|
|
78
|
+
:return: A pyarrow schema with any configured type conversions applied.
|
|
79
|
+
"""
|
|
80
|
+
schema = pa.Schema.from_pandas(dataframe)
|
|
81
|
+
fields = []
|
|
82
|
+
for field in schema:
|
|
83
|
+
if pa.types.is_large_string(field.type):
|
|
84
|
+
fields.append(field.with_type(pa.string()))
|
|
85
|
+
else:
|
|
86
|
+
fields.append(field)
|
|
87
|
+
return pa.schema(fields)
|
|
88
|
+
|
|
89
|
+
|
|
70
90
|
class ObjectDataClient:
|
|
71
91
|
"""An optional wrapper around data upload and download functionality for geoscience objects.
|
|
72
92
|
|
|
@@ -298,7 +318,9 @@ class ObjectDataClient:
|
|
|
298
318
|
no table formats are specified, raised when the table does not match any known format.
|
|
299
319
|
:raises StorageFileNotFoundError: If the destination does not exist or is not a directory.
|
|
300
320
|
"""
|
|
301
|
-
|
|
321
|
+
schema = _get_schema_from_dataframe(dataframe)
|
|
322
|
+
table = pa.Table.from_pandas(dataframe, schema)
|
|
323
|
+
return self.save_table(table, table_format=table_format)
|
|
302
324
|
|
|
303
325
|
async def upload_dataframe(
|
|
304
326
|
self,
|
|
@@ -320,7 +342,9 @@ class ObjectDataClient:
|
|
|
320
342
|
:raises TableFormatError: If the provided table does not match any of the specified formats. If
|
|
321
343
|
no table formats are specified, raised when the table does not match any known format.
|
|
322
344
|
"""
|
|
323
|
-
|
|
345
|
+
schema = _get_schema_from_dataframe(dataframe)
|
|
346
|
+
table = pa.Table.from_pandas(dataframe, schema)
|
|
347
|
+
table_info = await self.upload_table(table, table_format=table_format, fb=fb)
|
|
324
348
|
return table_info
|
|
325
349
|
|
|
326
350
|
async def upload_category_dataframe(self, dataframe: pd.DataFrame, fb: IFeedback = NoFeedback) -> CategoryInfo:
|
|
@@ -340,7 +364,9 @@ class ObjectDataClient:
|
|
|
340
364
|
:raises TableFormatError: If the table isn't a valid category table, or if the number of categories exceeds
|
|
341
365
|
what int32 type can represent.
|
|
342
366
|
"""
|
|
343
|
-
|
|
367
|
+
schema = _get_schema_from_dataframe(dataframe)
|
|
368
|
+
table = pa.Table.from_pandas(dataframe, schema)
|
|
369
|
+
category_info = await self.upload_category_table(table, fb=fb)
|
|
344
370
|
return category_info
|
|
345
371
|
|
|
346
372
|
async def download_dataframe(
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|