From 18d1db8bf690be7f6d1e86585dd5d3e7f863c4da Mon Sep 17 00:00:00 2001 From: Moritz Makowski Date: Fri, 2 Aug 2024 14:00:17 +0000 Subject: [PATCH] Fix mypy issues --- src/export/dataframes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/export/dataframes.py b/src/export/dataframes.py index a8323f14..6e652917 100644 --- a/src/export/dataframes.py +++ b/src/export/dataframes.py @@ -209,7 +209,7 @@ def post_process_dataframe( # apply savgol_filter on the data columns df = df.select( pl.col("utc"), - pl.exclude("utc").map( + pl.exclude("utc").map_batches( lambda x: scipy.signal.savgol_filter(x.to_numpy(), 31, 3).tolist() ).list.explode(), ) @@ -231,7 +231,7 @@ def post_process_dataframe( pl.exclude(["small_gap"]).interpolate() ).otherwise(pl.exclude(["small_gap"])) ).select(pl.exclude("small_gap") - ).sort("utc").groupby_dynamic("utc", every=sampling_rate).agg( + ).sort("utc").group_by_dynamic("utc", every=sampling_rate).agg( pl.exclude("utc").mean() ) ) @@ -243,7 +243,7 @@ def merge_dataframes(dfs: list[pl.DataFrame], ) -> pl.DataFrame: """Merges the dataframes into a single dataframe by joining them on the "utc" column.""" - merged_df = pl.concat(dfs, how="diagonal").groupby("utc").mean() + merged_df = pl.concat(dfs, how="diagonal").group_by("utc").mean() data_column_names = merged_df.columns data_column_names.remove("utc") df_without_null_rows = merged_df.filter(