Skip to content

Commit

Permalink
CI: fix nightly (#588)
Browse files Browse the repository at this point in the history
* CI: fix nightly

* indented too much
  • Loading branch information
twoertwein authored Mar 23, 2023
1 parent e17ed9f commit f16ac90
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ repos:
- id: flake8
name: flake8 (pyi)
additional_dependencies:
- flake8-pyi==23.1.2
- flake8-pyi==23.3.1
types: [pyi]
args: [
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y042,
# TypeVars in private files are already private
--per-file-ignores=_*.pyi:Y001
]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies: [ tomli ]
5 changes: 3 additions & 2 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,12 +992,13 @@ def test_types_plot() -> None:
def test_types_window() -> None:
df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]})
df.expanding()
df.expanding(axis=1)
if PD_LTE_20:
df.expanding(axis=1)
df.rolling(2, axis=1, center=True)
if TYPE_CHECKING_INVALID_USAGE:
df.expanding(axis=1, center=True) # type: ignore[call-arg] # pyright: ignore[reportGeneralTypeIssues]

df.rolling(2)
df.rolling(2, axis=1, center=True)

check(
assert_type(df.rolling(2).agg("max"), pd.DataFrame),
Expand Down
37 changes: 30 additions & 7 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

from tests import (
PD_LTE_15,
PD_LTE_20,
TYPE_CHECKING_INVALID_USAGE,
check,
pytest_warns_bounded,
Expand Down Expand Up @@ -580,12 +581,13 @@ def test_types_plot() -> None:
def test_types_window() -> None:
s = pd.Series([0, 1, 1, 0, 5, 1, -10])
s.expanding()
s.expanding(axis=0)
if PD_LTE_20:
s.expanding(axis=0)
s.rolling(2, axis=0, center=True)
if TYPE_CHECKING_INVALID_USAGE:
s.expanding(axis=0, center=True) # type: ignore[call-arg] # pyright: ignore[reportGeneralTypeIssues]

s.rolling(2)
s.rolling(2, axis=0, center=True)

check(
assert_type(s.rolling(2).agg("sum"), pd.Series),
Expand Down Expand Up @@ -801,12 +803,33 @@ def test_types_bfill() -> None:

def test_types_ewm() -> None:
s1 = pd.Series([1, 2, 3])
w1: ExponentialMovingWindow = s1.ewm(
com=0.3, min_periods=0, adjust=False, ignore_na=True, axis=0
if PD_LTE_20:
check(
assert_type(
s1.ewm(com=0.3, min_periods=0, adjust=False, ignore_na=True, axis=0),
"ExponentialMovingWindow[pd.Series]",
),
ExponentialMovingWindow,
)
check(
assert_type(s1.ewm(alpha=0.4), "ExponentialMovingWindow[pd.Series]"),
ExponentialMovingWindow,
)
check(
assert_type(s1.ewm(span=1.6), "ExponentialMovingWindow[pd.Series]"),
ExponentialMovingWindow,
)
check(
assert_type(s1.ewm(halflife=0.7), "ExponentialMovingWindow[pd.Series]"),
ExponentialMovingWindow,
)
check(
assert_type(
s1.ewm(com=0.3, min_periods=0, adjust=False, ignore_na=True),
"ExponentialMovingWindow[pd.Series]",
),
ExponentialMovingWindow,
)
w2: ExponentialMovingWindow = s1.ewm(alpha=0.4)
w3: ExponentialMovingWindow = s1.ewm(span=1.6)
w4: ExponentialMovingWindow = s1.ewm(halflife=0.7)


def test_types_ffill() -> None:
Expand Down

0 comments on commit f16ac90

Please sign in to comment.