From 99789af7829a0f0250ba23553179a2aaf03a2bf5 Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Wed, 3 Mar 2021 22:03:16 -0500 Subject: [PATCH] Release vp1 (#255) * DOC: update version * DOC: update what's new * ENH: add install requires * DOC: Update install instructions * Comments by Chris Co-authored-by: Christopher J. Bailey * Cosmit * DOC: mne is not needed any more * Fix mod path for windows install * add pyproject.toml for NEURON build dependency Co-authored-by: Christopher J. Bailey Co-authored-by: Nick Tolley --- README.rst | 42 ++++++++++++++++++++++++++---------------- doc/conf.py | 6 +++--- doc/whats_new.rst | 26 ++++++++++++++++++++++---- hnn_core/__init__.py | 2 +- hnn_core/viz.py | 3 --- pyproject.toml | 3 +++ setup.py | 19 +++++++++++++------ 7 files changed, 68 insertions(+), 33 deletions(-) create mode 100644 pyproject.toml diff --git a/README.rst b/README.rst index cb6f5a07e..4265fc3c5 100644 --- a/README.rst +++ b/README.rst @@ -42,21 +42,17 @@ Installation ============ We recommend the `Anaconda Python distribution `_. -To install ``hnn-core``, you first need to install its dependencies:: +To install ``hnn-core``, simply do:: - $ conda install numpy matplotlib scipy + $ pip install hnn_core -Additionally, you would need Neuron which is available here: -`https://neuron.yale.edu/neuron/ `_. -Note installing Neuron using the traditional installer may make it hard to manage -within virtual environments such as Anaconda. For this reason, we recommend the -pip installer: - - $ pip install NEURON +and it will install ``hnn-core`` along with the dependencies which are not already installed. -Since ``hnn-core`` does not yet have a stable release, we recommend installing the nightly version. This may change in the future if more users start using it. +Note that if you installed Neuron using the traditional installer package, it is recommended +to remove it first and unset ``PYTHONPATH`` and ``PYTHONHOME`` if they were set. This is +because the pip installer works better with virtual environments such as the ones provided by ``conda``. -To install the latest version of the code (nightly) do:: +If you want to track the latest developments of ``hnn-core``, you can install the current version of the code (nightly) with:: $ pip install --upgrade https://api.github.com/repos/jonescompneurolab/hnn-core/zipball/master @@ -66,6 +62,25 @@ To check if everything worked fine, you can do:: and it should not give any error messages. +**Parallel backends** + +For further instructions on installation and usage of parallel backends for using more +than one CPU core, refer to `parallel_backends`_ + +**Note for Windows users** + +The pip installer for Neuron does not yet work for Windows. In this case, it is better to +install ``hnn_core`` without the dependencies:: + + $ pip install hnn_core --no-deps + +and then install the dependencies separately:: + + $ pip install scipy numpy matplotlib + +and install Neuron using the traditional package installer available here +`https://neuron.yale.edu/neuron/ `_. + Documentation and examples ========================== @@ -81,11 +96,6 @@ and executing the scripts using the ``%run``-magic:: When executed in this manner, the scripts will execute entirely, after which all plots will be shown. For an even more interactive experience, in which you execute code and interrogate plots in sequential blocks, we recommend editors such as `VS Code `_ and `Spyder `_. -Parallel backends -================= - -For further instructions on installation and usage of parallel backends for using more than one core, refer to `parallel_backends`_ - Bug reports =========== diff --git a/doc/conf.py b/doc/conf.py index ba92227b7..2caf10980 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -24,11 +24,11 @@ # -- Project information ----------------------------------------------------- project = 'hnn-core' -copyright = '2019, Mainak Jas' -author = 'Mainak Jas' +copyright = '2021, HNN Developers' +author = 'HNN Developers' # The short X.Y version -version = '' +version = '0.1' # The full version, including alpha/beta/rc tags release = '' diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 8a9414350..b53f51f40 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -7,7 +7,7 @@ What's new? .. currentmodule:: hnn_core -.. _current: +.. _current Current ------- @@ -15,6 +15,20 @@ Current Changelog ~~~~~~~~~ +Bug +~~~ + +API +~~~ + +.. _0.1: + +0.1 +--- + +Changelog +~~~~~~~~~ + - Add ability to simulate multiple trials in parallel using joblibs, by `Mainak Jas`_ in `#44 `_ - Rhythmic inputs can now be turned off by setting their conductance weights to 0 instead of setting their start times to exceed the simulation stop time, by `Ryan Thorpe`_ in `#105 `_ @@ -91,10 +105,14 @@ API - Force conversion to nAm (from fAm) for output of :func:`~hnn_core.dipole.simulate_dipole` regardless of ``postproc``-argument, which now only controls parameter file-based smoothing and scaling, by `Christopher Bailey`_ in `#264 `_ -.. _Mainak Jas: http://jasmainak.github.io/ +People who contributed to this release (in alphabetical order): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .. _Blake Caldwell: https://github.com/blakecaldwell -.. _Ryan Thorpe: https://github.com/rythorpe .. _Christopher Bailey: https://github.com/cjayb -.. _Nick Tolley: https://github.com/ntolley .. _Carmen Kohl: https://github.com/kohl-carmen +.. _Mainak Jas: http://jasmainak.github.io/ +.. _Nick Tolley: https://github.com/ntolley +.. _Ryan Thorpe: https://github.com/rythorpe .. _Samika Kanekar: https://github.com/samikane +.. _Stephanie Jones: https://github.com/stephanie-r-jones diff --git a/hnn_core/__init__.py b/hnn_core/__init__.py index 109ac7bfc..070ede976 100644 --- a/hnn_core/__init__.py +++ b/hnn_core/__init__.py @@ -6,4 +6,4 @@ from .basket import L2Basket, L5Basket from .parallel_backends import MPIBackend, JoblibBackend -__version__ = '0.1.dev0' +__version__ = '0.1' diff --git a/hnn_core/viz.py b/hnn_core/viz.py index 7d901f3c1..275ac1438 100644 --- a/hnn_core/viz.py +++ b/hnn_core/viz.py @@ -339,9 +339,6 @@ def plot_tfr_morlet(dpl, freqs, *, n_cycles=7., tmin=None, tmax=None, colormap='inferno', colorbar=True, show=True): """Plot Morlet time-frequency representation of dipole time course - NB: Calls `~mne.time_frequency.tfr_array_morlet`, so ``mne`` must be - installed. - Parameters ---------- dpl : instance of Dipole | list of Dipole instances diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..615981765 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=40.8.0", 'NEURON >=7.7'] +build-backend = "setuptools.build_meta:__legacy__" \ No newline at end of file diff --git a/setup.py b/setup.py index a29f80a99..a47affe8b 100644 --- a/setup.py +++ b/setup.py @@ -50,11 +50,12 @@ def finalize_options(self): def run(self): print("=> Building mod files ...") - mod_path = op.join(op.dirname(__file__), 'hnn_core', 'mod') if platform.system() == 'Windows': + mod_path = op.join(op.dirname(__file__), 'mod') shell = True else: + mod_path = op.join(op.dirname(__file__), 'hnn_core', 'mod') shell = False process = subprocess.Popen(['nrnivmodl'], cwd=mod_path, @@ -98,11 +99,17 @@ def run(self): 'Operating System :: MacOS', ], platforms='any', + install_requires=[ + 'numpy >=1.14', + 'NEURON >=7.7', + 'matplotlib', + 'scipy' + ], packages=find_packages(), - package_data={'hnn_core': - ['param/*.json', - 'mod/*', - 'mod/x86_64/*', - 'mod/x86_64/.lib/*']}, + package_data={'hnn_core': [ + 'param/*.json', + 'mod/*', + 'mod/x86_64/*', + 'mod/x86_64/.lib/*']}, cmdclass={'build_py': build_py_mod, 'build_mod': BuildMod} )