Skip to content

Commit

Permalink
Resolve all curent pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tennlee committed Aug 2, 2024
1 parent 11f8823 commit 0f55eb9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions src/scores/fast/fss/fss_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Backend for computing Fractions Skill Score (FSS) using numpy
"""

# pylint: disable=R0801

from dataclasses import dataclass

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion tests/categorical/test_contingency.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_str_view():
_stringrep = str(table)


def test_categorical_table():
def test_categorical_table(): # pylint: disable=too-many-statements
"""
Test the basic calculations of the contingency table
"""
Expand Down
16 changes: 8 additions & 8 deletions tests/continuous/test_consistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
DA_FCST = xr.DataArray(
data=[[3.0, 1.0, nan, 3.0], [-4.0, 0.0, 1.0, 3.0]],
dims=["date", "station"],
coords=dict(date=["1", "2"], station=[100, 101, 102, 104]),
coords={"date": ["1", "2"], "station": [100, 101, 102, 104]},
)

DA_OBS = xr.DataArray(
data=[[nan, 3.0, 5.0], [-4.0, 10.0, -1.0], [3.0, 2.0, -0.2]],
dims=["date", "station"],
coords=dict(date=["1", "2", "3"], station=[100, 101, 102]),
coords={"date": ["1", "2", "3"], "station": [100, 101, 102]},
)

WEIGHTS = DA_FCST * 0 + 2
Expand All @@ -41,13 +41,13 @@
EXP_EXPECTILE_SCORE1 = xr.DataArray(
data=[[nan, ALPHA * 4.0, nan], [0.0, ALPHA * 100, (1 - ALPHA) * 4]],
dims=["date", "station"],
coords=dict(date=["1", "2"], station=[100, 101, 102]),
coords={"date": ["1", "2"], "station": [100, 101, 102]},
)

EXP_EXPECTILE_SCORE2 = xr.DataArray(
data=[0.0, ALPHA * (4 + 100) / 2, (1 - ALPHA) * 4],
dims=["station"],
coords=dict(station=[100, 101, 102]),
coords={"station": [100, 101, 102]},
)
EXP_EXPECTILE_SCORE3 = xr.DataArray((ALPHA * 4.0 + ALPHA * 100 + (1 - ALPHA) * 4) / 4)

Expand All @@ -56,13 +56,13 @@
EXP_HUBER_SCORE1 = xr.DataArray(
data=[[nan, 2.0, nan], [0.0, 18.0, 2.0]],
dims=["date", "station"],
coords=dict(date=["1", "2"], station=[100, 101, 102]),
coords={"date": ["1", "2"], "station": [100, 101, 102]},
)

EXP_HUBER_SCORE2 = xr.DataArray(
data=[2.0, 20 / 3],
dims=["date"],
coords=dict(date=["1", "2"]),
coords={"date": ["1", "2"]},
)

EXP_HUBER_SCORE3 = xr.DataArray(
Expand All @@ -72,13 +72,13 @@
EXP_QUANTILE_SCORE1 = xr.DataArray(
data=[[nan, ALPHA * 2.0, nan], [0.0, ALPHA * 10, (1 - ALPHA) * 2]],
dims=["date", "station"],
coords=dict(date=["1", "2"], station=[100, 101, 102]),
coords={"date": ["1", "2"], "station": [100, 101, 102]},
)

EXP_QUANTILE_SCORE2 = xr.DataArray(
data=[ALPHA * 2.0, (ALPHA * 10 + (1 - ALPHA) * 2) / 3],
dims=["date"],
coords=dict(date=["1", "2"]),
coords={"date": ["1", "2"]},
)

EXP_QUANTILE_SCORE3 = xr.DataArray((ALPHA * 2.0 + ALPHA * 10 + (1 - ALPHA) * 2) / 4)
Expand Down
4 changes: 4 additions & 0 deletions tests/continuous/test_correlation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Tests for correlation calculations
"""

import numpy as np
import pytest
import xarray as xr
Expand Down
8 changes: 2 additions & 6 deletions tests/processing/cdf/functions_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,13 @@
EXP_ADD_THRESHOLDS1 = xr.DataArray(
data=[[[0.2, 0.4, 1, 1, 1], [0, 0, 0.6, 0.8, 1]]],
dims=["date", "station", "x"],
coords=dict(
station=[1001, 1002], date=["2020-01-01"], x=[0, 0.2, 0.5, 0.75, 1]
), # pylint: disable=use-dict-literal
coords={"station": [1001, 1002], "date": ["2020-01-01"], "x": [0, 0.2, 0.5, 0.75, 1]},
)

EXP_ADD_THRESHOLDS2 = xr.DataArray(
data=[[[0.2, 0.4, 1, np.nan, 1], [0, 0, 0.6, np.nan, 1]]],
dims=["date", "station", "x"],
coords=dict(
station=[1001, 1002], date=["2020-01-01"], x=[0, 0.2, 0.5, 0.75, 1]
), # pylint: disable=use-dict-literal
coords={"station": [1001, 1002], "date": ["2020-01-01"], "x": [0, 0.2, 0.5, 0.75, 1]},
)

DA_DECREASING_CDFS1 = xr.DataArray(
Expand Down

0 comments on commit 0f55eb9

Please sign in to comment.