Skip to content

Commit

Permalink
#226 Merge pull request from astropenguin/astropenguin/issue225
Browse files Browse the repository at this point in the history
Release v1.8.0
  • Loading branch information
astropenguin authored Jun 13, 2024
2 parents 433e67e + 8f45e99 commit eeabc34
Show file tree
Hide file tree
Showing 12 changed files with 471 additions and 503 deletions.
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ cff-version: 1.2.0
message: "If you use this software, please cite it as below."

title: "xarray-dataclasses"
abstract: "xarray data creation made easy by dataclass"
version: 1.7.0
date-released: 2023-10-16
abstract: "xarray data creation by data classes"
version: 1.8.0
date-released: 2024-06-13
license: "MIT"
doi: "10.5281/zenodo.4624819"
url: "https://github.com/astropenguin/xarray-dataclasses"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2023 Akio Taniguchi
Copyright (c) 2020-2024 Akio Taniguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.4624819-cornflowerblue?style=flat-square)](https://doi.org/10.5281/zenodo.4624819)
[![Tests](https://img.shields.io/github/actions/workflow/status/astropenguin/xarray-dataclasses/tests.yml?label=Tests&style=flat-square)](https://github.com/astropenguin/xarray-dataclasses/actions)

xarray data creation made easy by dataclass
xarray data creation by data classes

## Overview

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# project information
author = "Akio Taniguchi"
copyright = "2020-2023 Akio Taniguchi"
copyright = "2020-2024 Akio Taniguchi"


# general configuration
Expand Down
848 changes: 421 additions & 427 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "xarray-dataclasses"
version = "1.7.0"
description = "xarray data creation made easy by dataclass"
version = "1.8.0"
description = "xarray data creation by data classes"
authors = ["Akio Taniguchi <taniguchi@a.phys.nagoya-u.ac.jp>"]
keywords = ["xarray", "dataclass", "dataarray", "dataset", "typing"]
license = "MIT"
Expand All @@ -19,16 +19,16 @@ numpy = [
typing-extensions = "^4.0"
xarray = [
{ version = ">=2022.3, <2023.2", python = ">=3.8, <3.9" },
{ version = ">=2022.3, <2024.0", python = ">=3.9, <3.13" },
{ version = ">=2022.3, <2025.0", python = ">=3.9, <3.13" },
]

[tool.poetry.group.dev.dependencies]
black = "^23.9"
black = "^24.4"
ipython = "^8.12"
myst-parser = "^2.0"
myst-parser = "^3.0"
pydata-sphinx-theme = "^0.14"
pyright = "^1.1"
pytest = "^7.4"
pytest = "^8.2"
sphinx = "^7.1"

[tool.pyright]
Expand Down
2 changes: 1 addition & 1 deletion xarray_dataclasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dataoptions",
"typing",
]
__version__ = "1.7.0"
__version__ = "1.8.0"


# submodules
Expand Down
46 changes: 16 additions & 30 deletions xarray_dataclasses/dataarray.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Submodule for DataArray creation."""

__all__ = ["AsDataArray", "asdataarray"]


Expand Down Expand Up @@ -38,26 +39,23 @@ def asdataarray(
dataclass: OptionedClass[PInit, TDataArray],
reference: Optional[AnyXarray] = None,
dataoptions: None = None,
) -> TDataArray:
...
) -> TDataArray: ...


@overload
def asdataarray(
dataclass: DataClass[PInit],
reference: Optional[AnyXarray] = None,
dataoptions: None = None,
) -> xr.DataArray:
...
) -> xr.DataArray: ...


@overload
def asdataarray(
dataclass: Any,
reference: Optional[AnyXarray] = None,
dataoptions: DataOptions[TDataArray] = DataOptions(xr.DataArray),
) -> TDataArray:
...
) -> TDataArray: ...


def asdataarray(
Expand Down Expand Up @@ -119,16 +117,14 @@ def __get__(
self,
obj: Any,
cls: Type[OptionedClass[PInit, TDataArray]],
) -> Callable[PInit, TDataArray]:
...
) -> Callable[PInit, TDataArray]: ...

@overload
def __get__(
self,
obj: Any,
cls: Type[DataClass[PInit]],
) -> Callable[PInit, xr.DataArray]:
...
) -> Callable[PInit, xr.DataArray]: ...

def __get__(self, obj: Any, cls: Any) -> Any:
return self.__func__(cls)
Expand Down Expand Up @@ -158,8 +154,7 @@ def shaped(
func: Callable[[Shape], AnyArray],
shape: Union[Shape, Sizes],
**kwargs: Any,
) -> TDataArray:
...
) -> TDataArray: ...

@overload
@classmethod
Expand All @@ -168,8 +163,7 @@ def shaped(
func: Callable[[Shape], AnyArray],
shape: Union[Shape, Sizes],
**kwargs: Any,
) -> xr.DataArray:
...
) -> xr.DataArray: ...

@classmethod
def shaped(
Expand Down Expand Up @@ -204,8 +198,7 @@ def empty(
shape: Union[Shape, Sizes],
order: Order = "C",
**kwargs: Any,
) -> TDataArray:
...
) -> TDataArray: ...

@overload
@classmethod
Expand All @@ -214,8 +207,7 @@ def empty(
shape: Union[Shape, Sizes],
order: Order = "C",
**kwargs: Any,
) -> xr.DataArray:
...
) -> xr.DataArray: ...

@classmethod
def empty(
Expand Down Expand Up @@ -246,8 +238,7 @@ def zeros(
shape: Union[Shape, Sizes],
order: Order = "C",
**kwargs: Any,
) -> TDataArray:
...
) -> TDataArray: ...

@overload
@classmethod
Expand All @@ -256,8 +247,7 @@ def zeros(
shape: Union[Shape, Sizes],
order: Order = "C",
**kwargs: Any,
) -> xr.DataArray:
...
) -> xr.DataArray: ...

@classmethod
def zeros(
Expand Down Expand Up @@ -288,8 +278,7 @@ def ones(
shape: Union[Shape, Sizes],
order: Order = "C",
**kwargs: Any,
) -> TDataArray:
...
) -> TDataArray: ...

@overload
@classmethod
Expand All @@ -298,8 +287,7 @@ def ones(
shape: Union[Shape, Sizes],
order: Order = "C",
**kwargs: Any,
) -> xr.DataArray:
...
) -> xr.DataArray: ...

@classmethod
def ones(
Expand Down Expand Up @@ -331,8 +319,7 @@ def full(
fill_value: Any,
order: Order = "C",
**kwargs: Any,
) -> TDataArray:
...
) -> TDataArray: ...

@overload
@classmethod
Expand All @@ -342,8 +329,7 @@ def full(
fill_value: Any,
order: Order = "C",
**kwargs: Any,
) -> xr.DataArray:
...
) -> xr.DataArray: ...

@classmethod
def full(
Expand Down
1 change: 1 addition & 0 deletions xarray_dataclasses/datamodel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Submodule for data expression inside the package."""

__all__ = ["DataModel"]


Expand Down
1 change: 1 addition & 0 deletions xarray_dataclasses/dataoptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Submodule for customization of DataArray or Dataset creation."""

__all__ = ["DataOptions"]


Expand Down
46 changes: 16 additions & 30 deletions xarray_dataclasses/dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Submodule for Dataset creation."""

__all__ = ["AsDataset", "asdataset"]


Expand Down Expand Up @@ -38,26 +39,23 @@ def asdataset(
dataclass: OptionedClass[PInit, TDataset],
reference: Optional[AnyXarray] = None,
dataoptions: None = None,
) -> TDataset:
...
) -> TDataset: ...


@overload
def asdataset(
dataclass: DataClass[PInit],
reference: Optional[AnyXarray] = None,
dataoptions: None = None,
) -> xr.Dataset:
...
) -> xr.Dataset: ...


@overload
def asdataset(
dataclass: Any,
reference: Optional[AnyXarray] = None,
dataoptions: DataOptions[TDataset] = DataOptions(xr.Dataset),
) -> TDataset:
...
) -> TDataset: ...


