Skip to content

Commit

Permalink
fix classvars
Browse files Browse the repository at this point in the history
  • Loading branch information
headtr1ck committed Jul 12, 2024
1 parent 5b1d98c commit 16bee67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions xarray/coding/cftime_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def get_date_type(calendar, use_cftime=True):


class BaseCFTimeOffset:
_freq: ClassVar[str]
_day_option: ClassVar[DayOption]
_freq: ClassVar[str | None] = None
_day_option: ClassVar[DayOption | None] = None
n: int

def __init__(self, n: int = 1) -> None:
Expand All @@ -124,7 +124,7 @@ def __init__(self, n: int = 1) -> None:
)
self.n = n

def rule_code(self) -> str:
def rule_code(self) -> str | None:
return self._freq

def __eq__(self, other: object) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_cftime_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def test_Microsecond_multiplied_float_error():
],
ids=_id_func,
)
def test_neg(offset, expected):
def test_neg(offset: BaseCFTimeOffset, expected: BaseCFTimeOffset) -> None:
assert -offset == expected


Expand Down

0 comments on commit 16bee67

Please sign in to comment.