tilebox-datasets 0.40.0__py3-none-any.whl → 0.42.0__py3-none-any.whl

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.
@@ -374,19 +374,16 @@ def _create_field_converter(field: FieldDescriptor) -> _FieldConverter:
374
374
  """
375
375
  # special handling for enums:
376
376
  if field.type == FieldDescriptor.TYPE_ENUM:
377
- if field.label == FieldDescriptor.LABEL_REPEATED:
377
+ if field.is_repeated: # type: ignore[attr-defined]
378
378
  raise NotImplementedError("Repeated enum fields are not supported")
379
379
 
380
380
  return _EnumFieldConverter(field.name, enum_mapping_from_field_descriptor(field))
381
381
 
382
382
  field_type = infer_field_type(field)
383
- if field.label == FieldDescriptor.LABEL_OPTIONAL: # simple fields (in proto3 every simple field is optional)
384
- return _SimpleFieldConverter(field.name, field_type)
385
-
386
- if field.label == FieldDescriptor.LABEL_REPEATED:
383
+ if field.is_repeated: # type: ignore[attr-defined]
387
384
  return _ArrayFieldConverter(field.name, field_type)
388
385
 
389
- raise ValueError(f"Unsupported field type with label {field.label} and type {field.type}")
386
+ return _SimpleFieldConverter(field.name, field_type)
390
387
 
391
388
 
392
389
  def _combine_dimension_names(array_dimensions: dict[str, int]) -> dict[str, tuple[str, int]]:
@@ -6,7 +6,6 @@ from uuid import UUID
6
6
  import numpy as np
7
7
  import pandas as pd
8
8
  import xarray as xr
9
- from google.protobuf.descriptor import FieldDescriptor
10
9
  from google.protobuf.message import Message
11
10
 
12
11
  from tilebox.datasets.protobuf_conversion.field_types import (
@@ -80,7 +79,7 @@ def to_messages( # noqa: C901, PLR0912
80
79
  descriptor = field_descriptors_by_name[field_name]
81
80
  field_type = infer_field_type(descriptor)
82
81
 
83
- if descriptor.label == FieldDescriptor.LABEL_REPEATED:
82
+ if descriptor.is_repeated:
84
83
  values = convert_repeated_values_to_proto(values, field_type)
85
84
  else:
86
85
  values = convert_values_to_proto(values, field_type, filter_none=False)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tilebox-datasets
3
- Version: 0.40.0
3
+ Version: 0.42.0
4
4
  Summary: Access Tilebox datasets from Python
5
5
  Project-URL: Homepage, https://tilebox.com
6
6
  Project-URL: Documentation, https://docs.tilebox.com/datasets/introduction
@@ -46,8 +46,8 @@ tilebox/datasets/datasets/v1/well_known_types_pb2.pyi,sha256=RW-TrAbeFof2x-Qa5UP
46
46
  tilebox/datasets/datasets/v1/well_known_types_pb2_grpc.py,sha256=xYOs94SXiNYAlFodACnsXW5QovLsHY5tCk3p76RH5Zc,158
47
47
  tilebox/datasets/protobuf_conversion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  tilebox/datasets/protobuf_conversion/field_types.py,sha256=WBISp5pJ_jUYXLC_mNXw_S98guLlnqBeAr1fJjAk5uo,11977
49
- tilebox/datasets/protobuf_conversion/protobuf_xarray.py,sha256=HENZuGxrG8yi031VwhB32ARHy0ZQVUPrpUnnFrjCWS4,16393
50
- tilebox/datasets/protobuf_conversion/to_protobuf.py,sha256=ekGusGHUzbYdSg01pij4JSQHq1vbOGfl0EX_bt1jOb0,7475
49
+ tilebox/datasets/protobuf_conversion/protobuf_xarray.py,sha256=kO4Pq9bsH7p7Uocg8V4zUKM8KY0hes8bxByIdb6_s5k,16183
50
+ tilebox/datasets/protobuf_conversion/to_protobuf.py,sha256=Xy_ItOzTBd0nziRUe_CHBTM7VwQi6XY8LbYFE2thjAc,7392
51
51
  tilebox/datasets/query/__init__.py,sha256=lR-tzsVyx1QXe-uIHrYkCWcjmLRfKzmRHC7E1TTGroY,245
52
52
  tilebox/datasets/query/id_interval.py,sha256=Ha3Rm92hZugQXNzyfdFUROT1pTJ1ZBIISqTJbf13OP4,2508
53
53
  tilebox/datasets/query/pagination.py,sha256=0kaQI6v9sJnDJblP3VJn6erPbkP_LSwegFRSCzINGY0,774
@@ -63,6 +63,6 @@ tilebox/datasets/tilebox/v1/id_pb2_grpc.py,sha256=xYOs94SXiNYAlFodACnsXW5QovLsHY
63
63
  tilebox/datasets/tilebox/v1/query_pb2.py,sha256=l60DA1setyQhdBbZ_jgG8Pw3ourUSxXWU5P8AACYlpk,3444
64
64
  tilebox/datasets/tilebox/v1/query_pb2.pyi,sha256=f-u60POkJqzssOmCEbOrD5fam9_86c6MdY_CzpnZZk0,2061
65
65
  tilebox/datasets/tilebox/v1/query_pb2_grpc.py,sha256=xYOs94SXiNYAlFodACnsXW5QovLsHY5tCk3p76RH5Zc,158
66
- tilebox_datasets-0.40.0.dist-info/METADATA,sha256=HSHyaVTZ2CcQeDz3excwiD77qcqeB_deCJlgLlcxKdI,4234
67
- tilebox_datasets-0.40.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
68
- tilebox_datasets-0.40.0.dist-info/RECORD,,
66
+ tilebox_datasets-0.42.0.dist-info/METADATA,sha256=jV_wBuqWWsLRN-8oZ2toeXzgNEHMtfr9nvGId7TS1IY,4234
67
+ tilebox_datasets-0.42.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
68
+ tilebox_datasets-0.42.0.dist-info/RECORD,,