Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spelling and grammar fixes #167

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/tutorial_pynapple_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/tutorial_pynapple_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/tutorial_pynapple_quick_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
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)

# %%
# *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)

Expand Down
2 changes: 1 addition & 1 deletion docs/old_notebooks/pynapple-core-notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docs/old_notebooks/pynapple-io-notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/old_notebooks/pynapple-quick-start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions pynapple/core/ts_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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.
Expand All @@ -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
------
Expand Down Expand Up @@ -812,7 +812,7 @@ def getby_category(self, key):
Returns
-------
dict
A dictionnary of TsGroup
A dictionary of TsGroup

Examples
--------
Expand Down
6 changes: 3 additions & 3 deletions pynapple/io/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Folder(UserDict):
Attributes
----------
data : dict
Dictionnary 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
Expand All @@ -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

"""

Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions pynapple/io/interface_npz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 behave like dictionary.
"""

import os
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions pynapple/io/interface_nwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions pynapple/io/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
------
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pynapple/io/neurosuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions pynapple/io/phy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pynapple/io/suite2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pynapple/process/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pynapple/process/perievent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
------
Expand Down
2 changes: 1 addition & 1 deletion pynapple/process/randomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions pynapple/process/tuning_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down