From 110d9c0e596c7a87fdc1c890e48732acd98375d7 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Tue, 4 Nov 2014 09:38:42 +0100 Subject: change "sort" parameter to "is_sorted" --- pyspike/spikes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pyspike/spikes.py') 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) -- cgit v1.2.3