-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
7,548 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# | ||
# Created: 2019-01-07 09:22:33 | ||
# Last modified by: Stefan Fuertinger [[email protected]] | ||
# Last modification time: <2019-09-25 16:57:28> | ||
# Last modification time: <2019-10-08 14:08:32> | ||
|
||
# Builtin/3rd party package imports | ||
import getpass | ||
|
@@ -1163,6 +1163,8 @@ class FauxTrial(): | |
must slice `data` correctly so that ``obj.data[idx] == obj.trials[k]`` | ||
dtype : :class:`numpy.dtype` | ||
Datatype of source trial array | ||
dimord : list | ||
Dimensional order of source trial array | ||
Returns | ||
------- | ||
|
@@ -1178,10 +1180,11 @@ class FauxTrial(): | |
syncopy.continuous_data.ContinuousData._preview_trial : makes use of this class | ||
""" | ||
|
||
def __init__(self, shape, idx, dtype): | ||
def __init__(self, shape, idx, dtype, dimord): | ||
self.shape = tuple(shape) | ||
self.idx = tuple(idx) | ||
self.dtype = dtype | ||
self.dimord = dimord | ||
|
||
def __str__(self): | ||
msg = "Trial placeholder of shape {} and datatype {}" | ||
|
@@ -1198,15 +1201,15 @@ def squeeze(self): | |
shp = list(self.shape) | ||
while 1 in shp: | ||
shp.remove(1) | ||
return FauxTrial(shp, self.idx, self.dtype) | ||
return FauxTrial(shp, self.idx, self.dtype, self.dimord) | ||
|
||
@property | ||
def T(self): | ||
""" | ||
Return a new `FauxTrial` instance with reversed dimensions | ||
(parroting the NumPy original :func:`numpy.transpose`) | ||
""" | ||
return FauxTrial(self.shape[::-1], self.idx[::-1], self.dtype) | ||
return FauxTrial(self.shape[::-1], self.idx[::-1], self.dtype, self.dimord[::-1]) | ||
|
||
|
||
class Selector(): | ||
|
@@ -1418,7 +1421,7 @@ def trials(self, dataselect): | |
except Exception as exc: | ||
raise exc | ||
if not set(trials).issubset(trlList): | ||
lgl = "List/array of values b/w 0 and {}".format(trlList[-1]) | ||
lgl = "list/array of values b/w 0 and {}".format(trlList[-1]) | ||
act = "Values b/w {} and {}".format(min(trials), max(trials)) | ||
raise SPYValueError(legal=lgl, varname=vname, actual=act) | ||
self._trials = trials | ||
|
@@ -1748,7 +1751,7 @@ def _selection_setter(self, data, select, dataprop, selectkey): | |
else: | ||
targetArr = np.arange(target.size) | ||
if not set(selection).issubset(targetArr): | ||
lgl = "List/array of {} names or indices".format(dataprop) | ||
lgl = "list/array of {} existing names or indices".format(dataprop) | ||
raise SPYValueError(legal=lgl, varname=vname) | ||
|
||
# Preserve order and duplicates of selection - don't use `np.isin` here! | ||
|
Oops, something went wrong.