From d04101516069442a520154c75aa085af52932468 Mon Sep 17 00:00:00 2001 From: psuedomagi Date: Sun, 24 Dec 2023 17:03:28 -0500 Subject: [PATCH] minor linting fixes --- fedcal/_date_attributes.py | 3 --- fedcal/_mil.py | 2 +- fedcal/_tree.py | 2 +- fedcal/_typing.py | 5 +++-- fedcal/fedindex.py | 7 +++---- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/fedcal/_date_attributes.py b/fedcal/_date_attributes.py index 9f1bd63..42f3ba5 100644 --- a/fedcal/_date_attributes.py +++ b/fedcal/_date_attributes.py @@ -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 diff --git a/fedcal/_mil.py b/fedcal/_mil.py index c00bcba..62e0502 100644 --- a/fedcal/_mil.py +++ b/fedcal/_mil.py @@ -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: """ diff --git a/fedcal/_tree.py b/fedcal/_tree.py index d002ea9..9fb1afa 100644 --- a/fedcal/_tree.py +++ b/fedcal/_tree.py @@ -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 diff --git a/fedcal/_typing.py b/fedcal/_typing.py index dfcf297..e0533b7 100644 --- a/fedcal/_typing.py +++ b/fedcal/_typing.py @@ -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 @@ -64,7 +65,7 @@ DateStampStatusMapType = Mapping["Dept", StatusTupleType] -StatusMapType = "bidict.frozenbidict"[str, StatusTupleType] +StatusMapType = frozenbidict[str, StatusTupleType] StatusPoolType = Mapping[tuple["Dept", str], "FedDepartment"] diff --git a/fedcal/fedindex.py b/fedcal/fedindex.py index e619c9e..e3bf3f9 100644 --- a/fedcal/fedindex.py +++ b/fedcal/fedindex.py @@ -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 @@ -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. @@ -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]: """ @@ -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.""" )