Skip to content

Commit c66da63

Browse files
committed
merge
2 parents ac3098c + 47e109d commit c66da63

23 files changed

+247
-163
lines changed

.github/workflows/io-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
# "macos-latest", "windows-latest"
2121
os: ["ubuntu-latest", ]
22-
python-version: ['3.8', ]
22+
python-version: ['3.9', ]
2323
defaults:
2424
# by default run in bash mode (required for conda usage)
2525
run:
@@ -37,7 +37,7 @@ jobs:
3737
# the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
3838
id: ephy_testing_data_hash
3939
run: |
40-
echo "latest_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> GITHUB_OUTPUT
40+
echo "latest_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
4141
4242
- uses: actions/cache@v3
4343
# Loading cache of ephys_testing_dataset
@@ -59,7 +59,7 @@ jobs:
5959
id: cache-conda-env
6060
with:
6161
path: /usr/share/miniconda/envs/neo-test-env
62-
key: ${{ runner.os }}-conda-env-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements_testing.txt') }}-${{ hashFiles('**/environment_testing.txt') }}-${{ steps.date.outputs.date }}
62+
key: ${{ runner.os }}-conda-env-${{ hashFiles('**/pyproject.toml') }}-${{ steps.date.outputs.date }}
6363

6464
- name: Install testing dependencies
6565
# testing environment is only installed if no cache was found
@@ -75,6 +75,7 @@ jobs:
7575
- name: Install neo
7676
run: |
7777
pip install --upgrade -e .
78+
pip install .[test]
7879
7980
- name: Test with pytest
8081
run: |

.readthedocs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ python:
1212
install:
1313
- method: pip
1414
path: .
15-
- requirements: doc/requirements_docs.txt
15+
extra_requirements:
16+
- docs
17+

doc/requirements_docs.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/source/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313

1414
import os
1515
import sys
16+
import re
1617

1718
from packaging.version import Version
1819

19-
with open("../../neo/version.py") as fp:
20-
d = {}
21-
exec(fp.read(), d)
22-
neo_release = d['version']
20+
with open('../../pyproject.toml', mode='r') as f:
21+
txt = f.read()
22+
neo_release = re.findall('version = "(\S+)"', txt)[0]
2323

2424
neo_version = '.'.join((str(e) for e in Version(neo_release).release[:2]))
2525

26-
2726
AUTHORS = 'Neo authors and contributors <[email protected]>'
2827

2928
# If extensions (or modules to document with autodoc) are in another directory,
@@ -51,7 +50,7 @@
5150

5251
# General information about the project.
5352
project = 'Neo'
54-
copyright = '2010-2022, ' + AUTHORS
53+
copyright = '2010-2023, ' + AUTHORS
5554

5655
# The version info for the project you're documenting, acts as replacement for
5756
# |version| and |release|, also used in various other places throughout the

doc/source/developers_guide.rst

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@ Requirements
4040

4141
* Python_ 3.8 or later
4242
* numpy_ >= 1.19.5
43-
* quantities_ >= 0.12.1
44-
* nose_ >= 1.1.2 (for running tests)
43+
* quantities_ >= 0.14.1
44+
* pytest (for running tests)
4545
* Sphinx_ (for building documentation)
46-
* (optional) coverage_ >= 2.85 (for measuring test coverage)
47-
* (optional) scipy >= 0.12 (for MatlabIO)
48-
* (optional) h5py >= 2.5 (for KwikIO)
49-
* (optional) nixio (for NixIO)
50-
* (optional) pillow (for TiffIO)
46+
47+
There are many optional dependencies for different IO modules (see below).
48+
If you don't install these, tests for those modules will be skipped.
5149

5250
We strongly recommend you develop within a virtual environment (from virtualenv, venv or conda).
5351

@@ -65,26 +63,20 @@ To get a local copy of the repository::
6563
$ git clone [email protected]:<username>/python-neo.git
6664

6765
Now you need to make sure that the ``neo`` package is on your PYTHONPATH.
68-
You can do this either by installing Neo::
66+
You can do this by installing Neo with the *editable* option,
67+
which avoids reinstalling when there are changes in the code::
6968

7069
$ cd python-neo
71-
$ python3 setup.py install
72-
73-
(if you do this, you will have to re-run ``setup.py install`` any time you make
74-
changes to the code) *or* by creating symbolic links from somewhere on your
75-
PYTHONPATH, for example::
76-
77-
$ ln -s python-neo/neo
78-
$ export PYTHONPATH=/some/directory:${PYTHONPATH}
70+
$ pip install -e .
7971

80-
An alternate solution is to install Neo with the *develop* option, this avoids
81-
reinstalling when there are changes in the code::
72+
To install all dependencies needed for testing, including optional dependencies
73+
for IO modules, run::
8274

83-
$ sudo python setup.py develop
75+
$ pip install -e .[test]
8476

85-
or using the "-e" option to pip::
77+
or if using the zsh shell::
8678

87-
$ pip install -e python-neo
79+
$ pip install -e ".[test]"
8880

8981
To update to the latest version from the repository::
9082

@@ -97,20 +89,15 @@ Running the test suite
9789
Before you make any changes, run the test suite to make sure all the tests pass
9890
on your system::
9991

100-
$ cd neo/test
101-
$ python3 -m unittest discover
102-
103-
If you have nose installed::
104-
105-
$ nosetests
92+
$ pytest
10693

10794
At the end, if you see "OK", then all the tests
10895
passed (or were skipped because certain dependencies are not installed),
10996
otherwise it will report on tests that failed or produced errors.
11097

