From e9220dbd03addb57930d9131c2fb5a56bd2cca08 Mon Sep 17 00:00:00 2001 From: Benjamin Pettit Date: Sun, 7 Jun 2026 21:32:23 +1000 Subject: [PATCH] Fix check_report for pandas >=2.0: Series.iteritems() -> .items() Series.iteritems() was deprecated in pandas 1.5 and removed in 2.0. .items() yields the same (index, value) pairs and has existed since well before the project's pandas>=1.1.4 floor, so it works on both old and new pandas. This was the only pandas-2.0-incompatible call in the package: .iterrows() is unaffected (not removed), and the .append() uses are all on lists / np.append. --- eegnb/analysis/streaming_utils.py | 4 ++-- eegnb/analysis/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eegnb/analysis/streaming_utils.py b/eegnb/analysis/streaming_utils.py index 79ba66858..605ed10ba 100644 --- a/eegnb/analysis/streaming_utils.py +++ b/eegnb/analysis/streaming_utils.py @@ -170,13 +170,13 @@ def check_report(eeg: EEG, n_times: int=60, pause_time=5, thres_std_low=None, th indicators = "\n".join( [ f" {k:>4}: {CHECKMARK if v >= thres_std_low and v <= thres_std_high else CROSS} (std: {round(v, 1):>5})" - for k, v in std_series.iteritems() + for k, v in std_series.items() ] ) print("\nSignal quality:") print(indicators) - bad_channels = [k for k, v in std_series.iteritems() if v < thres_std_low or v > thres_std_high ] + bad_channels = [k for k, v in std_series.items() if v < thres_std_low or v > thres_std_high ] if bad_channels: print(f"Bad channels: {', '.join(bad_channels)}") good_count=0 # reset good checks count if there are any bad chans diff --git a/eegnb/analysis/utils.py b/eegnb/analysis/utils.py index d9450981d..eaf2fba64 100644 --- a/eegnb/analysis/utils.py +++ b/eegnb/analysis/utils.py @@ -507,13 +507,13 @@ def check_report(eeg: EEG, n_times: int=60, pause_time=5, thres_std_low=None, th indicators = "\n".join( [ f" {k:>4}: {CHECKMARK if v >= thres_std_low and v <= thres_std_high else CROSS} (std: {round(v, 1):>5})" - for k, v in std_series.iteritems() + for k, v in std_series.items() ] ) print("\nSignal quality:") print(indicators) - bad_channels = [k for k, v in std_series.iteritems() if v < thres_std_low or v > thres_std_high ] + bad_channels = [k for k, v in std_series.items() if v < thres_std_low or v > thres_std_high ] if bad_channels: print(f"Bad channels: {', '.join(bad_channels)}") good_count=0 # reset good checks count if there are any bad chans