Skip to content

Commit

Permalink
Merge branch 'main' into r/0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Nov 18, 2022
2 parents 1187892 + 48e4801 commit cfc5930
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def section_order(self):
'colormaps.py',
'customizing.py',
],
'deconvolution': [
'temporal-response-functions': [
'trf_intro.py',
'mtrf.py',
'partitions.py',
Expand Down
2 changes: 1 addition & 1 deletion doc/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Once set up, an :class:`MneExperiment` subclass instance provides access into th
An :class:`MneExperiment` instance has a state, which determines what data and settings it is currently using. Not all settings are always relevant. For example, :ref:`state-subject` is relevenat for steps applied separately to each subject, like :meth:`~MneExperiment.make_ica_selection`, whereas :ref:`state-group` defines the group of subjects in group level analysis, such as in :meth:`~MneExperiment.load_test`. For more information, see :ref:`state-parameters`.


Step by step
Step by Step
============

.. contents:: Contents
Expand Down
6 changes: 3 additions & 3 deletions doc/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ functions. See also :class:`NDVar` methods.
xhemi


^^^^^^^^^^^^^
Deconvolution
^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Temporal Response Functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autosummary::
:toctree: generated
Expand Down
11 changes: 4 additions & 7 deletions eelbrain/_experiment/mne_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3562,7 +3562,7 @@ def _load_result_plotter(self, test, tstart, tstop, pmin, parc=None,
State parameters.
"""
if data != 'source':
raise NotImplementedError("data=%s" % repr(data))
raise NotImplementedError(f"{data=}")
elif not isinstance(pmin, float):
raise NotImplementedError("Threshold-free tests")

Expand All @@ -3573,8 +3573,7 @@ def _load_result_plotter(self, test, tstart, tstop, pmin, parc=None,
if dst is None:
dst = self.get('res-plot-dir', mkdir=True)

return ClusterPlotter(ds, res, colors, dst, vec_fmt, pix_fmt, labels, h,
rc)
return ClusterPlotter(ds, res, colors, dst, vec_fmt, pix_fmt, labels, h, rc)

def load_selected_events(self, subjects=None, reject=True, add_bads=True,
index=True, data_raw=False, vardef=None, cat=None,
Expand Down Expand Up @@ -4627,11 +4626,9 @@ def make_mov_ga_dspm(self, subjects=None, baseline=True, src_baseline=False,
state['model'] = ''
subject, group = self._process_subject_arg(subjects, state)
data = TestDims("source", morph=bool(group))
brain_kwargs = self._surfer_plot_kwargs(surf, views, foreground, background,
smoothing_steps, hemi)
brain_kwargs = self._surfer_plot_kwargs(surf, views, foreground, background, smoothing_steps, hemi)
self._set_analysis_options(data, baseline, src_baseline, None, None, None)
self.set(equalize_evoked_count='',
resname="GA dSPM %s %s" % (brain_kwargs['surf'], fmin))
self.set(equalize_evoked_count='', resname=f"GA dSPM {brain_kwargs['surf']} {fmin}")

if dst is None:
if group is None:
Expand Down
7 changes: 4 additions & 3 deletions eelbrain/_stats/spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class LM:
Model parametrization (default is dummy coding). Vars are centered for
effect coding (but not for dummy coding).
subject : str
Optional information used by :class:`LMGroup`.
Optional information used by :class:`LMGroup`; if subject is a column in
``ds`` it will be extracted automatically.
sub : index
Only use part of the data.
Expand Down Expand Up @@ -59,7 +60,7 @@ def __init__(self, y, model, ds=None, coding='dummy', subject=None, sub=None):
# subject
if subject is not None:
if not isinstance(subject, str):
raise TypeError(f"subject={subject!r}: needs to be string or None")
raise TypeError(f"{subject=}: needs to be string or None")
variables['subject'] = subject
self.coding = coding
self._coeffs_flat = b.reshape((len(b), -1))
Expand Down Expand Up @@ -99,7 +100,7 @@ def __getstate__(self):

def __repr__(self):
y = self._y or '<?>'
return f"<LM: {y} ~ {self.model.name}>"
return f"<LM: {y} ~ {self.model.name}, {self.subject}>"

def _coefficient(self, term):
"""Regression coefficient for a given term"""
Expand Down
2 changes: 1 addition & 1 deletion eelbrain/_trf/_predictors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Predictors for deconvolution"""
"""Predictors for continuous data"""
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from itertools import repeat

Expand Down
2 changes: 1 addition & 1 deletion eelbrain/datasets/_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_continuous(
seed: int = 0,
xn: int = 0,
) -> Dataset:
"""Generate continuous data for deconvolution tests
"""Generate continuous data for temporal response function tests
Parameters
----------
Expand Down
3 changes: 0 additions & 3 deletions examples/deconvolution/README.txt

This file was deleted.

2 changes: 1 addition & 1 deletion examples/mass-univariate-statistics/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^
Mass-univariate statistics
Mass-Univariate Statistics
^^^^^^^^^^^^^^^^^^^^^^^^^^

:class:`NDVar`, n-dimensional variables, allow mass-univariate statistics
Expand Down
3 changes: 3 additions & 0 deletions examples/temporal-response-functions/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Temporal Response Functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
plot.Array(spectrogram, xlim=5, w=6, h=2)

###############################################################################
# Plot the envelope used as stimulus representation for deconvolution:
# Plot the envelope used as stimulus representation for TRFs:
plot.UTS(envelope, xlim=5, w=6, h=2)

###############################################################################
Expand All @@ -53,8 +53,8 @@
p.set_time(1.200)

###############################################################################
# Deconvolution
# -------------
# TRF estimation
# --------------
# TRF for the envelope using boosting:
#
# - TRF from -100 to 400 ms
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit cfc5930

Please sign in to comment.