Skip to content

Update release

Choose a tag to compare

@astropenguin astropenguin released this 27 May 23:26
· 106 commits to master since this release
5706207
  • Add utils module to provide include class decorator

Examples

If a definition is written in dataarray.toml:

# dataarray.toml

dims = [ "x", "y" ]
dtype = "float"
desc = "DataArray class to represent images."

[coords.x]
dims = "x"
dtype = "int"
default = 0

[coords.y]
dims = "y"
dtype = "int"
default = 0

then the following two class definitions are equivalent:

@dataarrayclass(accessor='img')
@include('dataarray.toml')
class Image:
    pass
@dataarrayclass(accessor='img')
class Image:
    """DataArray class to represent images."""

    dims = 'x', 'y'
    dtype = float
    x: ctype('x', int) = 0
    y: ctype('y', int) = 0