From 0340f30f965830f7aa783925c4f19d87eccb09b3 Mon Sep 17 00:00:00 2001 From: Cai Wingfield Date: Mon, 15 Jan 2024 13:19:01 +0000 Subject: [PATCH] Clean up style --- kymata/gridsearch/plain.py | 5 ++--- kymata/io/mne.py | 11 ++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/kymata/gridsearch/plain.py b/kymata/gridsearch/plain.py index 924b1d4f..18db7168 100644 --- a/kymata/gridsearch/plain.py +++ b/kymata/gridsearch/plain.py @@ -6,7 +6,6 @@ from kymata.math.combinatorics import generate_derangement from kymata.math.vector import normalize, get_stds from kymata.entities.expression import ExpressionSet, SensorExpressionSet, HexelExpressionSet, p_to_logp, log_base -import matplotlib.pyplot as plt def do_gridsearch( @@ -95,8 +94,8 @@ def do_gridsearch( ) elif channel_space == "source": es = HexelExpressionSet( - functions=function.name + f"_mirrored_{handed}", # TODO: revert to just `function.name` when we - # have both hemispheres in place + functions=function.name + f"_mirrored-lh", # TODO: revert to just `function.name` when we + # have both hemispheres in place latencies=latencies_ms / 1000, # seconds hexels=channel_names, data_lh=log_pvalues, diff --git a/kymata/io/mne.py b/kymata/io/mne.py index 5cb4bc13..6d320c52 100644 --- a/kymata/io/mne.py +++ b/kymata/io/mne.py @@ -1,12 +1,8 @@ -from pathlib import Path - from mne import read_evokeds, minimum_norm, set_eeg_reference import numpy as np from numpy.typing import NDArray from os.path import isfile -from kymata.io.file import path_type - def load_single_emeg(emeg_path, need_names=False, inverse_operator=None, snr=4): emeg_path_npy = f"{emeg_path}.npy" @@ -18,16 +14,13 @@ def load_single_emeg(emeg_path, need_names=False, inverse_operator=None, snr=4): evoked = read_evokeds(emeg_path_fif, verbose=False) # should be len 1 list if inverse_operator is not None: lh_emeg, rh_emeg, ch_names = inverse_operate(evoked[0], inverse_operator, snr) - # TODO: I think ch_names here is the wrong thing - - emeg = None #np.concatenate((lh_emeg, rh_emeg), axis=0) + # TODO: I think ch_names here is the wrong thing # TODO: currently this goes OOM (node-h04 atleast): # looks like this will be faster when split up anyway # note, don't run the inv_op twice for rh and lh! # TODO: move inverse operator to run after EMEG channel combination - - emeg = lh_emeg + emeg = lh_emeg #np.concatenate((lh_emeg, rh_emeg), axis=0) del lh_emeg, rh_emeg else: emeg = evoked[0].get_data() # numpy array shape (sensor_num, N) = (370, 403_001)