From 1abd1a0b949b4ac05fc223d1972fea6eca4f596b Mon Sep 17 00:00:00 2001 From: bendichter Date: Thu, 7 Sep 2023 17:54:22 +0200 Subject: [PATCH 1/4] correct typo: dictionnary -> dictionary --- docs/examples/tutorial_pynapple_core.py | 2 +- docs/examples/tutorial_pynapple_io.py | 2 +- docs/examples/tutorial_pynapple_quick_start.py | 4 ++-- docs/old_notebooks/pynapple-core-notebook.ipynb | 2 +- docs/old_notebooks/pynapple-io-notebook.ipynb | 2 +- docs/old_notebooks/pynapple-quick-start.ipynb | 2 +- pynapple/core/ts_group.py | 6 +++--- pynapple/io/folder.py | 2 +- pynapple/io/interface_npz.py | 2 +- pynapple/io/misc.py | 2 +- pynapple/process/decoding.py | 2 +- pynapple/process/perievent.py | 4 ++-- pynapple/process/tuning_curves.py | 6 +++--- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/examples/tutorial_pynapple_core.py b/docs/examples/tutorial_pynapple_core.py index b9433b65..2eb1cf46 100644 --- a/docs/examples/tutorial_pynapple_core.py +++ b/docs/examples/tutorial_pynapple_core.py @@ -146,7 +146,7 @@ my_ts = { 0: nap.Ts( t=np.sort(np.random.uniform(0, 100, 10)), time_units="s" - ), # here a simple dictionnary + ), # here a simple dictionary 1: nap.Ts(t=np.sort(np.random.uniform(0, 100, 20)), time_units="s"), 2: nap.Ts(t=np.sort(np.random.uniform(0, 100, 30)), time_units="s"), } diff --git a/docs/examples/tutorial_pynapple_io.py b/docs/examples/tutorial_pynapple_io.py index b44abe73..740b804d 100644 --- a/docs/examples/tutorial_pynapple_io.py +++ b/docs/examples/tutorial_pynapple_io.py @@ -47,7 +47,7 @@ # %% # Here it shows all the subjects (in this case only A2929), all the sessions and all of the derivatives folders. It shows as well all the NPZ files that contains a pynapple object and the NWB files. # -# The object project behaves like a nested dictionnary. It is then easy to loop and navigate through a hierarchy of folders when doing analyses. In this case, we are gonna take only the session A2929-200711. +# The object project behaves like a nested dictionary. It is then easy to loop and navigate through a hierarchy of folders when doing analyses. In this case, we are gonna take only the session A2929-200711. session = project["sub-A2929"]["ses-A2929-200711"] diff --git a/docs/examples/tutorial_pynapple_quick_start.py b/docs/examples/tutorial_pynapple_quick_start.py index 653e2757..9bd6efcb 100644 --- a/docs/examples/tutorial_pynapple_quick_start.py +++ b/docs/examples/tutorial_pynapple_quick_start.py @@ -67,7 +67,7 @@ print(spikes) # %% -# In this case, the TsGroup holds 15 neurons and it is possible to access, similar to a dictionnary, the spike times of a single neuron: +# In this case, the TsGroup holds 15 neurons and it is possible to access, similar to a dictionary, the spike times of a single neuron: neuron_0 = spikes[0] print(neuron_0) @@ -75,7 +75,7 @@ # *neuron_0* is a [Ts](https://pynapple-org.github.io/pynapple/core.time_series/#pynapple.core.time_series.Ts) object containing the times of the spikes. # %% -# The other information about the session is contained in `nwb["epochs"]`. In this case, the start and end of the sleep and wake epochs. If the NWB time intervals contains tags of the epochs, pynapple will try to group them together and return a dictionnary of IntervalSet instead of IntervalSet. +# The other information about the session is contained in `nwb["epochs"]`. In this case, the start and end of the sleep and wake epochs. If the NWB time intervals contains tags of the epochs, pynapple will try to group them together and return a dictionary of IntervalSet instead of IntervalSet. epochs = nwb["epochs"] print(epochs) diff --git a/docs/old_notebooks/pynapple-core-notebook.ipynb b/docs/old_notebooks/pynapple-core-notebook.ipynb index 1426ae86..aa0954bf 100644 --- a/docs/old_notebooks/pynapple-core-notebook.ipynb +++ b/docs/old_notebooks/pynapple-core-notebook.ipynb @@ -484,7 +484,7 @@ "source": [ "time_support = nap.IntervalSet(start = 0, end = 200, time_units = 's')\n", "\n", - "my_ts = {0:nap.Ts(t = np.sort(np.random.uniform(0, 100, 10)), time_units = 's'), # here a simple dictionnary\n", + "my_ts = {0:nap.Ts(t = np.sort(np.random.uniform(0, 100, 10)), time_units = 's'), # here a simple dictionary\n", " 1:nap.Ts(t = np.sort(np.random.uniform(0, 100, 20)), time_units = 's'),\n", " 2:nap.Ts(t = np.sort(np.random.uniform(0, 100, 30)), time_units = 's')}\n", "\n", diff --git a/docs/old_notebooks/pynapple-io-notebook.ipynb b/docs/old_notebooks/pynapple-io-notebook.ipynb index 6d0e6575..bdbd0303 100644 --- a/docs/old_notebooks/pynapple-io-notebook.ipynb +++ b/docs/old_notebooks/pynapple-io-notebook.ipynb @@ -134,7 +134,7 @@ "source": [ "Here it shows all the subjects (in this case only A2929), all the sessions and all of the derivatives folders. It shows as well all the NPZ files that contains a pynapple object and the NWB files.\n", "\n", - "The object project behaves like a nested dictionnary. It is then easy to loop and navigate through a hierarchy of folders when doing analyses. In this case, we are gonna take only the session A2929-200711." + "The object project behaves like a nested dictionary. It is then easy to loop and navigate through a hierarchy of folders when doing analyses. In this case, we are gonna take only the session A2929-200711." ] }, { diff --git a/docs/old_notebooks/pynapple-quick-start.ipynb b/docs/old_notebooks/pynapple-quick-start.ipynb index 63ae7c17..4b85da5f 100644 --- a/docs/old_notebooks/pynapple-quick-start.ipynb +++ b/docs/old_notebooks/pynapple-quick-start.ipynb @@ -125,7 +125,7 @@ "source": [ "*spikes* is a [TsGroup](https://peyrachelab.github.io/pynapple/core.ts_group/) object. It allows to group together time series with different timestamps and couple metainformation to each neuron. In this case, the location of where the neuron was recorded has been added when loading the session for the first time.\n", "\n", - "In this case, the TsGroup holds 15 neurons and it is possible to access, similar to a dictionnary, the spike times of a single neuron: " + "In this case, the TsGroup holds 15 neurons and it is possible to access, similar to a dictionary, the spike times of a single neuron: " ] }, { diff --git a/pynapple/core/ts_group.py b/pynapple/core/ts_group.py index c1861afa..534e6e64 100644 --- a/pynapple/core/ts_group.py +++ b/pynapple/core/ts_group.py @@ -58,7 +58,7 @@ def union_intervals(i_sets): class TsGroup(UserDict): """ - The TsGroup is a dictionnary-like object to hold multiple [`Ts`][pynapple.core.time_series.Ts] or [`Tsd`][pynapple.core.time_series.Tsd] objects with different time index. + The TsGroup is a dictionary-like object to hold multiple [`Ts`][pynapple.core.time_series.Ts] or [`Tsd`][pynapple.core.time_series.Tsd] objects with different time index. Attributes ---------- @@ -88,7 +88,7 @@ def __init__( Useful to speed up initialization of TsGroup when Ts/Tsd objects have already been restricted beforehand **kwargs Meta-info about the Ts/Tsd objects. Can be either pandas.Series or numpy.ndarray. - Note that the index should match the index of the input dictionnary. + Note that the index should match the index of the input dictionary. Raises ------ @@ -812,7 +812,7 @@ def getby_category(self, key): Returns ------- dict - A dictionnary of TsGroup + A dictionary of TsGroup Examples -------- diff --git a/pynapple/io/folder.py b/pynapple/io/folder.py index c3b7972f..846cf55a 100644 --- a/pynapple/io/folder.py +++ b/pynapple/io/folder.py @@ -170,7 +170,7 @@ def __getitem__(self, key): Raises ------ KeyError - If key is not in the dictionnary + If key is not in the dictionary """ if key.__hash__: if self.__contains__(key): diff --git a/pynapple/io/interface_npz.py b/pynapple/io/interface_npz.py index a94014a4..53ee6218 100644 --- a/pynapple/io/interface_npz.py +++ b/pynapple/io/interface_npz.py @@ -9,7 +9,7 @@ """ File classes help to validate and load pynapple objects or NWB files. Data are always lazy-loaded. -Both classes behaves like dictionnary. +Both classes behaves like dictionary. """ import os diff --git a/pynapple/io/misc.py b/pynapple/io/misc.py index 1bec674f..36c9614f 100644 --- a/pynapple/io/misc.py +++ b/pynapple/io/misc.py @@ -69,7 +69,7 @@ def load_folder(path): Returns ------- Folder - A dictionnary-like class containing all the sub-folders and compatible files (i.e. npz, nwb) + A dictionary-like class containing all the sub-folders and compatible files (i.e. npz, nwb) Raises ------ diff --git a/pynapple/process/decoding.py b/pynapple/process/decoding.py index c217f3e9..b47aff37 100644 --- a/pynapple/process/decoding.py +++ b/pynapple/process/decoding.py @@ -128,7 +128,7 @@ def decode_2d(tuning_curves, group, ep, bin_size, xy, time_units="s", features=N tuning_curves : dict Dictionnay of 2d tuning curves (one for each neuron). group : TsGroup or dict of Ts/Tsd object. - A group of neurons with the same keys as tuning_curves dictionnary. + A group of neurons with the same keys as tuning_curves dictionary. ep : IntervalSet The epoch on which decoding is computed bin_size : float diff --git a/pynapple/process/perievent.py b/pynapple/process/perievent.py index 37e7e98c..9b99d64e 100644 --- a/pynapple/process/perievent.py +++ b/pynapple/process/perievent.py @@ -62,7 +62,7 @@ def compute_perievent(data, tref, minmax, time_unit="s"): data : Ts/Tsd/TsGroup The data to align to tref. If Ts/Tsd, returns a TsGroup. - If TsGroup, returns a dictionnary of TsGroup + If TsGroup, returns a dictionary of TsGroup tref : Ts/Tsd The timestamps of the event to align to minmax : tuple or int or float @@ -74,7 +74,7 @@ def compute_perievent(data, tref, minmax, time_unit="s"): ------- dict A TsGroup if data is a Ts/Tsd or - a dictionnary of TsGroup if data is a TsGroup. + a dictionary of TsGroup if data is a TsGroup. Raises ------ diff --git a/pynapple/process/tuning_curves.py b/pynapple/process/tuning_curves.py index 431ef646..89bdf341 100644 --- a/pynapple/process/tuning_curves.py +++ b/pynapple/process/tuning_curves.py @@ -17,12 +17,12 @@ def compute_discrete_tuning_curves(group, dict_ep): """ - Compute discrete tuning curves of a TsGroup using a dictionnary of epochs. - The function returns a pandas DataFrame with each row being a key of the dictionnary of epochs + Compute discrete tuning curves of a TsGroup using a dictionary of epochs. + The function returns a pandas DataFrame with each row being a key of the dictionary of epochs and each column being a neurons. This function can typically being used for a set of stimulus being presented for multiple epochs. - An example of the dictionnary is : + An example of the dictionary is : >>> dict_ep = { "stim0": nap.IntervalSet(start=0, end=1), From 5d8e4248b8a6f44ebf0e4726212d574505f2c7d9 Mon Sep 17 00:00:00 2001 From: bendichter Date: Thu, 7 Sep 2023 17:56:14 +0200 Subject: [PATCH 2/4] correct typo: Dictionnary -> Dictionary --- pynapple/core/ts_group.py | 2 +- pynapple/io/folder.py | 4 ++-- pynapple/io/interface_nwb.py | 2 +- pynapple/process/tuning_curves.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pynapple/core/ts_group.py b/pynapple/core/ts_group.py index 534e6e64..d0da4938 100644 --- a/pynapple/core/ts_group.py +++ b/pynapple/core/ts_group.py @@ -77,7 +77,7 @@ def __init__( Parameters ---------- data : dict - Dictionnary containing Ts/Tsd objects + Dictionary containing Ts/Tsd objects time_support : IntervalSet, optional The time support of the TsGroup. Ts/Tsd objects will be restricted to the time support if passed. If no time support is specified, TsGroup will merge time supports from all the Ts/Tsd objects in data. diff --git a/pynapple/io/folder.py b/pynapple/io/folder.py index 846cf55a..60042bd9 100644 --- a/pynapple/io/folder.py +++ b/pynapple/io/folder.py @@ -86,7 +86,7 @@ class Folder(UserDict): Attributes ---------- data : dict - Dictionnary holidng all the pynapple objects found in the folder. + Dictionary holidng all the pynapple objects found in the folder. name : str Name of the folder npz_files : list @@ -96,7 +96,7 @@ class Folder(UserDict): path : str Absolute path of the folder subfolds : dict - Dictionnary of all the subfolders + Dictionary of all the subfolders """ diff --git a/pynapple/io/interface_nwb.py b/pynapple/io/interface_nwb.py index 442b0dfb..6214b4ba 100644 --- a/pynapple/io/interface_nwb.py +++ b/pynapple/io/interface_nwb.py @@ -35,7 +35,7 @@ def _extract_compatible_data_from_nwbfile(nwbfile): Returns ------- dict - Dictionnary containing all the object found and their type in pynapple. + Dictionary containing all the object found and their type in pynapple. """ data = {} diff --git a/pynapple/process/tuning_curves.py b/pynapple/process/tuning_curves.py index 89bdf341..27775de1 100644 --- a/pynapple/process/tuning_curves.py +++ b/pynapple/process/tuning_curves.py @@ -154,7 +154,7 @@ def compute_2d_tuning_curves(group, feature, nb_bins, ep=None, minmax=None): ------- tuple A tuple containing: \n - tc (dict): Dictionnary of the tuning curves with dimensions (nb_bins, nb_bins).\n + tc (dict): Dictionary of the tuning curves with dimensions (nb_bins, nb_bins).\n xy (list): List of bins center in the two dimensions Raises @@ -437,7 +437,7 @@ def compute_2d_tuning_curves_continuous( ------- tuple A tuple containing: \n - tc (dict): Dictionnary of the tuning curves with dimensions (nb_bins, nb_bins).\n + tc (dict): Dictionary of the tuning curves with dimensions (nb_bins, nb_bins).\n xy (list): List of bins center in the two dimensions Raises From 1dcdcd6e88952c874751fa4387f7dfa6ab5b14ee Mon Sep 17 00:00:00 2001 From: bendichter Date: Thu, 7 Sep 2023 18:02:14 +0200 Subject: [PATCH 3/4] a few other typos --- pynapple/io/folder.py | 2 +- pynapple/io/interface_npz.py | 2 +- pynapple/io/interface_nwb.py | 4 ++-- pynapple/io/misc.py | 4 ++-- pynapple/io/phy.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pynapple/io/folder.py b/pynapple/io/folder.py index 60042bd9..30cf6648 100644 --- a/pynapple/io/folder.py +++ b/pynapple/io/folder.py @@ -86,7 +86,7 @@ class Folder(UserDict): Attributes ---------- data : dict - Dictionary holidng all the pynapple objects found in the folder. + Dictionary holding all the pynapple objects found in the folder. name : str Name of the folder npz_files : list diff --git a/pynapple/io/interface_npz.py b/pynapple/io/interface_npz.py index 53ee6218..7e7c4a04 100644 --- a/pynapple/io/interface_npz.py +++ b/pynapple/io/interface_npz.py @@ -49,7 +49,7 @@ def __init__(self, path): self.file = np.load(self.path, allow_pickle=True) self.type = "" - # First check if type is explicitely defined + # First check if type is explicitly defined possible = ["Ts", "Tsd", "TsdFrame", "TsGroup", "IntervalSet"] if "type" in self.file.keys(): if len(self.file["type"]) == 1: diff --git a/pynapple/io/interface_nwb.py b/pynapple/io/interface_nwb.py index 6214b4ba..3f390868 100644 --- a/pynapple/io/interface_nwb.py +++ b/pynapple/io/interface_nwb.py @@ -7,7 +7,7 @@ """ Pynapple class to interface with NWB files. Data are always lazy-loaded. -Object behaves like dictionnary. +Object behaves like dictionary. """ import errno @@ -366,7 +366,7 @@ def __getitem__(self, key): Raises ------ KeyError - If key is not in the dictionnary + If key is not in the dictionary """ if key.__hash__: if self.__contains__(key): diff --git a/pynapple/io/misc.py b/pynapple/io/misc.py index 36c9614f..4331ef4a 100644 --- a/pynapple/io/misc.py +++ b/pynapple/io/misc.py @@ -58,7 +58,7 @@ def load_file(path): def load_folder(path): """Load folder containing files or other folder. - Pynapple will walk throught the subfolders to detect compatible npz files + Pynapple will walk through the subfolders to detect compatible npz files or nwb files. Parameters @@ -180,7 +180,7 @@ def load_eeg( Deleted Parameters ------------------ extension : str, optional - The file extenstion (.eeg, .dat, .lfp). Make sure the frequency match + The file extension (.eeg, .dat, .lfp). Make sure the frequency match """ # Need to check if a xml file exists diff --git a/pynapple/io/phy.py b/pynapple/io/phy.py index 7e12219a..451792ac 100644 --- a/pynapple/io/phy.py +++ b/pynapple/io/phy.py @@ -143,7 +143,7 @@ def load_phy_spikes(self, time_support=None): ---------- path : Path object The path to the data - time_support : IntevalSet, optional + time_support : IntervalSet, optional The time support of the data Raises From 07ae8790151798819356be7a7e579b8213e5d1cb Mon Sep 17 00:00:00 2001 From: bendichter Date: Thu, 7 Sep 2023 18:04:41 +0200 Subject: [PATCH 4/4] grammar fixes --- pynapple/io/interface_npz.py | 2 +- pynapple/io/neurosuite.py | 2 +- pynapple/io/phy.py | 4 ++-- pynapple/io/suite2p.py | 2 +- pynapple/process/randomize.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pynapple/io/interface_npz.py b/pynapple/io/interface_npz.py index 7e7c4a04..d89ca910 100644 --- a/pynapple/io/interface_npz.py +++ b/pynapple/io/interface_npz.py @@ -9,7 +9,7 @@ """ File classes help to validate and load pynapple objects or NWB files. Data are always lazy-loaded. -Both classes behaves like dictionary. +Both classes behave like dictionary. """ import os diff --git a/pynapple/io/neurosuite.py b/pynapple/io/neurosuite.py index 392cef53..84bbf47d 100755 --- a/pynapple/io/neurosuite.py +++ b/pynapple/io/neurosuite.py @@ -155,7 +155,7 @@ def load_neurosuite_xml(self, path): Function reads : 1. the number of channels - 2. the sampling frequency of the dat file or the eeg file depending of what is present in the folder + 2. the sampling frequency of the dat file or the eeg file depending on what is present in the folder eeg file first if both are present or both are absent 3. the mappings shanks to channels as a dict diff --git a/pynapple/io/phy.py b/pynapple/io/phy.py index 451792ac..ae981a86 100644 --- a/pynapple/io/phy.py +++ b/pynapple/io/phy.py @@ -342,9 +342,9 @@ def load_lfp( ---------- filename : str, optional The filename of the lfp file. - It can be useful it multiple dat files are present in the data directory + It can be useful if multiple dat files are present in the data directory channel : int or list of int, optional - The channel(s) to load. If None return a memory map of the dat file to avoid memory error + The channel(s) to load. If None, return a memory map of the dat file to avoid memory error extension : str, optional The file extenstion (.eeg, .dat, .lfp). Make sure the frequency match frequency : float, optional diff --git a/pynapple/io/suite2p.py b/pynapple/io/suite2p.py index 904c8415..c96f4bac 100644 --- a/pynapple/io/suite2p.py +++ b/pynapple/io/suite2p.py @@ -53,7 +53,7 @@ class Suite2P(BaseLoader): plane_info : pandas.DataFrame Contains plane identity of each cell stats : dict - dictionnay of statistics from stat.npy for each planes only for the neurons that were classified as cells + dictionary of statistics from stat.npy for each plane only for the neurons that were classified as cells (Can be smaller when loading from the NWB file) ops : dict Parameters from Suite2p. (Can be smaller when loading from the NWB file) diff --git a/pynapple/process/randomize.py b/pynapple/process/randomize.py index 7bbf577d..9aed71c1 100644 --- a/pynapple/process/randomize.py +++ b/pynapple/process/randomize.py @@ -295,7 +295,7 @@ def _resample_ts(ts): def _resample_tsgroup(tsgroup): """ - Resamples the each timestamp series in the group, with uniform distribution and on the time + Resamples each timestamp series in the group, with uniform distribution and on the time support of the whole group. Parameters