Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 14, 2024
1 parent 61b3908 commit 06659fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions eye2bids/edf2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_edf2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 06659fe

Please sign in to comment.