Releases: astropenguin/xarray-dataclasses
Releases · astropenguin/xarray-dataclasses
v1.8.0 (2024-06-13)
v1.7.0 (2023-10-16)
What's Changed
- Support Python 3.12 by @astropenguin in #217
- Release v1.7.0 by @astropenguin in #219
- Fix dependency specifications by @astropenguin in #221
Full Changelog: v1.6.0...v1.7.0
v1.6.0 (2023-06-09)
What's Changed
- Fix import of Literal and Protocol by @astropenguin in #203
- Drop support for Python 3.7 by @astropenguin in #205
- Release v1.6.0 by @astropenguin in #207
Full Changelog: v1.5.0...v1.6.0
v1.5.0 (2023-02-02)
What's Changed
- Support Python 3.11 by @astropenguin in #190
- Release v1.5.0 by @astropenguin in #192
Full Changelog: v1.4.0...v1.5.0
v1.4.0 (2023-01-18)
What's Changed
- Remove v2 modules by @astropenguin in #184
- Do not use morecopy by @astropenguin in #186
- Release v1.4.0 by @astropenguin in #188
Full Changelog: v1.3.2...v1.4.0
v1.3.2 (2023-01-16)
What's Changed
- Add v2 typing module by @astropenguin in #173
- Add v2 specs module by @astropenguin in #175
- Fix importing at the package root by @astropenguin in #180
- Release v1.3.2 by @astropenguin in #182
Full Changelog: v1.3.1...v1.3.2
v1.3.1 (2022-09-05)
This release fixes the name of CITATION file (.ctf → .cff) and package description in README (no code updates).
What's Changed
- Release v1.3.1 by @astropenguin in #171
Full Changelog: v1.3.0...v1.3.1
v1.3.0 (2022-09-05)
What's Changed
- Add specs module by @astropenguin in #163
- Update version range of typing-extensions (>=3.10, <5.0) by @SohumB in #165
- Add support for Poetry >=1.2 by @astropenguin in #168
- Release v1.3.0 by @astropenguin in #169
New Contributors
Full Changelog: v1.2.0...v1.3.0
v1.2.0 (2022-06-09)
From this release, special type hints (Attr
, Coord
, Data
, Name
) can be used within union types.
This would be useful if you want to customize values after dataclass object creation (__post_init__
).
The following example automatically sets ranged values to x and y coordinates if they are not specified.
import numpy as np
from dataclasses import dataclass
from typing import Literal, Optional
from xarray_dataclasses import AsDataArray, Coord, Data
X = Literal["x"]
Y = Literal["y"]
@dataclass
class Image(AsDataArray):
"""2D image as DataArray."""
data: Data[tuple[X, Y], float]
x: Optional[Coord[X, int]] = None
y: Optional[Coord[Y, int]] = None
def __post_init__(self) -> None:
"""Set ranged values to x and y."""
shape = np.shape(self.data)
if self.x is None:
self.x = np.arange(shape[0])
if self.y is None:
self.y = np.arange(shape[1])
What's Changed
- Update static type check by @astropenguin in #153
- Update typing module by @astropenguin in #158
- Release v1.2.0 by @astropenguin in #161
Full Changelog: v1.1.0...v1.2.0
v1.1.0 (2022-04-14)
What's Changed
- README typo: varible by @thewtex in #145
- Add support of Python 3.10 by @astropenguin in #149
- Release v1.1.0 by @astropenguin in #151
New Contributors
Full Changelog: v1.0.0...v1.1.0