def asdataset(
Expand Down Expand Up @@ -119,16 +117,14 @@ def __get__(
self,
obj: Any,
cls: Type[OptionedClass[PInit, TDataset]],
) -> Callable[PInit, TDataset]:
...
) -> Callable[PInit, TDataset]: ...

@overload
def __get__(
self,
obj: Any,
cls: Type[DataClass[PInit]],
) -> Callable[PInit, xr.Dataset]:
...
) -> Callable[PInit, xr.Dataset]: ...

def __get__(self, obj: Any, cls: Any) -> Any:
return self.__func__(cls)
Expand Down Expand Up @@ -158,8 +154,7 @@ def shaped(
func: Callable[[Shape], AnyArray],
sizes: Sizes,
**kwargs: Any,
) -> TDataset:
...
) -> TDataset: ...

@overload
@classmethod
Expand All @@ -168,8 +163,7 @@ def shaped(
func: Callable[[Shape], AnyArray],
sizes: Sizes,
**kwargs: Any,
) -> xr.Dataset:
...
) -> xr.Dataset: ...

@classmethod
def shaped(
Expand Down Expand Up @@ -205,8 +199,7 @@ def empty(
sizes: Sizes,
order: Order = "C",
**kwargs: Any,
) -> TDataset:
...
) -> TDataset: ...

@overload
@classmethod
Expand All @@ -215,8 +208,7 @@ def empty(
sizes: Sizes,
order: Order = "C",
**kwargs: Any,
) -> xr.Dataset:
...
) -> xr.Dataset: ...

@classmethod
def empty(
Expand Down Expand Up @@ -247,8 +239,7 @@ def zeros(
sizes: Sizes,
order: Order = "C",
**kwargs: Any,
) -> TDataset:
...
) -> TDataset: ...

@overload
@classmethod
Expand All @@ -257,8 +248,7 @@ def zeros(
sizes: Sizes,
order: Order = "C",
**kwargs: Any,
) -> xr.Dataset:
...
) -> xr.Dataset: ...

@classmethod
def zeros(
Expand Down Expand Up @@ -289,8 +279,7 @@ def ones(
sizes: Sizes,
order: Order = "C",
**kwargs: Any,
) -> TDataset:
...
) -> TDataset: ...

@overload
@classmethod
Expand All @@ -299,8 +288,7 @@ def ones(
sizes: Sizes,
order: Order = "C",
**kwargs: Any,
) -> xr.Dataset:
...
) -> xr.Dataset: ...

@classmethod
def ones(
Expand Down Expand Up @@ -332,8 +320,7 @@ def full(
fill_value: Any,
order: Order = "C",
**kwargs: Any,
) -> TDataset:
...
) -> TDataset: ...

@overload
@classmethod
Expand All @@ -343,8 +330,7 @@ def full(
fill_value: Any,
order: Order = "C",
**kwargs: Any,
) -> xr.Dataset:
...
) -> xr.Dataset: ...

@classmethod
def full(
Expand Down
Loading

0 comments on commit eeabc34

Please sign in to comment.