Skip to content

Commit

Permalink
Changes trends_min_yrs names in tests. Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dulte committed Jul 18, 2024
1 parent bd5b7a6 commit 2e35fd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyaerocom/aeroval/setupclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ class StatisticsSetup(BaseModel, extra="allow"):
avg_over_trends: bool = (
False # Adds calculation of avg over trends of time series of stations in region
)
obs_min_yrs: PositiveInt = 0 # Removes stations with less than this number of years of valid data (a year with data points in all four seasons) Should in most cases be the same as min_yrs
stats_min_yrs: PositiveInt = obs_min_yrs # Calculates trends if number of valid years are equal or more than this. Should in most cases be the same as min_yrs
obs_min_yrs: PositiveInt = 0 # Removes stations with less than this number of years of valid data (a year with data points in all four seasons) Should in most cases be the same as stats_min_yrs
stats_min_yrs: PositiveInt = obs_min_yrs # Calculates trends if number of valid years are equal or more than this. Should in most cases be the same as obs_min_yrs
sequential_yrs: bool = False # Whether or not the min_yrs should be sequential

stats_tseries_base_freq: str | None = None
Expand Down
12 changes: 6 additions & 6 deletions tests/aeroval/test_setupclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_EvalSetup_EvalRunOptions(eval_setup: EvalSetup, cfg_exp1: dict, update:
pytest.param(None, id="default"),
pytest.param(
dict(
trends_min_yrs=10,
stats_min_yrs=10,
use_diurnal=True,
use_fairmode=True,
weighted_stats=False,
Expand All @@ -207,9 +207,9 @@ def test_EvalSetup_StatisticsSetup(eval_setup: EvalSetup, cfg_exp1: dict, update
statistics_opts = eval_setup.statistics_opts
if update:
assert (
statistics_opts.trends_min_yrs
== cfg_exp1["trends_min_yrs"]
== update["trends_min_yrs"]
statistics_opts.stats_min_yrs
== cfg_exp1["stats_min_yrs"]
== update["stats_min_yrs"]
)
assert statistics_opts.use_diurnal == cfg_exp1["use_diurnal"] == update["use_diurnal"]
assert statistics_opts.use_fairmode == cfg_exp1["use_fairmode"] == update["use_fairmode"]
Expand All @@ -235,8 +235,8 @@ def test_EvalSetup_StatisticsSetup(eval_setup: EvalSetup, cfg_exp1: dict, update
== update["annual_stats_constrained"]
)
else: # defaults
assert "trends_min_yrs" not in cfg_exp1
assert statistics_opts.trends_min_yrs == 0
assert "stats_min_yrs" not in cfg_exp1
assert statistics_opts.stats_min_yrs == 0
assert "use_diurnal" not in cfg_exp1
assert statistics_opts.use_diurnal is False
assert "use_fairmode" not in cfg_exp1
Expand Down

0 comments on commit 2e35fd3

Please sign in to comment.