Skip to content

Commit 7ab9f61

Browse files
committed
Bump to v1.0.0
Someone on the internet was making fun of VerZero and I took that personally. Enough is enough!
1 parent 291c5fb commit 7ab9f61

File tree

10 files changed

+105
-25
lines changed

10 files changed

+105
-25
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
deploy:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
- name: Build package
31+
run: python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34+
with:
35+
user: __token__
36+
password: ${{ secrets.EMD_PYPI_API_TOKEN }}

.gitignore

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
build
2-
dist
3-
*.swp
4-
venv
5-
.mypy_cache
6-
.vscode
1+
venv/
2+
.venv/
3+
build/
4+
dist/
75
*.egg-info
6+
7+
.vscode/
8+
.idea/
9+
10+
.mypy_cache
11+
__pycache__
12+
.pytest_cache/
13+
.ipynb_checkpoints/
14+
15+
*.swp
816
*.pyc
9-
*ipynb
17+
*.ipynb

PyEMD/CEEMDAN.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ class CEEMDAN:
3939
values. Two are `range_thr` and `total_power_thr` which relate to
4040
the value range (max - min) and check for total power below, respectively.
4141
42+
Configuration can be passed through keyword parameters.
43+
For example, updating threshold would be through:
44+
45+
Example 1:
46+
47+
>>> config = {"range_thr": 0.001, "total_power_thr": 0.01}
48+
>>> emd = EMD(**config)
49+
50+
Example 2:
51+
52+
>>> emd = EMD(range_thr=0.001, total_power_thr=0.01)
53+
4254
Parameters
4355
----------
4456
@@ -62,6 +74,17 @@ class CEEMDAN:
6274
processes : int or None (optional)
6375
Number of processes harness when executing in parallel mode.
6476
The value should be between 1 and max that depends on your hardware.
77+
noise_scale : float (default: 1)
78+
Scale (amplitude) of the added noise.
79+
noise_kind : str (default: "normal")
80+
What type of noise to add. Allowed are "normal" (default) and "uniform".
81+
range_thr : float (default: 0.01)
82+
Range threshold used as an IMF check. The value is in percentage compared
83+
to initial signal's amplitude. If absolute amplitude (max - min) is below
84+
the `range_thr` then the decomposition is finished.
85+
total_power_thr : float (default: 0.05)
86+
Signal's power threshold. Finishes decomposition if sum(abs(r)) < thr.
87+
6588
6689
References
6790
----------
@@ -80,16 +103,6 @@ class CEEMDAN:
80103
noise_kinds_all = ["normal", "uniform"]
81104

82105
def __init__(self, trials: int=100, epsilon: float = 0.005, ext_EMD = None, parallel: bool = False, **kwargs):
83-
"""
84-
Configuration can be passed through keyword parameters.
85-
For example, updating threshold would be through:
86-
87-
Example 1:
88-
>>> config = {"range_thr": 0.001, "total_power_thr": 0.01}
89-
>>> emd = EMD(**config)
90-
Example 2:
91-
>>> emd = EMD(range_thr=0.001, total_power_thr=0.01)
92-
"""
93106

94107
# Ensemble constants
95108
self.trials = trials

PyEMD/EMD.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,14 @@ def emd(self, S: np.ndarray, T: Optional[np.ndarray] = None, max_imf: int = -1)
887887
def get_imfs_and_residue(self) -> Tuple[np.ndarray, np.ndarray]:
888888
"""
889889
Provides access to separated imfs and residue from recently analysed signal.
890-
:return: (imfs, residue)
890+
891+
Returns
892+
-------
893+
imfs : np.ndarray
894+
Obtained IMFs
895+
residue : np.ndarray
896+
Residue.
897+
891898
"""
892899
if self.imfs is None or self.residue is None:
893900
raise ValueError('No IMF found. Please, run EMD method or its variant first.')
@@ -900,7 +907,14 @@ def get_imfs_and_trend(self) -> Tuple[np.ndarray, np.ndarray]:
900907
Note that this may differ from the `get_imfs_and_residue` as the trend isn't
901908
necessarily the residue. Residue is a point-wise difference between input signal
902909
and all obtained components, whereas trend is the slowest component (can be zero).
903-
:return: (imfs, trend)
910+
911+
Returns
912+
-------
913+
imfs : np.ndarray
914+
Obtained IMFs
915+
trend : np.ndarray
916+
The main trend.
917+
904918
"""
905919
if self.imfs is None or self.residue is None:
906920
raise ValueError('No IMF found. Please, run EMD method or its variant first.')

PyEMD/__init__.py

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

3-
__version__ = "0.2.15"
3+
__version__ = "1.0.0"
44
logger = logging.getLogger('pyemd')
55

66
from PyEMD.EMD import EMD

doc/ceemdan.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ Info
77
Complete ensemble EMD with adaptive noise (CEEMDAN) performs an EEMD with
88
the difference that the information about the noise is shared among all workers.
99

10+
11+
.. note::
12+
Given the nature of CEEMDAN, each time you decompose a signal you will obtain a different set of components.
13+
That's the expected consequence of adding noise which is going to be random and different.
14+
To make the decomposition reproducible, one needs to set a seed for the random number generator used in CEEMDAN.
15+
This is done using :func:`PyEMD.CEEMDAN.noise_seed` method on the instance.
16+
1017
Class
1118
-----
1219

1320
.. autoclass:: PyEMD.CEEMDAN
1421
:members:
15-
:special-members:

doc/eemd.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ EEMD
33

44
Info
55
----
6+
67
Ensemble empirical mode decomposition (EEMD) creates an ensemble of worker each
78
of which performs an :doc:`EMD </emd>` on a copy of the input signal with added noise.
89
When all workers finish their work a mean over all workers is considered as

doc/examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Example
2-
*******
1+
Examples
2+
********
33

44
Some examples can be found in PyEMD/example directory.
55

doc/intro.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ The easiest way is to either add `EMD-signal`_ to your `requirements.txt` file,
2828

2929
$ pip install EMD-signal
3030

31-
And, yes, the package is updated every time there is a new algorithm or other cools features added.
31+
Once the package is installed it should be accessible in your Python as `PyEMD`, e.g. ::
32+
33+
>>> from PyEMD import EMD
3234

3335
Research (github)
3436
`````````````````

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
VERSION="0.2.15"
3+
VERSION="1.0.0"
44

55
DESCRIPTION = "Implementation of the Empirical Mode Decomposition (EMD) and its variations"
66

0 commit comments

Comments
 (0)