Skip to content

Commit bf8479e

Browse files
committed
#135 Remove explicit variables of data options
1 parent e65d3ad commit bf8479e

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,11 @@ class Custom(xr.DataArray):
311311
print("Custom method!")
312312

313313

314-
dataoptions = DataOptions(Custom)
315-
316-
317314
@dataclass
318315
class Image(AsDataArray):
319316
"""Specs for a monochromatic image."""
320317

321-
__dataoptions__ = dataoptions
318+
__dataoptions__ = DataOptions(Custom)
322319

323320
data: Data[tuple[X, Y], float]
324321
x: Coord[X, int] = 0

tests/test_dataarray.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ class Custom(xr.DataArray):
3232
__slots__ = ()
3333

3434

35-
dataoptions = DataOptions(Custom)
36-
37-
3835
@dataclass
3936
class Image(AsDataArray):
4037
"""Specs for a monochromatic image."""
4138

42-
__dataoptions__ = dataoptions
39+
__dataoptions__ = DataOptions(Custom)
4340

4441
data: Data[Tuple[X, Y], float]
4542
x: Coord[X, int] = 0

tests/test_dataset.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class Custom(xr.Dataset):
3030
__slots__ = ()
3131

3232

33-
dataoptions = DataOptions(Custom)
34-
35-
3633
@dataclass
3734
class Image(AsDataArray):
3835
"""Specs for a monochromatic image."""
@@ -44,7 +41,7 @@ class Image(AsDataArray):
4441
class ColorImage(AsDataset):
4542
"""Specs for a color image."""
4643

47-
__dataoptions__ = dataoptions
44+
__dataoptions__ = DataOptions(Custom)
4845

4946
red: Data[Tuple[X, Y], float]
5047
green: Data[Tuple[X, Y], float]

0 commit comments

Comments
 (0)