Skip to content

Commit

Permalink
STY, FIX: style fixes in model moudule
Browse files Browse the repository at this point in the history
Mostly just black formatting, adding docstring, and sorting imports
  • Loading branch information
scott-huberty committed Dec 21, 2023
1 parent 3421f6f commit a693189
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions eoglearn/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License: BSD-3-Clause

import matplotlib.pyplot as plt
import numpy as np
import mne
import numpy as np
from mne.utils import logger
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.layers import LSTM
Expand Down Expand Up @@ -34,6 +34,7 @@ class EOGDenoiser:
The number of timepoints to pass into the LSTM model at once. Defaults to 100.
noise_picks: list | None
Channels that contain the noise channels.
Attributes
----------
raw : mne.io.Raw
Expand Down Expand Up @@ -73,14 +74,7 @@ class EOGDenoiser:
on how to create a raw object with both EEG and eyetracking channels.
"""

def __init__(
self,
raw,
downsample=10,
n_units=50,
n_times=100,
noise_picks=None
):
def __init__(self, raw, downsample=10, n_units=50, n_times=100, noise_picks=None):
self.__x = None
self.__y = None
#############################################
Expand All @@ -106,6 +100,7 @@ def __init__(

@property
def denoised_neural(self):
"""Return the MEEG signal without EOG artifact."""
if self.__denoised_neural is None:
logger.info(
"Denoising neural data, saving to ``denoised_neural_`` attribute."
Expand Down Expand Up @@ -292,6 +287,7 @@ def compute_denoised_neural(self):
self.__denoised_neural = Y_train - predicted_eog

def get_denoised_neural_raw(self):
"""Return an mne.io.Raw object of the MEEG signal without EOG artifact."""
raw_y = self._get_y_raw()
raw_denoised = mne.io.RawArray(self.denoised_neural.T, raw_y.info)
raw_denoised.set_annotations(raw_y.annotations)
Expand Down

0 comments on commit a693189

Please sign in to comment.