titiler-xarray 1.2.1__tar.gz → 2.0.0__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.4
2
2
  Name: titiler-xarray
3
- Version: 1.2.1
3
+ Version: 2.0.0
4
4
  Summary: Xarray plugin for TiTiler.
5
5
  Project-URL: Homepage, https://developmentseed.org/titiler/
6
6
  Project-URL: Documentation, https://developmentseed.org/titiler/
@@ -24,7 +24,7 @@ Classifier: Topic :: Scientific/Engineering :: GIS
24
24
  Requires-Python: >=3.11
25
25
  Requires-Dist: obstore
26
26
  Requires-Dist: rioxarray
27
- Requires-Dist: titiler-core==1.2.1
27
+ Requires-Dist: titiler-core==2.0.0
28
28
  Requires-Dist: xarray
29
29
  Requires-Dist: zarr<4.0,>=3.1
30
30
  Provides-Extra: fs
@@ -29,7 +29,7 @@ classifiers = [
29
29
  ]
30
30
  dynamic = ["version"]
31
31
  dependencies = [
32
- "titiler-core==1.2.1",
32
+ "titiler-core==2.0.0",
33
33
  "xarray",
34
34
  "rioxarray",
35
35
  "obstore",
@@ -1,3 +1,3 @@
1
1
  """titiler.xarray"""
2
2
 
3
- __version__ = "1.2.1"
3
+ __version__ = "2.0.0"
@@ -1,5 +1,6 @@
1
1
  """titiler.xarray Extensions."""
2
2
 
3
+ import sys
3
4
  import warnings
4
5
  from collections.abc import Callable
5
6
  from typing import Annotated
@@ -9,7 +10,6 @@ from attrs import define
9
10
  from fastapi import Depends, Query
10
11
  from rio_tiler.constants import WGS84_CRS
11
12
  from starlette.responses import HTMLResponse
12
- from typing_extensions import TypedDict
13
13
 
14
14
  from titiler.core.dependencies import DefaultDependency
15
15
  from titiler.core.factory import FactoryExtension
@@ -18,6 +18,12 @@ from titiler.xarray.dependencies import XarrayIOParams
18
18
  from titiler.xarray.factory import TilerFactory
19
19
  from titiler.xarray.io import X_DIM_NAMES, Y_DIM_NAMES, open_zarr
20
20
 
21
+ # Ref: https://docs.pydantic.dev/2.12/errors/usage_errors/#typed-dict-version
22
+ if sys.version_info >= (3, 12):
23
+ from typing import TypedDict
24
+ else:
25
+ from typing_extensions import TypedDict
26
+
21
27
 
22
28
  @define
23
29
  class VariablesExtension(FactoryExtension):
@@ -7,7 +7,7 @@ import re
7
7
  from collections.abc import Callable
8
8
  from functools import cache
9
9
  from pathlib import Path
10
- from typing import Any, Literal
10
+ from typing import Any, Literal, TypedDict
11
11
  from urllib.parse import urlparse
12
12
 
13
13
  import attr
@@ -17,8 +17,7 @@ import xarray
17
17
  import zarr
18
18
  from morecantile import TileMatrixSet
19
19
  from rio_tiler.constants import WEB_MERCATOR_TMS
20
- from rio_tiler.io.xarray import XarrayReader
21
- from typing_extensions import TypedDict
20
+ from rio_tiler.io.xarray import Options, XarrayReader
22
21
  from zarr.storage import ObjectStore
23
22
 
24
23
  X_DIM_NAMES = ["lon", "longitude", "LON", "LONGITUDE", "Lon", "Longitude"]
@@ -272,11 +271,17 @@ class Reader(XarrayReader):
272
271
 
273
272
  tms: TileMatrixSet = attr.ib(default=WEB_MERCATOR_TMS)
274
273
 
274
+ options: Options = attr.ib()
275
+
275
276
  ds: xarray.Dataset = attr.ib(init=False)
276
277
  input: xarray.DataArray = attr.ib(init=False)
277
278
 
278
279
  _dims: list = attr.ib(init=False, factory=list)
279
280
 
281
+ @options.default
282
+ def _options_default(self):
283
+ return {}
284
+
280
285
  def __attrs_post_init__(self):
281
286
  """Set bounds and CRS."""
282
287
  opener_options = {
File without changes
File without changes