xarray extension for dataarray classes
Project Links
Meta
Author: Akio Taniguchi
Requires Python: >=3.7,<4.0
Classifiers
License
- OSI Approved :: MIT License
Programming Language
- Python :: 3
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
xarray-dataclasses
xarray extension for dataarray classes
TL;DR
xarray-dataclasses is a third-party Python package which helps to create DataArray classes in the same manner as the Python's native dataclass. Here is an introduction code of what the package provides:
from xarray_dataclasses import DataArray, dataarrayclass
@dataarrayclass
class Image:
"""DataArray class to represent images."""
data: DataArray[('x', 'y'), float]
x: DataArray['x', int] = 0
y: DataArray['y', int] = 0
The key features are:
# create a DataArray instance
image = Image.new([[0, 1], [2, 3]], x=[0, 1], y=[0, 1])
# create a DataArray instance filled with ones
ones = Image.ones((2, 2), x=[0, 1], y=[0, 1])
- Custom DataArray instances with fixed dimensions, datatype, and coordinates can easily be created.
- NumPy-like special functions like
ones()
are provided as class methods.
Requirements
- Python: 3.7, 3.8, or 3.9 (tested by the author)
- Dependencies: See pyproject.toml
Installation
$ pip install xarray-dataclasses
Dec 09, 2024
1.9.1
Dec 09, 2024
1.9.0
Jun 13, 2024
1.8.0
Oct 16, 2023
1.7.0
Jun 08, 2023
1.6.0
Feb 02, 2023
1.5.0
Jan 18, 2023
1.4.0
Jan 16, 2023
1.3.2
Sep 05, 2022
1.3.1
Sep 05, 2022
1.3.0
Jun 08, 2022
1.2.0
Apr 14, 2022
1.1.0
Mar 06, 2022
1.0.0
Feb 17, 2022
1.0.0rc1
Jan 09, 2022
0.9.0
Dec 01, 2021
0.8.0
Nov 28, 2021
0.7.0
Oct 27, 2021
0.6.1
Sep 26, 2021
0.6.0
Sep 25, 2021
0.5.1
Sep 16, 2021
0.5.0
Aug 21, 2021
0.4.0
May 03, 2021
0.3.1
Mar 20, 2021
0.3.0
Mar 01, 2021
0.2.0
Sep 27, 2020
0.1.2
Sep 25, 2020
0.1.1
Sep 19, 2020
0.1.0