Xarray-dataclasses

Latest version: v1.7.0

Safety actively analyzes 625610 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 5

1.3.0

New Contributors
* SohumB made their first contribution in https://github.com/astropenguin/xarray-dataclasses/pull/165

**Full Changelog**: https://github.com/astropenguin/xarray-dataclasses/compare/v1.2.0...v1.3.0

1.2.0

**Full Changelog**: https://github.com/astropenguin/xarray-dataclasses/compare/v1.1.0...v1.2.0

1.1.0

New Contributors
* thewtex made their first contribution in https://github.com/astropenguin/xarray-dataclasses/pull/145

**Full Changelog**: https://github.com/astropenguin/xarray-dataclasses/compare/v1.0.0...v1.1.0

1.0.0

Please note that the following behavior will change from v1.0.0 due to bug fixes and updates.

Dims and dtype specifications with bare strings will raise NameError

Due to the support of [PEP 563] (65), bare strings (i.e. forward references) in a type hint will raise `NameError` unless the backward type definitions exist. From v1.0.0, for example, the following code will raise `NameError`.

python
dataclass
class Image(AsDataArray):
data: Data[tuple["x", "y"], float]


Until v1.0.0, for backward compatibility, such bare strings are **forcibly** converted to literal type in DataArray or Dataset creation even if backward type definition exists. Since this behavior is not standard in Python, however, we will stop using the workaround from v1.0.0.

To deal with the change, please replace bare strings with literal types in your codes.

python
dataclass
class Image(AsDataArray):
data: Data[tuple[Literal["x"], Literal["y"]], float]


or define type aliases before the class definition.

python
X = Literal["x"]
Y = Literal["y"]


dataclass
class Image(AsDataArray):
data: Data[tuple[X, Y], float]



[PEP 563]: https://www.python.org/dev/peps/pep-0563

1.0.0rc.1

New Contributors
* dependabot made their first contribution in https://github.com/astropenguin/xarray-dataclasses/pull/134

**Full Changelog**: https://github.com/astropenguin/xarray-dataclasses/compare/v0.9.0...v1.0.0-rc.1

0.9.0

**Full Changelog**: https://github.com/astropenguin/xarray-dataclasses/compare/v0.8.0...v0.9.0

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.