Skip to content

Commit 988a95d

Browse files
authored
Merge pull request #472 from pynapple-org/dev
Bump 0.9.2
2 parents f43eb11 + 51f2784 commit 988a95d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1289
-633
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
publish_branch: gh-pages
3838
github_token: ${{ secrets.GITHUB_TOKEN }}
3939
publish_dir: _build/
40-
force_orphan: true
40+
force_orphan: true

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ jobs:
8282
run: |
8383
cd doc
8484
make html
85+
- name: Start tmate session for debugging
86+
if: failure()
87+
uses: mxschmitt/action-tmate@v3
8588
- name: Check html
8689
uses: chabad360/htmlproofer@master
8790
with:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ ipython_config.py
100100
# pyenv
101101
.python-version
102102

103+
# pre-commit
104+
.pre-commit-config.yaml
105+
103106
# pipenv
104107
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
105108
# However, in case of collaboration, if having platform-specific dependencies or dependencies
@@ -125,6 +128,7 @@ venv/
125128
ENV/
126129
env.bak/
127130
venv.bak/
131+
uv.lock
128132

129133
# Spyder project settings
130134
.spyderproject

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing
2+
3+
In general, we welcome contributions from the community, including bug fixes and documentation improvements. Please see the Issues tab for discussion.
4+
5+
## Development environment
6+
7+
To get started, clone the repository and set up your local environment:
8+
9+
```bash
10+
# Clone the repository
11+
git clone https://github.com/pynapple-org/pynapple.git
12+
cd pynapple
13+
14+
# Create a new conda environment
15+
conda create --name pynapple pip python=3.8
16+
conda activate pynapple
17+
18+
# Install in editable mode with dev dependencies
19+
pip install -e ".[dev,docs]"
20+
```
21+
22+
Note: If you're an external contributor, you'll likely want to fork the repository first with your own GitHub account, and then set up an `upstream` remote branch:
23+
24+
```
25+
# Replace username with your GitHub username
26+
git clone https://github.com/<username>/pynapple.git
27+
git remote add upstream https://github.com/pynapple-org/pynapple
28+
```
29+
30+
## Git workflow
31+
32+
In general, we recommend developing changes on feature branches, and then opening a pull request against the `dev` branch for review.
33+
34+
```bash
35+
# Create a new branch
36+
git checkout dev
37+
git pull origin dev # or git pull upstream dev
38+
git checkout -b your-branch-name
39+
40+
# Commit and push changes
41+
git commit -m "Your commit message"
42+
git push origin your-branch-name
43+
```
44+
45+
## Testing and linting
46+
47+
You can run the tests and code linters locally using `tox`. This is generally kept in sync with the Github Actions defined in `.github/workflows` via the [`tox.ini`](tox.ini) file.
48+
49+
```bash
50+
# Install tox
51+
pip install tox tox-conda
52+
53+
# Run tests and linter
54+
tox
55+
```
56+
57+
## Generating docs
58+
59+
The user documentation is generated using Sphinx and can be built using the Makefile in the `doc/` folder:
60+
61+
```bash
62+
cd doc && make html
63+
```
64+
65+
You can also start a development server that will watch for changes with `sphinx-autobuild`:
66+
67+
```bash
68+
sphinx-autobuild . _build/html
69+
```

README.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,18 @@ Getting Started
7070

7171
### Installation
7272

