diff --git a/sed/core/dfops.py b/sed/core/dfops.py index 4f0558fd..ecef954f 100644 --- a/sed/core/dfops.py +++ b/sed/core/dfops.py @@ -152,7 +152,7 @@ def forward_fill_lazy( Allows forward filling between partitions. This is useful for dataframes that have sparse data, such as those with many NaNs. - Runnin the forward filling multiple times can fix the issue of having + Runnin the forward filling multiple times can fix the issue of having entire partitions consisting of NaNs. By default we run this twice, which is enough to fix the issue for dataframes with no consecutive partitions of NaNs. @@ -186,7 +186,7 @@ def forward_fill_partition(df): elif not isinstance(before, int): raise TypeError('before must be an integer or "max"') # Use map_overlap to apply forward_fill_partition - for i in range(iterations): + for _ in range(iterations): df = df.map_overlap( forward_fill_partition, before=before, diff --git a/sed/loader/flash/loader.py b/sed/loader/flash/loader.py index 8387ba2a..3a2a785c 100644 --- a/sed/loader/flash/loader.py +++ b/sed/loader/flash/loader.py @@ -742,7 +742,7 @@ def parquet_handler( channels=channels, before='max', compute_lengths=True, - iterations=self.config['dataframe'].get('forward_fill_iterations',2), + iterations=self._config['dataframe'].get('forward_fill_iterations', 2), ) # Remove the NaNs from per_electron channels dataframe = dataframe.dropna( diff --git a/tests/test_dfops.py b/tests/test_dfops.py index 36627a5e..fabb9236 100644 --- a/tests/test_dfops.py +++ b/tests/test_dfops.py @@ -128,7 +128,7 @@ def test_forward_fill_lazy_compute(): def test_forward_fill_lazy_keep_head_nans(): - """ test that a lazy forward fill works as expected with missing values at the + """ test that a lazy forward fill works as expected with missing values at the beginning of the dataframe""" t_df = df.copy() t_df['energy'][:5] = np.nan