diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2014-11-04 09:38:42 +0100 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2014-11-04 09:38:42 +0100 |
commit | 110d9c0e596c7a87fdc1c890e48732acd98375d7 (patch) | |
tree | 7370d465ff9fc83185a202a33033a50f0d16ce2d /pyspike/spikes.py | |
parent | 8b5b287a79f3b42ddfefdf30ecf435f77306cfb8 (diff) |
change "sort" parameter to "is_sorted"
Diffstat (limited to 'pyspike/spikes.py')
-rw-r--r-- | pyspike/spikes.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pyspike/spikes.py b/pyspike/spikes.py index 6b6e2e7..f7172c9 100644 --- a/pyspike/spikes.py +++ b/pyspike/spikes.py @@ -48,15 +48,16 @@ def add_auxiliary_spikes(spike_train, time_interval): ############################################################ # spike_train_from_string ############################################################ -def spike_train_from_string(s, sep=' ', sort=True): +def spike_train_from_string(s, sep=' ', is_sorted=False): """ Converts a string of times into an array of spike times. :param s: the string with (ordered) spike times :param sep: The separator between the time numbers, default=' '. - :param sort: If True, the spike times are order via `np.sort`, default=True + :param is_sorted: if True, the spike times are not sorted after loading, + if False, spike times are sorted with `np.sort` :returns: array of spike times """ - if sort: + if not(is_sorted): return np.sort(np.fromstring(s, sep=sep)) else: return np.fromstring(s, sep=sep) |