Skip to content

Commit

Permalink
Keunwooc/remove py27 (#63)
Browse files Browse the repository at this point in the history
* bump version to 0.1.7; update metadata

* add tox.ini

* remove py2.7 dependency, future

* black and other linting

* tox is local; pytest on travis

* update log

* update readme
  • Loading branch information
keunwoochoi authored Feb 20, 2020
1 parent 8aaf4fc commit 4e13983
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 46 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: python
python:
- 2.7
- 3.6
- "3.6"
- "3.7"

install:
- pip install --pre -e .[tests]
- pip install --pre -e .

script:
- pytest
Expand Down
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ How demanding is the computation? [Check out this paper!](https://arxiv.org/abs/
- [`augmentation.AdditiveNoise`](#additivenoise)

## News
* 20 Feb 2020
- Kapre ver 0.1.7
- No vanilla Keras dependency
- Tensorflow >= 1.15 only
- Not tested on Python 2.7 anymore; only on Python 3.6 and 3.7.

* 20 Feb 2019
- Kapre ver 0.1.4
- Fixed amplitude-to-decibel error as raised in [#46](https://github.com/keunwoochoi/kapre/issues/46)
Expand All @@ -40,23 +46,10 @@ How demanding is the computation? [Check out this paper!](https://arxiv.org/abs/
## Installation
([↑up to contents](#contents))

1. For keras >= 2.0
Kapre is now working with tensorflow >= 1.15.

```sh
pip install kapre
```
Or,
```sh
git clone https://github.com/keunwoochoi/kapre.git
cd kapre
python setup.py install
```

2. For Keras 1.x (note: it is not updated anymore;)
```sh
git clone https://github.com/keunwoochoi/kapre.git
cd kapre
git checkout a2bde3e
python setup.py install
pip install git+https://github.com/keunwoochoi/kapre.git
```

## Usage
Expand Down
4 changes: 1 addition & 3 deletions kapre/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from __future__ import absolute_import

__version__ = '0.1.4'
__version__ = '0.1.7'
VERSION = __version__

from . import time_frequency
Expand Down
2 changes: 0 additions & 2 deletions kapre/augmentation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer, InputSpec
Expand Down
2 changes: 0 additions & 2 deletions kapre/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from tensorflow.keras import backend as K
import numpy as np
import librosa
# Forward compatability to replace xrange
from builtins import range

EPS = 1e-7

Expand Down
2 changes: 0 additions & 2 deletions kapre/backend_keras.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from tensorflow.keras import backend as K

Expand Down
5 changes: 0 additions & 5 deletions kapre/filterbank.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from tensorflow.keras.layers import Layer
from tensorflow.keras import backend as K
from kapre import backend


# Todo: Filterbank(); init with mel, log, linear, etc.
# not parameterised, just a matrix multiplication

class Filterbank(Layer):
"""
### `Filterbank`
Expand Down
2 changes: 0 additions & 2 deletions kapre/time_frequency.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer
Expand Down
2 changes: 0 additions & 2 deletions kapre/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer
Expand Down
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
from setuptools import setup

setup(name='kapre',
version='0.1.6',
version='0.1.7',
description='Kapre: Keras Audio Preprocessors. Keras layers for audio pre-processing in deep learning',
author='Keunwoo Choi',
url='http://github.com/keunwoochoi/kapre/',
# download_url='http://github.com/keunwoochoi/kapre/releases', # TODO
author_email='[email protected]',
author_email='[email protected]',
license='MIT',
packages=['kapre'],
package_data={'': ['tests/speech_test_file.npz', 'tests/test_audio_mel_g0.npy', 'tests/test_audio_stft_g0.npy']},
package_data={'kapre': ['tests/speech_test_file.npz', 'tests/test_audio_mel_g0.npy', 'tests/test_audio_stft_g0.npy']},
include_package_data=True,
install_requires=[
'numpy >= 1.8.0',
'librosa >= 0.5',
'tensorflow >= 1.15',
'future'
],
extras_require={
'tests': ['tensorflow'],
},
keywords='audio music deep learning keras',
zip_safe=False)
1 change: 0 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import tensorflow.keras.backend as K
from tensorflow.keras.backend import image_data_format
import kapre
import pdb
import librosa
from kapre.utils import AmplitudeToDB, Normalization2D

Expand Down
40 changes: 40 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[tox]
envlist = py37,python3.6,black
skipsdist = False
usedevelop = True
indexserver =
spotify = https://artifactory.spotify.net/artifactory/api/pypi/pypi/simple

[testenv]
whitelist_externals = python

[testenv:py37]
basepython = python3.7
deps =
pytest
commands =
py.test {posargs}

[testenv:py36]
basepython = python3.6
deps =
pytest
commands =
py.test {posargs}

[testenv:black]
; "black" is a code formatter, much like gofmt. It requires 3.6 or higher.
; Tingle has 3.6 available to it; but feel free to uncomment the line
; `ignore_outcome` if it fails. Docs: https://github.com/ambv/black
;ignore_outcome = true
basepython = python3.7
deps = black
skip_install = true
commands =
; remove the '--diff' and '--check' flags to automatically write out corrections
black --line-length 100 --diff --check --skip-string-normalization --target-version=py37 {toxinidir}/kapre
black --line-length 100 --diff --check --skip-string-normalization --target-version=py37 {toxinidir}/tests

; The sections defined below are for configuring specific tools that are used
; in the above testenvs. Usually, if the tool is ran directly/outside of tox,
; i.e. `(env) $ pytest`, it will still pick up this configuration.

0 comments on commit 4e13983

Please sign in to comment.