Skip to content

Commit a1b1713

Browse files
authored
Merge branch 'main' into 661
2 parents f112d56 + e4292d5 commit a1b1713

26 files changed

+920
-1171
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
33
// Configure tool-specific properties.
44
"features": {
5-
"ghcr.io/va-h/devcontainers-features/uv:1": { "version": "0.8.15" }
5+
"ghcr.io/va-h/devcontainers-features/uv:1": { "version": "0.8.17" }
66
},
77
"customizations": {
88
"vscode": {

.devcontainer/post-create.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
set -e
44

5+
# Install useful developer tools used by mdio development
6+
uv tool install nox
7+
uv tool install bump-my-version
8+
59
# Sync the environment, installing the project editable and including dev dependencies
610
uv sync
711

docs/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
aiohttp==3.12.15
12
autodoc-pydantic==2.2.0
23
furo==2025.7.19
34
linkify-it-py==2.0.3
5+
matplotlib==3.10.6
46
myst-nb==1.3.0
57
sphinx==8.2.3
6-
sphinx-click==6.0.0
8+
sphinx-click==6.1.0
79
sphinx-copybutton==0.5.2
810
sphinx-design==0.6.1

docs/tutorials/quickstart.ipynb

Lines changed: 154 additions & 555 deletions
Large diffs are not rendered by default.

noxfile.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,16 @@ def docs_build(session: Session) -> None:
225225
session_install_uv_package(
226226
session,
227227
[
228+
"aiohttp",
228229
"autodoc-pydantic",
230+
"furo",
231+
"linkify-it-py",
232+
"matplotlib",
233+
"myst-nb",
229234
"sphinx",
230235
"sphinx-click",
231236
"sphinx-copybutton",
232237
"sphinx-design",
233-
"furo",
234-
"myst-nb",
235-
"linkify-it-py",
236238
],
237239
)
238240

@@ -251,15 +253,17 @@ def docs(session: Session) -> None:
251253
session_install_uv_package(
252254
session,
253255
[
256+
"aiohttp",
254257
"autodoc-pydantic",
258+
"furo",
259+
"linkify-it-py",
260+
"matplotlib",
261+
"myst-nb",
255262
"sphinx",
256263
"sphinx-autobuild",
257264
"sphinx-click",
258265
"sphinx-copybutton",
259266
"sphinx-design",
260-
"furo",
261-
"myst-nb",
262-
"linkify-it-py",
263267
],
264268
)
265269

pyproject.toml

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[project]
22
name = "multidimio"
3-
version = "1.0.0"
3+
version = "1.0.2"
44
description = "Cloud-native, scalable, and user-friendly multi dimensional energy data!"
55
authors = [{ name = "Altay Sansal", email = "[email protected]" }]
66
requires-python = ">=3.11,<3.14"
77
readme = "README.md"
8-
license = { "text" = "Apache-2.0" }
8+
license = "Apache-2.0"
9+
license-files = ["LICEN[CS]E*"]
910
keywords = ["mdio", "multidimio", "seismic", "wind", "data"]
1011
classifiers = [
1112
"Programming Language :: Python :: 3",
@@ -17,25 +18,25 @@ classifiers = [
1718
]
1819

1920
dependencies = [
20-
"click (>=8.2.1,<9.0.0)",
21-
"click-params (>=0.5.0,<0.6.0)",
22-
"dask (>=2025.7.0)",
23-
"fsspec (>=2025.9.0)",
24-
"pint>=0.25.0,<1.0.0",
25-
"psutil (>=7.0.0,<8.0.0)",
26-
"pydantic (>=2.11.7,<3.0.0)",
27-
"rich (>=14.1.0,<15.0.0)",
28-
"segy (>=0.4.2,<0.5.0)",
29-
"tqdm (>=4.67.1,<5.0.0)",
21+
"click>=8.2.1",
22+
"click-params>=0.5.0",
23+
"dask>=2025.9.0",
24+
"fsspec>=2025.9.0",
25+
"pint>=0.25.0",
26+
"psutil>=7.0.0",
27+
"pydantic>=2.11.9",
28+
"rich>=14.1.0",
29+
"segy>=0.5.0",
30+
"tqdm>=4.67.1",
3031
"universal-pathlib>=0.2.6",
3132
"xarray>=2025.9.0",
32-
"zarr (>=3.1.2,<4.0.0)",
33+
"zarr>=3.1.2",
3334
]
3435

3536
[project.optional-dependencies]
36-
cloud = ["s3fs (>=2025.9.0)", "gcsfs (>=2025.9.0)", "adlfs (>=2025.8.0)"]
37-
distributed = ["distributed (>=2025.7.0)", "bokeh (>=3.8.0,<4.0.0)"]
38-
lossy = ["zfpy (>=1.0.1,<2.0.0)"]
37+
cloud = ["s3fs>=2025.9.0", "gcsfs>=2025.9.0", "adlfs>=2025.8.0"]
38+
distributed = ["distributed>=2025.9.0", "bokeh>=3.8.0"]
39+
lossy = ["zfpy>=1.0.1"]
3940

4041
[project.urls]
4142
homepage = "https://mdio.dev/"
@@ -47,31 +48,34 @@ mdio = "mdio.__main__:main"
4748

4849
[dependency-groups]
4950
dev = [
50-
"ruff (>=0.12.2)",
51-
"coverage[toml] (>=7.10.6,<8)",
52-
"mypy (>=1.17.1,<2)",
53-
"pre-commit (>=4.3.0,<5)",
54-
"pre-commit-hooks (>=6.0.0,<7)",
55-
"pytest (>=8.4.2,<9)",
56-
"pytest-dependency (>=0.6.0,<0.7)",
57-
"typeguard (>=4.4.4,<5)",
58-
"xdoctest[colors] (>=1.2.0,<2)",
59-
"Pygments (>=2.19.2,<3)",
51+
"ruff>=0.13.0",
52+
"coverage[toml]>=7.10.6",
53+
"mypy>=1.18.1",
54+
"pre-commit>=4.3.0",
55+
"pre-commit-hooks>=6.0.0",
56+
"pytest>=8.4.2",
57+
"pytest-dependency>=0.6.0",
58+
"typeguard>=4.4.4",
59+
"xdoctest[colors]>=1.3.0",
60+
"Pygments>=2.19.2"
6061
]
6162

6263
docs = [
63-
"furo (>=2025.7.19)",
64-
"linkify-it-py (>=2.0.3)",
65-
"myst-nb (>=1.3.0)",
66-
"sphinx (>=8.2.3,<9)",
67-
"sphinx-autobuild (>=2025.8.25)",
68-
"sphinx-click (>=6.0.0,<7)",
69-
"sphinx-copybutton (>=0.5.2,<0.6)",
70-
"sphinx-design (>=0.6.1,<0.7)",
64+
"aiohttp>=3.12.15",
65+
"autodoc-pydantic>=2.2.0",
66+
"furo>=2025.7.19",
67+
"linkify-it-py>=2.0.3",
68+
"matplotlib>=3.10.6",
69+
"myst-nb>=1.3.0",
70+
"sphinx>=8.2.3",
71+
"sphinx-autobuild>=2025.8.25",
72+
"sphinx-click>=6.1.0",
73+
"sphinx-copybutton>=0.5.2",
74+
"sphinx-design>=0.6.1",
7175
]
7276

7377
[tool.uv]
74-
required-version = ">=0.8.15"
78+
required-version = ">=0.8.17"
7579

7680
[tool.ruff]
7781
target-version = "py311"
@@ -177,7 +181,7 @@ init_typed = true
177181
warn_required_dynamic_aliases = true
178182

179183
[tool.bumpversion]
180-
current_version = "1.0.0"
184+
current_version = "1.0.2"
181185
allow_dirty = true
182186
commit = false
183187
tag = false
@@ -187,6 +191,9 @@ serialize = [
187191
"{major}.{minor}.{patch}", # For stable releases
188192
]
189193

194+
[tool.uv.build-backend]
195+
module-name = "mdio"
196+
190197
[build-system]
191-
requires = ["setuptools", "wheel", "fastentrypoints"]
192-
build-backend = "setuptools.build_meta"
198+
requires = ["uv_build>=0.8.17,<0.9.0"]
199+
build-backend = "uv_build"

src/mdio/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
KNOWN_MODULES = ["segy.py", "copy.py", "info.py"]
1717

1818

19-
class MyCLI(click.MultiCommand):
19+
class MyCLI(click.Group):
2020
"""CLI generator via plugin design pattern.
2121
2222
This class dynamically loads command modules from the specified `plugin_folder`. If the
@@ -26,8 +26,8 @@ class MyCLI(click.MultiCommand):
2626
2727
Args:
2828
plugin_folder: Path to the directory containing command modules
29-
*args: Variable length argument list passed to the click.MultiCommand.
30-
**kwargs: Arbitrary keyword arguments passed to the click.MultiCommand.
29+
*args: Variable length argument list passed to the click.Group.
30+
**kwargs: Arbitrary keyword arguments passed to the click.Group.
3131
"""
3232

3333
def __init__(self, plugin_folder: Path, *args: Any, **kwargs: Any): # noqa: ANN401

src/mdio/api/io.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from xarray.backends.api import to_zarr as xr_to_zarr
1414

1515
from mdio.constants import ZarrFormat
16+
from mdio.core.zarr_io import zarr_warnings_suppress_unstable_structs_v3
1617

1718
if TYPE_CHECKING:
1819
from collections.abc import Mapping
@@ -51,11 +52,13 @@ def open_mdio(input_path: UPath | Path | str, chunks: T_Chunks = None) -> xr_Dat
5152
input_path = _normalize_path(input_path)
5253
storage_options = _normalize_storage_options(input_path)
5354
zarr_format = zarr.config.get("default_zarr_format")
55+
5456
return xr_open_zarr(
5557
input_path.as_posix(),
5658
chunks=chunks,
5759
storage_options=storage_options,
5860
mask_and_scale=zarr_format == ZarrFormat.V3, # off for v2, on for v3
61+
consolidated=zarr_format == ZarrFormat.V2, # on for v2, off for v3
5962
)
6063

6164

@@ -86,13 +89,15 @@ def to_mdio( # noqa: PLR0913
8689
output_path = _normalize_path(output_path)
8790
storage_options = _normalize_storage_options(output_path)
8891
zarr_format = zarr.config.get("default_zarr_format")
89-
xr_to_zarr(
90-
dataset,
91-
store=output_path.as_posix(), # xarray doesn't like URI when file:// is protocol
92-
mode=mode,
93-
compute=compute,
94-
consolidated=zarr_format == ZarrFormat.V2, # off for v3, on for v2
95-
region=region,
96-
storage_options=storage_options,
97-
write_empty_chunks=False,
98-
)
92+
93+
with zarr_warnings_suppress_unstable_structs_v3():
94+
xr_to_zarr(
95+
dataset,
96+
store=output_path.as_posix(), # xarray doesn't like URI when file:// is protocol
97+
mode=mode,
98+
compute=compute,
99+
consolidated=zarr_format == ZarrFormat.V2, # on for v2, off for v3
100+
region=region,
101+
storage_options=storage_options,
102+
write_empty_chunks=False,
103+
)

src/mdio/builder/schemas/v1/units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from mdio.builder.schemas.units import create_unit_model
1111

1212
ureg = UnitRegistry()
13-
ureg.default_format = "~C" # compact, abbreviated (symbol).
13+
ureg.formatter.default_format = "~C" # compact, abbreviated (symbol).
1414

1515

1616
class LengthUnitEnum(UnitEnum):

src/mdio/builder/xarray_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def to_xarray_dataset(mdio_ds: Dataset) -> xr_Dataset: # noqa: PLR0912
222222

223223
encoding = {
224224
"chunks": original_chunks,
225-
"compressor": _convert_compressor(v.compressor),
225+
"compressors": _convert_compressor(v.compressor),
226226
fill_value_key: fill_value,
227227
}
228228

0 commit comments

Comments
 (0)