Skip to content

Commit addba6c

Browse files
committed
make release-tag: Merge branch 'master' into stable
2 parents bc2e0d0 + e387674 commit addba6c

File tree

14 files changed

+236
-60
lines changed

14 files changed

+236
-60
lines changed

.travis.yml

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

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# History
22

3-
## 0.0.1 - 2020-11-30
3+
## 0.0.1 - 2021-01-26
44

55
First release to PyPI.
66

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include CONTRIBUTING.md
33
include HISTORY.md
44
include LICENSE
55
include README.md
6+
include sigpro/data/demo_timeseries.csv
67

78
recursive-include tests *
89
recursive-exclude * __pycache__

Makefile

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,48 +81,51 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
8181
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
8282
pip install -e .[dev]
8383

84-
MINIMUM := $(shell sed -n '/install_requires = \[/,/]/p' setup.py | head -n-1 | tail -n+2 | sed 's/ *\(.*\),$?$$/\1/g' | tr '>' '=')
85-
86-
.PHONY: install-minimum
87-
install-minimum: ## install the minimum supported versions of the package dependencies
88-
pip install $(MINIMUM)
8984

9085
# LINT TARGETS
9186

9287
.PHONY: lint
9388
lint: ## check style with flake8 and isort
94-
flake8 sigpro
95-
flake8 tests --ignore=D
96-
isort -c --recursive sigpro tests
97-
pylint sigpro --rcfile=setup.cfg
89+
invoke lint
9890

9991
.PHONY: fix-lint
10092
fix-lint: ## fix lint issues using autoflake, autopep8, and isort
101-
find sigpro tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
102-
autopep8 --in-place --recursive --aggressive sigpro tests
103-
isort --apply --atomic --recursive sigpro tests
93+
find sigpro -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
94+
autopep8 --in-place --recursive --aggressive sigpro
95+
isort --apply --atomic --recursive sigpro
10496

97+
find tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
98+
autopep8 --in-place --recursive --aggressive tests
99+
isort --apply --atomic --recursive tests
105100

106101
# TEST TARGETS
107102

108103
.PHONY: test-unit
109104
test-unit: ## run tests quickly with the default Python
110-
python -m pytest --cov=sigpro
105+
invoke pytest
111106

112107
.PHONY: test-readme
113108
test-readme: ## run the readme snippets
114-
rm -rf tests/readme_test && mkdir tests/readme_test
115-
cd tests/readme_test && rundoc run --single-session python3 -t python3 ../../README.md
116-
rm -rf tests/readme_test
109+
invoke readme
110+
111+
112+
.PHONY: test-tutorials
113+
test-tutorials: ## run the tutorial notebooks
114+
invoke tutorials
115+
117116

118117
.PHONY: test
119-
test: test-unit test-readme ## test everything that needs test dependencies
118+
test: test-unit test-readme test-tutorials ## test everything that needs test dependencies
119+
120+
.PHONY: check-dependencies
121+
check-dependencies: ## test if there are any broken dependencies
122+
pip check
120123

121124
.PHONY: test-devel
122-
test-devel: lint docs ## test everything that needs development dependencies
125+
test-devel: check-dependencies lint docs ## test everything that needs development dependencies
123126

124127
.PHONY: test-all
125-
test-all: ## test using tox
128+
test-all:
126129
tox -r
127130

128131
.PHONY: coverage
@@ -132,12 +135,11 @@ coverage: ## check code coverage quickly with the default Python
132135
coverage html
133136
$(BROWSER) htmlcov/index.html
134137

135-
136138
# DOCS TARGETS
137139

138140
.PHONY: docs
139141
docs: clean-docs ## generate Sphinx HTML documentation, including API docs
140-
sphinx-apidoc --separate --no-toc -o docs/api/ sigpro
142+
sphinx-apidoc --module-first --separate -T -o docs/api/ sigpro
141143
$(MAKE) -C docs html
142144

143145
.PHONY: view-docs
@@ -146,7 +148,7 @@ view-docs: docs ## view docs in browser
146148

147149
.PHONY: serve-docs
148150
serve-docs: view-docs ## compile the docs watching for changes
149-
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' docs
151+
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' .
150152

151153

152154
# RELEASE TARGETS
@@ -170,7 +172,7 @@ publish-test: dist publish-confirm ## package and upload a release on TestPyPI
170172

