envlib 0.1.7__tar.gz → 0.1.8__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.
- {envlib-0.1.7 → envlib-0.1.8}/PKG-INFO +3 -3
- {envlib-0.1.7 → envlib-0.1.8}/envlib/__init__.py +1 -1
- {envlib-0.1.7 → envlib-0.1.8}/envlib/catalogue.py +14 -3
- {envlib-0.1.7 → envlib-0.1.8}/pyproject.toml +6 -3
- {envlib-0.1.7 → envlib-0.1.8}/.gitignore +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/LICENSE +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/README.md +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/metadata.py +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/__init__.py +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/aggregation_statistic.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/feature.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/frequency_interval.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/license.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/method.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/processing_level.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/standard_name.json +0 -0
- {envlib-0.1.7 → envlib-0.1.8}/envlib/vocabularies/variable.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: envlib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: The environmental library
|
|
5
5
|
Project-URL: Documentation, https://envlib.github.io/envlib/
|
|
6
6
|
Project-URL: Source, https://github.com/envlib/envlib
|
|
@@ -9,8 +9,8 @@ License-File: LICENSE
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Requires-Dist: booklet>=0.12.6
|
|
12
|
-
Requires-Dist: cfdb>=0.
|
|
13
|
-
Requires-Dist: ebooklet>=0.
|
|
12
|
+
Requires-Dist: cfdb>=0.11.0
|
|
13
|
+
Requires-Dist: ebooklet>=0.11.0
|
|
14
14
|
Requires-Dist: pyproj
|
|
15
15
|
Requires-Dist: shapely>=2.0
|
|
16
16
|
Requires-Dist: urllib3
|
|
@@ -4,7 +4,7 @@ from envlib import vocabularies
|
|
|
4
4
|
from envlib.catalogue import Catalogue, DatasetRef, validate_dataset
|
|
5
5
|
from envlib.metadata import Metadata, ValidationError, canonical_station_point, compute_station_id
|
|
6
6
|
|
|
7
|
-
__version__ = '0.1.
|
|
7
|
+
__version__ = '0.1.8'
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
10
10
|
'Catalogue',
|
|
@@ -42,6 +42,10 @@ DEFAULT_CACHE_DIR = '~/.envlib/cache'
|
|
|
42
42
|
|
|
43
43
|
STATION_ID_VAR = 'station_id'
|
|
44
44
|
|
|
45
|
+
# "Argument not given" for publish()'s group_bytes: only a given value is
|
|
46
|
+
# forwarded, so ebooklet's own default applies otherwise.
|
|
47
|
+
_NOT_GIVEN = object()
|
|
48
|
+
|
|
45
49
|
# cfdb dataset types, grouped by the structure envlib cares about. Defined once because every
|
|
46
50
|
# check below used exact string equality against a single value, which is how a new dataset type
|
|
47
51
|
# silently skips a guard -- most dangerously _check_stations.
|
|
@@ -989,10 +993,17 @@ class Catalogue:
|
|
|
989
993
|
return validate_dataset(local_cfdb_path)
|
|
990
994
|
|
|
991
995
|
def publish(
|
|
992
|
-
self, local_cfdb_path, remote_conn, rcg_remote_conn,
|
|
996
|
+
self, local_cfdb_path, remote_conn, rcg_remote_conn, *, group_bytes=_NOT_GIVEN, verify_objects: bool = True,
|
|
997
|
+
**open_kwargs
|
|
993
998
|
) -> dict:
|
|
994
999
|
"""Validate, push the cfdb data to its S3 remote, verify it, then register it in the RCG.
|
|
995
1000
|
|
|
1001
|
+
``group_bytes`` sets how the remote stores chunks (ebooklet >= 0.11): an
|
|
1002
|
+
int packs chunks into write-order groups of up to that many bytes, None
|
|
1003
|
+
stores one object per chunk. Omitted, an existing remote keeps its mode
|
|
1004
|
+
and recorded group_bytes, and a new one is grouped (ebooklet's
|
|
1005
|
+
default, 32 MiB).
|
|
1006
|
+
|
|
996
1007
|
The cfdb data is pushed BEFORE the RCG entry so the catalogue never
|
|
997
1008
|
references incomplete remote data. With ``verify_objects`` (default True),
|
|
998
1009
|
after the push and before the entry is written the remote is fsck'd, and a
|
|
@@ -1004,8 +1015,8 @@ class Catalogue:
|
|
|
1004
1015
|
"""
|
|
1005
1016
|
member_conn = _as_connection(remote_conn)
|
|
1006
1017
|
edataset_kwargs = dict(open_kwargs)
|
|
1007
|
-
if
|
|
1008
|
-
edataset_kwargs['
|
|
1018
|
+
if group_bytes is not _NOT_GIVEN:
|
|
1019
|
+
edataset_kwargs['group_bytes'] = group_bytes
|
|
1009
1020
|
# validate INSIDE the edataset session: for a re-publish of an
|
|
1010
1021
|
# already-pushed (possibly partially materialized) local file, plain
|
|
1011
1022
|
# open_dataset would read local chunks only and could extract wrong
|
|
@@ -19,9 +19,12 @@ dependencies = [
|
|
|
19
19
|
# >=0.10.0: cfdb 0.10 writes new datasets with byte-shuffled compression (zstd_shuffle), which an
|
|
20
20
|
# older cfdb refuses at open with a bare "Invalid enum value 'zstd_shuffle'" naming no remedy.
|
|
21
21
|
# Readers must be able to open anything a current producer publishes, so envlib floors the
|
|
22
|
-
# version that can.
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
# version that can.
|
|
23
|
+
# >=0.11 (cfdb and ebooklet): ebooklet 0.11's write-order groups are remote format 3, which
|
|
24
|
+
# 0.10 clients refuse ("upgrade ebooklet"), and publish() forwards group_bytes, which only
|
|
25
|
+
# cfdb 0.11's open_edataset accepts. The commons catalogue itself is a format-3 remote.
|
|
26
|
+
"cfdb>=0.11.0",
|
|
27
|
+
"ebooklet>=0.11.0",
|
|
25
28
|
"booklet>=0.12.6",
|
|
26
29
|
"pyproj",
|
|
27
30
|
"shapely>=2.0",
|
|
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
|