11198
To run tests from an individual file::
11299

113-
$ python3 test_analogsignal.py
100+
$ pytest test_analogsignal.py
114101

115102

116103
Writing tests
@@ -123,7 +110,7 @@ check that the test now passes.
123110

124111
To see how well the tests cover the code base, run::
125112

126-
$ nosetests --with-coverage --cover-package=neo --cover-erase
113+
$ pytest --cov=neo
127114

128115

129116
Working on the documentation
@@ -221,11 +208,11 @@ Making a release
221208
222209
Add a section in :file:`/doc/source/whatisnew.rst` for the release.
223210

224-
First check that the version string (in :file:`neo/version.py`) is correct.
211+
First check that the version string (in :file:`pyproject.toml`) is correct.
225212

226-
To build a source package::
213+
To build source and wheel packages::
227214

228-
$ python setup.py sdist
215+
$ python -m build
229216

230217

231218
Tag the release in the Git repository and push it::
@@ -237,7 +224,7 @@ Tag the release in the Git repository and push it::
237224

238225
To upload the package to `PyPI`_ (the members of the `maintainers team`_ have the necessary permissions to do this)::
239226

240-
$ twine upload dist/neo-0.X.Y.tar.gz
227+
$ twine upload dist/neo-0.X.Y.tar.gz dist/neo-0.X.Y-py3-none-any.whl
241228

242229
.. talk about readthedocs
243230

doc/source/releases/0.12.0.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
========================
2+
Neo 0.12.0 release notes
3+
========================
4+
5+
17th February 2022
6+
7+
.. currentmodule:: neo.io
8+
9+
Change of packaging system
10+
--------------------------
11+
12+
We have updated our tooling for building and installing Neo to follow the
13+
`latest recommendations`_ of the Python community (using pyproject.toml, etc.)
14+
15+
For users, this means you should always use `pip` to install Neo,
16+
unless you're using another package manager such as `conda`, `spack`,
17+
or a Linux package manager.
18+
19+
20+
Improved file format detection
21+
------------------------------
22+
23+
In addition to the existing :func:`get_io()` function, there is now an additional utility function
24+
for finding a suitable IO for a given dataset.
25+
26+
:func:`list_candidate_ios()` provides a list of all IOs supporting the formats detected in a given path.
27+
This list is generated based on the file extension of the file
28+
or the extensions of the matching files in a given folder,
29+
potentially also scanning subfolders if required.
30+
31+
32+
Bug fixes and improvements in IO modules
33+
----------------------------------------
34+
35+
Bug fixes and/or improvements have been made to
36+
:class:`OpenEphysBinaryIO` and :class:`NWBIO`.
37+
38+
39+
Other changes
40+
-------------
41+
42+
- The IO test suite has been greatly improved, with a substantial speed-up.
43+
44+
45+
See all `pull requests`_ included in this release and the `list of closed issues`_.
46+
47+
Updated dependencies
48+
--------------------
49+
50+
We have dropped support for Python 3.7 and added support for 3.11.
51+
Neo now requires NumPy version >=1.19.5 and Quantities >=v0.14.1.
52+
53+
54+
Acknowledgements
55+
----------------
56+
57+
Thanks to Julia Sprenger, Andrew Davison, and Samuel Garcia for their contributions to this release.
58+
59+
.. generated with git shortlog --since=2022-10-21 -sne then checking Github for PRs merged since the last release but with commits before then
60+
61+
.. _`list of closed issues`: https://github.com/NeuralEnsemble/python-neo/issues?q=is%3Aissue+milestone%3A0.12.0+is%3Aclosed
62+
.. _`pull requests`: https://github.com/NeuralEnsemble/python-neo/pulls?q=is%3Apr+is%3Aclosed+merged%3A%3E2022-10-21+milestone%3A0.12.0
63+
.. _`latest recommendations`: https://packaging.python.org/en/latest/

doc/source/whatisnew.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release notes
66
.. toctree::
77
:maxdepth: 1
88

9+
releases/0.12.0.rst
910
releases/0.11.1.rst
1011
releases/0.11.0.rst
1112
releases/0.10.2.rst

environment_testing.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ channels:
44
dependencies:
55
- datalad
66
- pip
7-
- pip:
8-
- -r requirements_testing.txt

neo/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Neo is a package for representing electrophysiology data in Python,
33
together with support for reading a wide range of neurophysiology file formats
44
'''
5+
import importlib.metadata
6+
# this need to be at the begining because some sub module will need the version
7+
__version__ = importlib.metadata.version("neo")
58

69
import logging
710

@@ -10,4 +13,3 @@
1013
from neo.core import *
1114
from neo.io import *
1215

13-
from neo.version import version as __version__

neo/core/dataobject.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,14 @@ def _merge_array_annotations(self, other):
272272
# Return the merged array_annotations
273273
return merged_array_annotations
274274

275-
def rescale(self, units):
275+
def rescale(self, units, dtype=None):
276276
'''
277-
Return a copy of the object converted to the specified
278-
units
277+
Return a copy of the object converted to the specified units.
278+
The `dtype` argument exists only for backward compatibility within quantities, see
279+
https://github.com/python-quantities/python-quantities/pull/204
279280
:return: Copy of self with specified units
280281
'''
282+
281283
# Use simpler functionality, if nothing will be changed
282284
dim = pq.quantity.validate_dimensionality(units)
283285
if self.dimensionality == dim:

0 commit comments

Comments
 (0)