Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #492 from SpikeInterface/incr_version
Browse files Browse the repository at this point in the history
SE dependencies and new release
  • Loading branch information
alejoe91 authored Jul 27, 2021
2 parents 74f47e6 + 14d3833 commit 7b7780d
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 37 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Python Package using Conda

on: [push]

jobs:
build-and-test:
name: Test on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
with:
python-version: 3.8
- name: Which python
run: |
conda --version
which python
- name: Install dependencies
run: |
pip install https://github.com/SpikeInterface/spikeextractors/archive/master.zip
pip install https://github.com/SpikeInterface/spikemetrics/archive/master.zip
pip install https://github.com/SpikeInterface/spikefeatures/archive/master.zip
pip install -e .
pip install pytest
- name: Test with pytest and build coverage report
run: |
pytest
41 changes: 41 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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: Test and Upload Python Package

on:
push:
tags:
- '*'

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
pip install numpy>=1.20
pip install pandas>=1.2
pip install -e .
pip install pytest
- name: Test with pytest and build coverage report
run: |
pytest
- name: Publish on PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package_data={},
install_requires=[
'numpy',
'spikeextractors>=0.9.4',
'spikeextractors>=0.9.7',
'spikemetrics>=0.2.4',
'spikefeatures',
'scikit-learn',
Expand Down
2 changes: 1 addition & 1 deletion spiketoolkit/preprocessing/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, recording, bool_mask):
self._mask = bool_mask
assert len(bool_mask) == recording.get_num_frames(), "'bool_mask' should be a boolean array with length of " \
"number of frames"
assert np.array(bool_mask).dtype in (bool, np.bool), "'bool_mask' should be a boolean array"
assert np.array(bool_mask).dtype == bool, "'bool_mask' should be a boolean array"
self.is_dumpable = False
BasePreprocessorRecordingExtractor.__init__(self, recording)
self._kwargs = {'recording': recording.make_serialized_dict(), 'bool_mask': bool_mask}
Expand Down
4 changes: 2 additions & 2 deletions spiketoolkit/preprocessing/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_traces(self, channel_ids=None, start_frame=None, end_frame=None, return_

traces = self._recording.get_traces(channel_ids=channel_ids, start_frame=start_frame, end_frame=end_frame,
return_scaled=return_scaled)
if isinstance(self._scalar, (int, float, np.integer, np.float)):
if isinstance(self._scalar, (int, float, np.integer)):
traces = traces*self._scalar
else:
if len(self._scalar) == len(channel_ids):
Expand All @@ -37,7 +37,7 @@ def get_traces(self, channel_ids=None, start_frame=None, end_frame=None, return_
channel_idxs = np.array([self._recording.get_channel_ids().index(ch) for ch in channel_ids])
scalar = np.array(self._scalar)[channel_idxs]
traces = traces * scalar[:, np.newaxis]
if isinstance(self._offset, (int, float, np.integer, np.float)):
if isinstance(self._offset, (int, float, np.integer)):
traces = traces + self._offset
else:
if len(self._offset) == len(channel_ids):
Expand Down
2 changes: 1 addition & 1 deletion spiketoolkit/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.7.5'
version = '0.7.6'

0 comments on commit 7b7780d

Please sign in to comment.