From 06659fed59d4769a137b132ac976105fcbf9b267 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:52:32 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- eye2bids/edf2bids.py | 20 ++++++++++---------- tests/test_edf2bids.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/eye2bids/edf2bids.py b/eye2bids/edf2bids.py index f041745..e274026 100644 --- a/eye2bids/edf2bids.py +++ b/eye2bids/edf2bids.py @@ -390,12 +390,12 @@ def _physioevents_eye1(physioevents_reordered: pd.DataFrame) -> pd.DataFrame: physioevents_eye1.iloc[i, physioevents_eye1.columns.get_loc("blink")] = 1 last_non_na_trial_type = current_trial_type - physioevents_eye1.loc[physioevents_eye1['trial_type'].isna(), 'blink'] = np.nan - physioevents_eye1['blink'] = physioevents_eye1['blink'].astype('Int64') - physioevents_eye1 = physioevents_eye1[physioevents_eye1.trial_type != 'EBLINKL'] + physioevents_eye1.loc[physioevents_eye1["trial_type"].isna(), "blink"] = np.nan + physioevents_eye1["blink"] = physioevents_eye1["blink"].astype("Int64") + physioevents_eye1 = physioevents_eye1[physioevents_eye1.trial_type != "EBLINKL"] - physioevents_eye1['timestamp']= physioevents_eye1['timestamp'].astype('Int64') - physioevents_eye1['duration']= physioevents_eye1['duration'].astype('Int64') + physioevents_eye1["timestamp"] = physioevents_eye1["timestamp"].astype("Int64") + physioevents_eye1["duration"] = physioevents_eye1["duration"].astype("Int64") physioevents_eye1 = physioevents_eye1[ ["timestamp", "duration", "trial_type", "blink", "message"] @@ -422,12 +422,12 @@ def _physioevents_eye2(physioevents_reordered: pd.DataFrame) -> pd.DataFrame: physioevents_eye2.iloc[i, physioevents_eye2.columns.get_loc("blink")] = 1 last_non_na_trial_type = current_trial_type - physioevents_eye2.loc[physioevents_eye2['trial_type'].isna(), 'blink'] = np.nan - physioevents_eye2['blink'] = physioevents_eye2['blink'].astype('Int64') - physioevents_eye2 = physioevents_eye2[physioevents_eye2.trial_type != 'EBLINKR'] + physioevents_eye2.loc[physioevents_eye2["trial_type"].isna(), "blink"] = np.nan + physioevents_eye2["blink"] = physioevents_eye2["blink"].astype("Int64") + physioevents_eye2 = physioevents_eye2[physioevents_eye2.trial_type != "EBLINKR"] - physioevents_eye2['timestamp']= physioevents_eye2['timestamp'].astype('Int64') - physioevents_eye2['duration']= physioevents_eye2['duration'].astype('Int64') + physioevents_eye2["timestamp"] = physioevents_eye2["timestamp"].astype("Int64") + physioevents_eye2["duration"] = physioevents_eye2["duration"].astype("Int64") physioevents_eye2 = physioevents_eye2[ ["timestamp", "duration", "trial_type", "blink", "message"] diff --git a/tests/test_edf2bids.py b/tests/test_edf2bids.py index 2dc067a..efcb7bb 100644 --- a/tests/test_edf2bids.py +++ b/tests/test_edf2bids.py @@ -657,7 +657,7 @@ def test_number_columns_physioevents_tsv(eyelink_test_data_dir): ("rest", [9199380, pd.NA, np.nan, pd.NA, "RECORD_START"]), ("satf", [3209032, pd.NA, np.nan, pd.NA, "Calibration ended"]), ("vergence", [819655, pd.NA, np.nan, pd.NA, "!MODE RECORD CR 1000 2 1 LR"]), - ("2eyes",[767985, 169, "fixation", 0, np.nan]) + ("2eyes", [767985, 169, "fixation", 0, np.nan]), ], ) def test_physioevents_value(folder, expected, eyelink_test_data_dir):