171173
.PHONY: publish
172174
publish: dist publish-confirm ## package and upload a release
173-
twine upload --repository-url https://pypi.dailab.ml:8080 dist/*
175+
twine upload dist/*
174176

175177
.PHONY: bumpversion-release
176178
bumpversion-release: ## Merge master to stable and bumpversion release

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
[![Development Status](https://img.shields.io/badge/Development%20Status-2%20--%20Pre--Alpha-yellow)](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
77
[![PyPi Shield](https://img.shields.io/pypi/v/SigPro.svg)](https://pypi.python.org/pypi/SigPro)
8-
[![Travis CI Shield](https://travis-ci.org/signals-dev/SigPro.svg?branch=master)](https://travis-ci.org/signals-dev/SigPro)
9-
[![Coverage Status](https://codecov.io/gh/signals-dev/SigPro/branch/master/graph/badge.svg)](https://codecov.io/gh/signals-dev/SigPro)
8+
[![Tests](https://github.com/signals-dev/SigPro/workflows/Run%20Tests/badge.svg)](https://github.com/signals-dev/SigPro/actions?query=workflow%3A%22Run+Tests%22+branch%3Amaster)
109
[![Downloads](https://pepy.tech/badge/sigpro)](https://pepy.tech/project/sigpro)
1110

1211

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.0.1
2+
current_version = 0.0.1.dev1
33
commit = True
44
tag = True
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
history = history_file.read()
1313

1414
install_requires = [
15-
'mlblocks>=0.3.4,<0.4',
15+
'mlblocks>=0.4.0,<0.5',
1616
'pandas>=1,<2',
17-
'numpy>=1.15.4,<2',
17+
'numpy>=1.17.4,<1.19',
1818
'scipy>=1.3.3,<2',
1919
]
2020

@@ -61,6 +61,7 @@
6161
'coverage>=4.5.1,<6',
6262
'tox>=2.9.1,<4',
6363
'importlib-metadata<2,>=0.12',
64+
'invoke',
6465
]
6566

6667
setup(
@@ -99,6 +100,6 @@
99100
test_suite='tests',
100101
tests_require=tests_require,
101102
url='https://github.com/signals-dev/SigPro',
102-
version='0.0.1',
103+
version='0.0.1.dev1',
103104
zip_safe=False,
104105
)

sigpro/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__author__ = """MIT Data To AI Lab"""
66
__email__ = '[email protected]'
7-
__version__ = '0.0.1'
7+
__version__ = '0.0.1.dev1'
88

99
import os
1010

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Band Module."""
2+
3+
import numpy as np
4+
5+
6+
def band_mean(amplitude_values, frequency_values, min_frequency, max_frequency):
7+
"""Compute the mean values for a specific band.
8+
9+
Filter between a high and low band and compute the mean value for this specific band.
10+
11+
Args:
12+
amplitude_values (np.ndarray):
13+
A numpy array with the signal values.
14+
frequency_values (np.ndarray):
15+
A numpy array with the frequency values.
16+
min_frequency (int or float):
17+
Band minimum.
18+
max_frequency (int or float):
19+
Band maximum.
20+
21+
Returns:
22+
float:
23+
Mean value for the given band.
24+
"""
25+
lower_frequency_than = frequency_values <= max_frequency
26+
higher_frequency_than = frequency_values >= min_frequency
27+
selected_idx = np.where(higher_frequency_than & lower_frequency_than)
28+
selected_values = amplitude_values[selected_idx]
29+
30+
return np.mean(selected_values)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "sigpro.aggregations.frequency.band.band_mean",
3+
"primitive": "sigpro.aggregations.frequency.band.band_mean",
4+
"classifiers": {
5+
"type": "aggregation",
6+
"subtype": "frequency"
7+
},
8+
"produce": {
9+
"args": [
10+
{
11+
"name": "amplitude_values",
12+
"type": "numpy.ndarray"
13+
},
14+
{
15+
"name": "frequency_values",
16+
"type": "numpy.ndarray"
17+
}
18+
],
19+
"output": [
20+
{
21+
"name": "value",
22+
"type": "float"
23+
}
24+
]
25+
},
26+
"hyperparameters": {
27+
"fixed": {
28+
"min_frequency": {
29+
"type": "float"
30+
},
31+
"max_frequency": {
32+
"type": "float"
33+
}
34+
},
35+
"tunable": {}
36+
}
37+
}

0 commit comments

Comments
 (0)