Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
minor linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
seekinginfiniteloop committed Dec 24, 2023
1 parent 31ddc51 commit d041015
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions fedcal/_date_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ def _get_cal(
dates = ensure_datetimeindex(dates=dates) if dates else self.dates

fy_fq_idx: pd.PeriodIndex = dates.to_period(freq="Q-SEP")
_s: pd.Series = pd.Series(
data=fy_fq_idx, index=dates, dtype=str, name="fiscal_cal"
)

fys: pd.Index[int] = fy_fq_idx.qyear
fqs: pd.Index[int] = fy_fq_idx.quarter
Expand Down
2 changes: 1 addition & 1 deletion fedcal/_mil.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MilitaryPayDay:
"""

dates: pd.Timestamp | pd.DatetimeIndex | pd.Series = field(default=None)
paydays: np.ndarray | bool | None = field(default=None, init=False)
paydays: np.ndarray | bool | None = field(default=None, init=False)

def __attrs_post_init__(self) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion fedcal/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class -- we only want (and need) to build one. As designed,

from __future__ import annotations

from typing import TYPE_CHECKING, Any, ClassVar, Self, Tuple
from typing import TYPE_CHECKING, Any, ClassVar, Tuple

from attrs import define, field
from intervaltree import IntervalTree
Expand Down
5 changes: 3 additions & 2 deletions fedcal/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Dict, Generator, Mapping, Union
from bidict import frozenbidict


if TYPE_CHECKING:
from datetime import date, datetime

import numpy as np
import pandas as pd
import bidict

from fedcal.constants import AppropsStatus, Dept, OpsStatus, ShutdownFlag
from fedcal.depts import FedDepartment
Expand Down Expand Up @@ -64,7 +65,7 @@

DateStampStatusMapType = Mapping["Dept", StatusTupleType]

StatusMapType = "bidict.frozenbidict"[str, StatusTupleType]
StatusMapType = frozenbidict[str, StatusTupleType]

StatusPoolType = Mapping[tuple["Dept", str], "FedDepartment"]

Expand Down
7 changes: 3 additions & 4 deletions fedcal/fedindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Any, Callable, KeysView, Type
from typing import TYPE_CHECKING, Any, Callable, KeysView

import pandas as pd
from fedcal import _civpay, _date_attributes, _dept_status, _mil, constants, time_utils
Expand Down Expand Up @@ -884,7 +884,6 @@ def fys_fqs(self) -> pd.PeriodIndex:
return self._fiscalcal.fys_fqs

@property
@to_series
def fq_start(self) -> pd.PeriodIndex:
"""
Identify the first day of each fiscal quarter.
Expand Down Expand Up @@ -948,7 +947,6 @@ def fy_end(self) -> pd.PeriodIndex:
self._set_fiscalcal()
return self._fiscalcal.fy_end

@to_series
@property
def holidays(self) -> "np.ndarray"[bool]:
"""
Expand Down Expand Up @@ -1432,5 +1430,6 @@ def to_fedindex(*dates: FedIndexConvertibleTypes) -> FedIndex:
if count in {1, 2}:
return FedIndex(datetimeindex=time_utils.to_datetimeindex(dates))
raise ValueError(
f"Invalid number of arguments: {count}. Please pass either an array-like date object or start and end dates for the range."
f"""Invalid number of arguments: {count}. Please pass either an
array-like date object or start and end dates for the range."""
)

0 comments on commit d041015

Please sign in to comment.