envlib 0.1.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: envlib
3
- Version: 0.1.6
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.9.6
13
- Requires-Dist: ebooklet>=0.10.3
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.6'
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, num_groups=None, verify_objects: bool = True, **open_kwargs
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 num_groups is not None:
1008
- edataset_kwargs['num_groups'] = num_groups
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
@@ -16,8 +16,15 @@ dependencies = [
16
16
  # file fails to open at all. No runtime guard accompanies this one, deliberately -- unlike
17
17
  # the packed-encoder floor in envlib-ingest-base, an older cfdb cannot silently mis-handle a
18
18
  # forecast dataset; it raises TypeError before touching data.
19
- "cfdb>=0.9.6",
20
- "ebooklet>=0.10.3",
19
+ # >=0.10.0: cfdb 0.10 writes new datasets with byte-shuffled compression (zstd_shuffle), which an
20
+ # older cfdb refuses at open with a bare "Invalid enum value 'zstd_shuffle'" naming no remedy.
21
+ # Readers must be able to open anything a current producer publishes, so envlib floors the
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",
21
28
  "booklet>=0.12.6",
22
29
  "pyproj",
23
30
  "shapely>=2.0",
File without changes
File without changes
File without changes
File without changes