diff --git a/py.typed b/py.typed index e69de29b..8d1c8b69 100644 --- a/py.typed +++ b/py.typed @@ -0,0 +1 @@ + diff --git a/src/scores/fast/fss/fss_numpy.py b/src/scores/fast/fss/fss_numpy.py index 57cda822..5979f0a3 100644 --- a/src/scores/fast/fss/fss_numpy.py +++ b/src/scores/fast/fss/fss_numpy.py @@ -2,6 +2,8 @@ Backend for computing Fractions Skill Score (FSS) using numpy """ +# pylint: disable=R0801 + from dataclasses import dataclass import numpy as np diff --git a/tests/categorical/test_contingency.py b/tests/categorical/test_contingency.py index b175073b..9d86e385 100644 --- a/tests/categorical/test_contingency.py +++ b/tests/categorical/test_contingency.py @@ -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 """ diff --git a/tests/continuous/test_consistent.py b/tests/continuous/test_consistent.py index e2723668..9dd176bb 100644 --- a/tests/continuous/test_consistent.py +++ b/tests/continuous/test_consistent.py @@ -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 @@ -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) @@ -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( @@ -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) diff --git a/tests/continuous/test_correlation.py b/tests/continuous/test_correlation.py index c100b95e..faa40c07 100644 --- a/tests/continuous/test_correlation.py +++ b/tests/continuous/test_correlation.py @@ -1,3 +1,7 @@ +""" +Tests for correlation calculations +""" + import numpy as np import pytest import xarray as xr diff --git a/tests/processing/cdf/functions_test_data.py b/tests/processing/cdf/functions_test_data.py index ad42c13e..7905634e 100644 --- a/tests/processing/cdf/functions_test_data.py +++ b/tests/processing/cdf/functions_test_data.py @@ -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(