Skip to content

Commit f258296

Browse files
committed
make release-tag: Merge branch 'master' into stable
2 parents 98c474a + 10973a8 commit f258296

File tree

14 files changed

+184
-54
lines changed

14 files changed

+184
-54
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Python
1515
uses: actions/setup-python@v1
1616
with:
17-
python-version: 3.8
17+
python-version: 3.9
1818

1919
- name: Build
2020
run: |
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
name: Latest Dependency Checker
2-
on:
3-
schedule:
4-
- cron: '0 * * * *'
5-
workflow_dispatch:
6-
jobs:
7-
build:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v2
11-
- name: Set up Python 3.8
12-
uses: actions/setup-python@v2
13-
with:
14-
python-version: 3.8
15-
- name: Update dependencies
16-
run: |
17-
python -m pip install --upgrade pip
18-
python -m pip install -e .[test]
19-
make checkdeps OUTPUT_PATH=tests/requirement_files/latest_requirements.txt
20-
- name: Create pull request
21-
uses: peter-evans/create-pull-request@v3
22-
with:
23-
token: ${{ secrets.REPO_SCOPED_TOKEN }}
24-
commit-message: Update latest dependencies
25-
title: Automated Latest Dependency Updates
26-
body: "This is an auto-generated PR with **latest** dependency updates."
27-
branch: latest-dep-update
28-
branch-suffix: short-commit-hash
29-
base: master
30-
team-reviewers: core
1+
# name: Latest Dependency Checker
2+
# on:
3+
# schedule:
4+
# - cron: '0 * * * *'
5+
# workflow_dispatch:
6+
# jobs:
7+
# build:
8+
# runs-on: ubuntu-latest
9+
# steps:
10+
# - uses: actions/checkout@v2
11+
# - name: Set up Python 3.9
12+
# uses: actions/setup-python@v2
13+
# with:
14+
# python-version: 3.9
15+
# - name: Update dependencies
16+
# run: |
17+
# python -m pip install --upgrade pip
18+
# python -m pip install -e .[test]
19+
# make checkdeps OUTPUT_PATH=tests/requirement_files/latest_requirements.txt
20+
# - name: Create pull request
21+
# uses: peter-evans/create-pull-request@v3
22+
# with:
23+
# token: ${{ secrets.REPO_SCOPED_TOKEN }}
24+
# commit-message: Update latest dependencies
25+
# title: Automated Latest Dependency Updates
26+
# body: "This is an auto-generated PR with **latest** dependency updates."
27+
# branch: latest-dep-update
28+
# branch-suffix: short-commit-hash
29+
# base: master
30+
# team-reviewers: core

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
python-version: [3.8]
14+
python-version: ['3.9']
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
steps:
1717
- uses: actions/checkout@v1
@@ -29,8 +29,8 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030
strategy:
3131
matrix:
32-
python-version: ['3.8']
33-
os: [ubuntu-20.04]
32+
python-version: ['3.9']
33+
os: [ubuntu-latest]
3434
steps:
3535
- uses: actions/checkout@v1
3636
- name: Set up Python ${{ matrix.python-version }}
@@ -47,8 +47,8 @@ jobs:
4747
runs-on: ${{ matrix.os }}
4848
strategy:
4949
matrix:
50-
python-version: ['3.8', '3.9', '3.10', '3.11']
51-
os: [ubuntu-20.04, macos-latest, windows-latest]
50+
python-version: ['3.9', '3.10', '3.11', '3.12']
51+
os: [ubuntu-latest, macos-latest, windows-latest]
5252
steps:
5353
- uses: actions/checkout@v1
5454
- name: Set up Python ${{ matrix.python-version }}
@@ -68,8 +68,8 @@ jobs:
6868
runs-on: ${{ matrix.os }}
6969
strategy:
7070
matrix:
71-
python-version: ['3.8', '3.9', '3.10', '3.11']
72-
os: [ubuntu-20.04, macos-latest]
71+
python-version: ['3.9', '3.10', '3.11', '3.12']
72+
os: [ubuntu-latest, macos-latest]
7373
steps:
7474
- uses: actions/checkout@v1
7575
- name: Set up Python ${{ matrix.python-version }}
@@ -79,4 +79,4 @@ jobs:
7979
- name: Install package and dependencies
8080
run: pip install invoke .[test]
8181
- name: invoke minimum
82-
run: invoke minimum
82+
run: invoke minimum

HISTORY.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# History
22

