Skip to content

Commit

Permalink
DOC: update configuration for Sphinx 1.5 and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Mar 9, 2017
1 parent 663ac68 commit c3ec530
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', # default
'sphinx.ext.todo', 'sphinx.ext.pngmath', # default
'sphinx.ext.todo', 'sphinx.ext.imgmath', # default
'sphinx.ext.intersphinx', # http://sphinx.pocoo.org/ext/intersphinx.html
'numpydoc', # https://github.com/numpy/numpy/tree/master/doc/sphinxext
]
Expand Down Expand Up @@ -100,6 +100,9 @@
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['eelbrain.']

# Supress warnings for badges
suppress_warnings = ['image.nonlocal_uri']


# -- Custom Options -----------------------------------------------------------

Expand Down
23 changes: 14 additions & 9 deletions eelbrain/_data_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -7358,29 +7358,29 @@ class Sensor(Dimension):
Parameters
----------
locs : array-like (n_sensor, 3)
locs : array_like (n_sensor, 3)
list of sensor locations in ALS coordinates, i.e., for each sensor a
``(anterior, left, superior)`` coordinate triplet.
names : list of str
Sensor names, same order as ``locs`` (default is ``['0', '1', '2',
...]``).
sysname : str
Name of the sensor system.
proj2d:
proj2d : str
Default 2d projection (default is ``'z-root'``; for options see notes
below).
connectivity : array (n_edges, 2)
connectivity : array_like (n_edges, 2)
Sensor connectivity (optional).
Attributes
----------
channel_idx : dict
Dictionary mapping channel names to indexes.
locs : array, shape = (n_sensors, 3)
locs : array (n_sensors, 3)
Spatial position of all sensors.
names : list of str
Ordered list of sensor names.
x, y, z : array, len = n_sensors
x, y, z : array (n_sensors,)
Sensor position x, y and z coordinates.
Notes
Expand Down Expand Up @@ -7412,6 +7412,12 @@ def __init__(self, locs, names=None, sysname=None, proj2d='z root',
connectivity=None):
self.sysname = sysname
self.default_proj2d = self._interpret_proj(proj2d)
if connectivity is not None:
connectivity = np.asarray(connectivity)
if connectivity.shape != (len(connectivity), 2):
raise ValueError("connectivity requires shape (n_edges, 2), "
"got array with shape %s" %
(connectivity.shape,))
self._connectivity = connectivity

# 'z root' transformation fails with 32-bit floats
Expand Down Expand Up @@ -7458,8 +7464,7 @@ def __repr__(self):
def __len__(self):
return self.n

def __eq__(self, other):
"Based on having same sensor names"
def __eq__(self, other): # Based on equality of sensor names
return (Dimension.__eq__(self, other) and len(self) == len(other) and
all(n == no for n, no in zip(self.names, other.names)))

Expand All @@ -7482,7 +7487,7 @@ def _cluster_properties(self, x):
Parameters
----------
x : array of bool, (n_clusters, len(self))
x : array of bool (n_clusters, n_sensors)
The cluster extents, with different clusters stacked along the
first axis.
Expand Down Expand Up @@ -7568,7 +7573,7 @@ def from_sfp(cls, path=None, **kwargs):

@classmethod
def from_lout(cls, path=None, transform_2d=None, **kwargs):
"""Create a Sensor instance from a *.lout file"""
"""Create a Sensor instance from a ``*.lout`` file"""
kwargs['transform_2d'] = transform_2d
locs = []
names = []
Expand Down

0 comments on commit c3ec530

Please sign in to comment.