Skip to content

Commit

Permalink
Automated publication (#39)
Browse files Browse the repository at this point in the history
Reformat and add workflow for publishing to PyPi
  • Loading branch information
simon-ball committed Jun 1, 2021
1 parent 29ce4f2 commit bb47155
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 57 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Publish Opexebo to PyPi-Test

on:
release:
types: [created]


jobs:
build-and-publish:
name: Build and publish Opexebo to PyPi-Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Build and publish (test-pypi)
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
run: |
python setup.py sdist bdist_wheel
twine upload dist/* --verbose
- name: Build and publish (pypi)
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/* --verbose
19 changes: 0 additions & 19 deletions HISTORY.rst

This file was deleted.

22 changes: 19 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
(c) Vadim Frolov, 2018
(c) Simon Ball, 2019, simon.ball@ntnu.no
Copyright 2018 Simon Ball, Vadim Frolov, Horst Obenhaus

Kavli institute for systems neuroscience, http://www.ntnu.edu/kavli
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
author = 'Simon Ball'

# The short X.Y version
version = '0.5.2'
version = '0.5.5'
# The full version, including alpha/beta/rc tags
release = '0.5.2'
release = '0.5.5'


# -- General configuration ---------------------------------------------------
Expand Down
91 changes: 91 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# History


## 0.5.5 (2021-06-01)

* Publish to PyPi


## 0.5.2 (2021-04-19)

* Support 1D data in spatial occupancy and ratemap
* Add Opexebo-specific errors
* Add automated testing prior to release
* Add `calculate_speed`
* Add `egocentric_occupancy`
* Fixed an edge case error in `accumulate_spatial`


## 0.4.3 (2020-02-19)

* Substantial cleanup to `accumulate_spatial`
- Function was mathematically correct but confusing, due to the difference between opexebo's standard of `(x, y)` and NumPy's standard of `(y, x)`
* Added `upsampling`
* Added `circular_mask`
* Mandatory keyword arguments have been made positional
* `peak_search` updated to handle issues with MaskedArrays containing negative values
* Dcumentation expanded, made Sphinx compatible, and published on ReadTheDocs
* Further work on BorderScore, still experimental though
- Functional for Rectangular arenas
- Circular arenas are still WIP, should not be relied upon yet.


## 0.4.2 (2020-02-05)

* Speedscore modified substantially
- Adaptive filtering added, allowing the user to specify an upper speed as a bandwidth
- Adaptive filtering adjusted to behave more sensibly in the case of small bin sizes
- Speeds are smoothed before correlating
* Spatial cross correlation added
* General `bin_number` to `bin_size` code refactored to make future development more consistent
* Assorted unit tests added, including run-once code removed for speed
* Fix errors associated with `>` where applied to MaskedArrays (which, unlike ndarrays, do not correctly obey the symbol)


## 0.4.0 (2019-12-10)

* Ratemaps updated to handle walk filter (signature now requires providing animal speeds)
* Angular occupancy coverage calculation corrected
* circular arenas now handled in Spatial Occupancy
* Population Vector Correlation added


## 0.3.5 (2019-11-18)

* Assorted bugfixes to HDtuning
* Gridscore to handle NaNs more gracefully


## 0.3.4 (2019-20-25)

* `sep` made an optional dependency
* Alternative, non `sep` based code uses `skimage`
* Attempting to use `sep` if not installed with raise an error


## 0.3.2 (2019-09-20)

* Consistent calculating of bin numbers when histogramming


## 0.3.0 (2019-08-27)

* Third development release
* Improve NaN handling throughout by moving to MaskedArrays
* Fix Angular handling to function in seconds instead of frames
* Remove matplotlib from requirements


## 0.2.0

* Second development release
- Implementation of time-map -> rate-map -> (acorr, gridness score)
- Implementation of rate-map stats, grid stats
- Implementation of angular-map -> tuning-curve -> head direction score, stats.
- Non-production-ready implementation of border-score, speed-score.


## 0.1.0 (2018-08-30)

* First development release
- Implementation of gridness score, autocorrelogram, place-field detection
2 changes: 1 addition & 1 deletion opexebo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

__author__ = """Simon Ball"""
__email__ = 'simon.ball@ntnu.no'
__version__ = '0.5.2'
__version__ = '0.5.5'
30 changes: 7 additions & 23 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
# opexebo


[![Build Status](https://travis-ci.com/kavli-ntnu/opexebo.svg?branch=master&status=passed)](https://travis-ci.com/kavli-ntnu/opexebo)
[![codecov](https://codecov.io/gh/kavli-ntnu/opexebo/branch/master/graph/badge.svg)](https://codecov.io/gh/kavli-ntnu/opexebo)
[![Documentation Status](https://readthedocs.org/projects/opexebo/badge/?version=latest)](https://opexebo.readthedocs.io/en/latest/?badge=latest)

This library provides various analysis tools written by and for the Moser group at the [Kavli Institute](https://www.ntnu.edu/kavli) in Trondheim.

The package contains a mixture of translations of the older MatLab based [Behavioural Neurology Toolbox](https://bitbucket.org/cnc-ntnu/bnt), and other functions written only in Python 3, as part of the transition towards providing open access to research code.

Collections of code in use in the Moser Group at the [Kavli Institute](https://www.ntnu.edu/kavli) in Trondheim

### Documentation

Specifications and documentation for `opexebo` are available on [Read the Docs](https://opexebo.readthedocs.io/en/latest/).

### Installation

### Installation

Install by using pip:
Install with pip:

```bash
pip install git+https://github.com/kavli-ntnu/opexebo.git -U
```

A specific revision, branch, tag, or release an be installed with the @ modifier::

```bash
pip install git+https://github.com/kavli-ntnu/opexebo.git@v0.3.3
pip install opexebo
```

Installing in this way requires having `git`, this can be acquired from::

https://git-scm.com/download/win

Opexebo has an optional dependency, `sep`, that is not installed by default. To be able to install it, you require a C++ compiler installed on your system. On Linux, `gcc` will do the job. On Windows, the the Microsoft Visual C++ Build Tools fulfil the same role (https://www.microsoft.com/en-us/download/details.aspx?id=48159). To force installation of all optional dependencies, append `#egg[full]` to the install command, for example::

pip install git+https://github.com/kavli-ntnu/opexebo.git@v0.3.3#egg[full]




Opexebo has an optional dependency, `sep`, that is not installed by default. To be able to install it, you require a C++ compiler installed on your system. On Linux, `gcc` will do the job. On Windows, the the Microsoft Visual C++ Build Tools fulfil the same role (https://www.microsoft.com/en-us/download/details.aspx?id=48159). To force installation of all optional dependencies, append `[full]` to the install command, for example:

pip install opexebo[full]
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.2
current_version = 0.5.5
commit = False
tag = False

Expand Down Expand Up @@ -36,4 +36,3 @@ release = 0.2.0
source-dir = 'docs'

[aliases]

16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open('readme.md') as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
with open('history.md') as history_file:
history = history_file.read()

here = path.abspath(path.dirname(__file__))
Expand All @@ -24,26 +24,28 @@
test_requirements = [ ]

setup(
name='opexebo',
description="Collection of python code in Kavli lab.",
long_description=readme + '\n\n' + history,
long_description_content_type="text/markdown",
url='https://github.com/kavli-ntnu/opexebo',
author="Simon Ball",
author_email='simon.ball@ntnu.no',
classifiers=[
"License :: OSI Approved :: MIT License",
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3'
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
description="Collection of python code in Kavli lab.",
install_requires=requirements,
extras_require={"full": optional_requirements},
long_description=readme + '\n\n' + history,
include_package_data=True,
keywords='neuroscience kavli gridscore',
name='opexebo',
packages=find_packages(include=['opexebo*']),
url='https://github.com/kavli-ntnu/opexebo',
version='0.5.2',
version='0.5.5',
zip_safe=False,
)

0 comments on commit bb47155

Please sign in to comment.