3+
## 0.3.0 - 2025-02-17
4+
5+
### Features
6+
* Add Support for Python 3.12 & Remove 3.8 - [Issue #63](https://github.com/sintel-dev/SigPro/pull/63) by @sarahmish
7+
* Add fft frequency transformation - [Issue #62](https://github.com/sintel-dev/SigPro/pull/62) by @SaraPido
8+
* Band rms - [Issue #61](https://github.com/sintel-dev/SigPro/pull/61) by @SaraPido
9+
10+
311
## 0.2.1 - 2024-04-24
412

513
### Features
614

7-
* Frequency primitive - [Issue #60](https://github.com/sintel-dev/SigPro/pull/60)
15+
* Frequency primitive - [Issue #60](https://github.com/sintel-dev/SigPro/pull/60) by @SaraPido
816

917

1018
## 0.2.0 - 2024-02-02

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ in order to solve time series machine learning problems.
2525

2626
## Requirements
2727

28-
**SigPro** has been developed and tested on [Python 3.8, 3.9, 3.10, and 3.11](https://www.python.org/downloads/)
28+
**SigPro** has been developed and tested on [Python 3.9, 3.10, 3.11 and 3.12](https://www.python.org/downloads/)
2929
on GNU/Linux and macOS systems.
3030

3131
Also, although it is not strictly required, the usage of a [virtualenv](

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.2.1
2+
current_version = 0.3.0.dev0
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: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
history = history_file.read()
1313

1414
install_requires = [
15-
'mlblocks>=0.6.1',
15+
'mlblocks>=0.6.2',
1616
'pandas>=1.5.3',
17-
'numpy>=1.24.4',
18-
'scipy>=1.10.1',
17+
'numpy>=1.26.0',
18+
'scipy>=1.11.3',
1919
]
2020

2121
setup_requires = [
@@ -41,7 +41,16 @@
4141
'sphinx_rtd_theme>=0.2.4,<0.5',
4242
'autodocsumm>=0.1.10',
4343
'markupsafe<2.1.0',
44-
'Jinja2>=2,<3',
44+
'Jinja2>=2,<3.1',
45+
46+
# fails on Sphinx < v3.4
47+
'alabaster<=0.7.12',
48+
# fails on Sphins < v5.0
49+
'sphinxcontrib-applehelp<1.0.8',
50+
'sphinxcontrib-devhelp<1.0.6',
51+
'sphinxcontrib-htmlhelp<2.0.5',
52+
'sphinxcontrib-serializinghtml<1.1.10',
53+
'sphinxcontrib-qthelp<1.0.7',
4554

4655
# style check
4756
'flake8>=3.7.7,<4',
@@ -62,7 +71,8 @@
6271
# Advanced testing
6372
'coverage>=4.5.1,<6',
6473
'tox>=2.9.1,<4',
65-
'importlib-metadata<2,>=0.12',
74+
'importlib-metadata<5',
75+
'mistune<2',
6676
'invoke',
6777
]
6878

@@ -75,12 +85,12 @@
7585
'License :: OSI Approved :: MIT License',
7686
'Natural Language :: English',
7787
'Programming Language :: Python :: 3',
78-
'Programming Language :: Python :: 3.8',
7988
'Programming Language :: Python :: 3.9',
8089
'Programming Language :: Python :: 3.10',
8190
'Programming Language :: Python :: 3.11',
91+
'Programming Language :: Python :: 3.12',
8292
],
83-
description='Signal Processing Tools for Machine Mearning',
93+
description='Signal Processing Tools for Machine Learning',
8494
entry_points={
8595
'mlblocks': [
8696
'primitives=sigpro:MLBLOCKS_PRIMITIVES',
@@ -98,11 +108,11 @@
98108
long_description_content_type='text/markdown',
99109
name='sigpro',
100110
packages=find_packages(include=['sigpro', 'sigpro.*']),
101-
python_requires='>=3.8,<3.12',
111+
python_requires='>=3.9,<3.13',
102112
setup_requires=setup_requires,
103113
test_suite='tests',
104114
tests_require=tests_require,
105115
url='https://github.com/sintel-dev/SigPro',
106-
version='0.2.1',
116+
version='0.3.0.dev0',
107117
zip_safe=False,
108118
)

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.2.1'
7+
__version__ = '0.3.0.dev0'
88

99
import os
1010

sigpro/aggregations/frequency/band.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,33 @@ def band_mean(amplitude_values, frequency_values, min_frequency, max_frequency):
2828
selected_values = amplitude_values[selected_idx]
2929

3030
return np.mean(selected_values)
31+
32+
33+
def band_rms(amplitude_values, frequency_values, min_frequency, max_frequency):
34+
"""
35+
Compute the rms values for a specific band.
36+
37+
Filter between a high and low band (inclusive) and compute the rms value for this
38+
specific band.
39+
40+
Args:
41+
amplitude_values (np.ndarray):
42+
A numpy array with the signal values.
43+
frequency_values (np.ndarray):
44+
A numpy array with the frequency values.
45+
min_frequency (int or float):
46+
Band minimum.
47+
max_frequency (int or float):
48+
Band maximum.
49+
50+
Returns:
51+
float:
52+
rms value for the given band.
53+
"""
54+
lower_frequency_than = frequency_values <= max_frequency
55+
higher_frequency_than = frequency_values >= min_frequency
56+
57+
selected_idx = np.ravel(np.where(higher_frequency_than & lower_frequency_than))
58+
selected_values = amplitude_values[selected_idx]
59+
60+
return np.sqrt(np.mean(np.square(selected_values)))

sigpro/basic_primitives.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,24 @@ def __init__(self, min_frequency, max_frequency):
177177
'min_frequency': min_frequency, 'max_frequency': max_frequency})
178178
self.set_fixed_hyperparameters({'min_frequency': {'type': 'float'},
179179
'max_frequency': {'type': 'float'}})
180+
181+
182+
class BandRMS(primitive.FrequencyAggregation):
183+
"""
184+
BandRMS primitive class.
185+
186+
Filter between a high and low band (inclusive) and compute the rms value for this
187+
specific band.
188+
189+
Args:
190+
min_frequency (int or float):
191+
Band minimum.
192+
max_frequency (int or float):
193+
Band maximum.
194+
"""
195+
196+
def __init__(self, min_frequency, max_frequency):
197+
super().__init__('sigpro.aggregations.frequency.band.band_rms', init_params={
198+
'min_frequency': min_frequency, 'max_frequency': max_frequency})
199+
self.set_fixed_hyperparameters({'min_frequency': {'type': 'float'},
200+
'max_frequency': {'type': 'float'}})

0 commit comments

Comments
 (0)