Skip to content

Commit

Permalink
address deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jul 2, 2024
1 parent 3064f57 commit be4f0d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions climpred/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,11 @@ def remove_seasonality(
>>> HindcastEnsemble.remove_seasonality(seasonality="month")
<climpred.HindcastEnsemble>
Initialized:
SST (init, lead, member) float64 -0.2349 -0.216 ... 0.6476 0.6433
SST (init, lead, member) float64 -0.2392 -0.2203 ... 0.618 0.6136
Uninitialized:
SST (time, member) float64 -0.1789 0.005732 -0.257 ... 0.4359 0.4154
SST (time, member) float64 -0.1969 -0.01221 -0.275 ... 0.4179 0.3974
Observations:
SST (time) float32 -0.3739 -0.3248 -0.1575 ... 0.2757 0.3736 0.4778
SST (time) float32 -0.4015 -0.3524 -0.1851 ... 0.2481 0.346 0.4502
"""

def _remove_seasonality(ds, initialized_dim="init", seasonality=None):
Expand Down
8 changes: 6 additions & 2 deletions climpred/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ def convert_init_lead_to_valid_time_lead(
[skill.sel(lead=lead).swap_dims({"init": "valid_time"}) for lead in skill.lead],
"lead",
)
return add_init_from_time_lead(swapped.drop("init")).dropna("valid_time", how="all")
return add_init_from_time_lead(swapped.drop_vars("init")).dropna(
"valid_time", how="all"
)


def convert_valid_time_lead_to_init_lead(
Expand Down Expand Up @@ -343,7 +345,9 @@ def convert_valid_time_lead_to_init_lead(
[skill.sel(lead=lead).swap_dims({"valid_time": "init"}) for lead in skill.lead],
"lead",
)
return add_time_from_init_lead(swapped.drop("valid_time")).dropna("init", how="all")
return add_time_from_init_lead(swapped.drop_vars("valid_time")).dropna(
"init", how="all"
)


def find_start_dates_for_given_init(control, single_init):
Expand Down

0 comments on commit be4f0d5

Please sign in to comment.