73-
The best way to install pynapple is with pip within a new [conda](https://docs.conda.io/en/latest/) environment :
74-
73+
The best way to install pynapple is with pip inside a new [conda](https://docs.conda.io/en/latest/) environment:
7574

7675
``` {.sourceCode .shell}
7776
$ conda create --name pynapple pip python=3.8
7877
$ conda activate pynapple
7978
$ pip install pynapple
8079
```
8180

82-
or directly from the source code:
83-
84-
``` {.sourceCode .shell}
85-
$ conda create --name pynapple pip python=3.8
86-
$ conda activate pynapple
87-
$ # clone the repository
88-
$ git clone https://github.com/pynapple-org/pynapple.git
89-
$ cd pynapple
90-
$ # Install in editable mode with `-e` or, equivalently, `--editable`
91-
$ pip install -e .
92-
```
9381
> **Note**
94-
> The package is now using a pyproject.toml file for installation and dependencies management. If you want to run the tests, use pip install -e .[dev]
82+
> The package uses a pyproject.toml file for installation and dependencies management.
9583
96-
This procedure will install all the dependencies including
84+
Running `pip install pynapple` will install all the dependencies, including:
9785

9886
- pandas
9987
- numpy
@@ -103,6 +91,8 @@ This procedure will install all the dependencies including
10391
- tabulate
10492
- h5py
10593

94+
For development, see the [contributor guide](CONTRIBUTING.md) for steps to install from source code.
95+
10696
<!-- For spyder users, it is recommended to install spyder after installing pynapple with :
10797
10898
``` {.sourceCode .shell}
@@ -174,3 +164,7 @@ This package was developped by Guillaume Viejo
174164
(<https://github.com/gviejo>) and other members of the Peyrache Lab.
175165

176166
<!-- Logo: Sofia Skromne Carrasco, 2021. -->
167+
168+
## Contributing
169+
170+
We welcome contributions, including documentation improvements. For more information, see the [contributor guide](CONTRIBUTING.md).

doc/conf.py

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,46 @@
1414
import time
1515
from pathlib import Path
1616

17-
sys.path.insert(0, os.path.abspath('..'))
18-
sys.path.insert(0, os.path.abspath('sphinxext'))
17+
sys.path.insert(0, os.path.abspath(".."))
18+
sys.path.insert(0, os.path.abspath("sphinxext"))
1919

2020

2121
# -- Project information -----------------------------------------------------
2222
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
2323

24-
project = 'pynapple'
24+
project = "pynapple"
2525
copyright = f'2021-{time.strftime("%Y")}'
26-
author = 'Guillaume Viejo'
26+
author = "Guillaume Viejo"
2727
from importlib.metadata import version
28+
2829
release: str = version("pynapple")
2930
# this will grab major.minor.patch (excluding any .devN afterwards, which should only
3031
# show up when building locally during development)
31-
version: str = ".".join(release.split('.')[:3])
32+
version: str = ".".join(release.split(".")[:3])
3233

3334

3435
# -- General configuration ---------------------------------------------------
3536
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
3637

3738
extensions = [
38-
'sphinx.ext.autodoc',
39-
'sphinx.ext.napoleon',
40-
'sphinx.ext.autosummary',
41-
'sphinx.ext.coverage',
42-
'sphinx.ext.viewcode', # Links to source code
43-
'sphinx.ext.doctest',
44-
'sphinx_copybutton', # Adds copy button to code blocks
45-
'sphinx_design', # For layout components
46-
'myst_nb',
47-
'sphinx_contributors',
48-
'matplotlib.sphinxext.plot_directive'
39+
"sphinx.ext.autodoc",
40+
"sphinx.ext.napoleon",
41+
"sphinx.ext.autosummary",
42+
"sphinx.ext.coverage",
43+
"sphinx.ext.viewcode", # Links to source code
44+
"sphinx.ext.doctest",
45+
"sphinx_copybutton", # Adds copy button to code blocks
46+
"sphinx_design", # For layout components
47+
"myst_nb",
48+
"sphinx_contributors",
49+
"matplotlib.sphinxext.plot_directive",
4950
# 'sphinxcontrib.apidoc'
50-
# 'sphinx_gallery.gen_gallery',
51+
# 'sphinx_gallery.gen_gallery',
5152
# 'myst_sphinx_gallery',
5253
]
5354

5455

55-
templates_path = ['_templates']
56+
templates_path = ["_templates"]
5657

5758

5859
# The Root document
@@ -62,17 +63,17 @@
6263
# List of patterns, relative to source directory, that match files and
6364
# directories to ignore when looking for source files.
6465
# This pattern also affects html_static_path and html_extra_path.
65-
exclude_patterns = ['_build', 'docstrings', 'nextgen', 'Thumbs.db', '.DS_Store']
66+
exclude_patterns = ["_build", "docstrings", "nextgen", "Thumbs.db", ".DS_Store"]
6667

6768

6869
# Generate the API documentation when building
6970
autosummary_generate = True
7071
numpydoc_show_class_members = True
7172
autodoc_default_options = {
72-
'members': True,
73-
'inherited-members': True,
74-
'show-inheritance': True,
75-
}
73+
"members": True,
74+
"inherited-members": True,
75+
"show-inheritance": True,
76+
}
7677

7778
# apidoc_module_dir = '../pynapple'
7879
# apidoc_output_dir = 'reference'
@@ -84,7 +85,7 @@
8485
# -- Options for HTML output -------------------------------------------------
8586
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
8687

87-
html_theme = 'pydata_sphinx_theme'
88+
html_theme = "pydata_sphinx_theme"
8889

8990
html_logo = "_static/Logo/Pynapple_final_logo.png"
9091
html_favicon = "_static/Icon/Pynapple_final_icon.png"
@@ -116,37 +117,36 @@
116117

117118
html_sidebars = {
118119
"index": [],
119-
"installing":[],
120-
"about":[],
121-
"releases":[],
122-
"external":[],
123-
"pynajax":[],
124-
"citing":[],
120+
"installing": [],
121+
"about": [],
122+
"releases": [],
123+
"external": [],
124+
"pynajax": [],
125+
"citing": [],
125126
"**": ["search-field.html", "sidebar-nav-bs.html"],
126127
}
127128

128129
# # Path for static files (custom stylesheets or JavaScript)
129-
html_static_path = ['_static']
130-
html_css_files = ['custom.css']
130+
html_static_path = ["_static"]
131+
html_css_files = ["custom.css"]
131132

132133
# Copybutton settings (to hide prompt)
133134
copybutton_prompt_text = r">>> |\$ |# "
134135
copybutton_prompt_is_regexp = True
135136

136137
# Enable markdown and notebook support
137-
myst_enable_extensions = ["colon_fence"] # For improved markdown
138+
myst_enable_extensions = ["colon_fence"] # For improved markdown
138139

139140
# # ----------------------------------------------------------------------------
140141
# # -- Autodoc and Napoleon Options -------------------------------------------------
141142
autodoc_default_options = {
142-
'members': True,
143-
'undoc-members': True,
144-
'show-inheritance': True,
143+
"members": True,
144+
"undoc-members": True,
145+
"show-inheritance": True,
145146
}
146147
napoleon_numpy_docstring = True
147148

148149

149-
150150
nitpicky = True
151151

152152
# Set timeout in seconds (e.g., 15 minutes)
@@ -155,8 +155,3 @@
155155
# Execute notebooks during the build:
156156
nb_execution_mode = "cache"
157157
nb_execution_raise_on_error = True
158-
159-
160-
161-
162-

doc/examples/tutorial_calcium_imaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ plt.show()
161161

162162
It looks like this could be a head-direction cell. One important property of head-directions cells however, is that their firing with respect to head-direction is stable. To check for their stability, we can split our recording in two and compute a tuning curve for each half of the recording.
163163

164-
We start by finding the midpoint of the recording, using the function `get_intervals_center`. Using this, then create one new IntervalSet with two rows, one for each half of the recording.
164+
We start by finding the midpoint of the recording, using the function [`get_intervals_center`](pynapple.IntervalSet.get_intervals_center). Using this, then create one new IntervalSet with two rows, one for each half of the recording.
165165

166166

167167
```{code-cell} ipython3

0 commit comments

Comments
 (0)