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 807efee commit d3a6468
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions eye2bids/edf2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ 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('object')
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("object")
physioevents_eye1 = physioevents_eye1[physioevents_eye1.trial_type != "EBLINKL"]

physioevents_eye1 = physioevents_eye1[
["timestamp", "duration", "trial_type", "blink", "message"]
Expand All @@ -419,9 +419,9 @@ 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('object')
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("object")
physioevents_eye2 = physioevents_eye2[physioevents_eye2.trial_type != "EBLINKR"]

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", np.nan, np.nan, np.nan, "RECORD_START"]),
("satf", ["3209032", np.nan, np.nan, np.nan, "Calibration ended"]),
("vergence", ["819655", np.nan, np.nan, np.nan, "!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 d3a6468

Please sign in to comment.