harm-analysis 1.2.0__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. harm_analysis-1.3.0/LICENSE +21 -0
  2. harm_analysis-1.3.0/PKG-INFO +63 -0
  3. harm_analysis-1.3.0/README.md +40 -0
  4. harm_analysis-1.3.0/pyproject.toml +156 -0
  5. harm_analysis-1.3.0/src/harm_analysis/__init__.py +29 -0
  6. harm_analysis-1.3.0/src/harm_analysis/_harm_analysis.py +834 -0
  7. harm_analysis-1.3.0/src/harm_analysis/cli.py +139 -0
  8. harm_analysis-1.3.0/tests/__init__.py +22 -0
  9. harm_analysis-1.3.0/tests/conftest.py +31 -0
  10. harm_analysis-1.3.0/tests/test_cli.py +80 -0
  11. harm_analysis-1.3.0/tests/test_harm_analysis.py +341 -0
  12. harm_analysis-1.3.0/tests/test_spectrum_analysis.py +71 -0
  13. harm_analysis-1.2.0/.DS_Store +0 -0
  14. harm_analysis-1.2.0/.gitignore +0 -160
  15. harm_analysis-1.2.0/.readthedocs.yaml +0 -32
  16. harm_analysis-1.2.0/PKG-INFO +0 -75
  17. harm_analysis-1.2.0/README.rst +0 -60
  18. harm_analysis-1.2.0/docs/Makefile +0 -20
  19. harm_analysis-1.2.0/docs/harm_analysis_out_example.png +0 -0
  20. harm_analysis-1.2.0/docs/make.bat +0 -35
  21. harm_analysis-1.2.0/docs/requirements.txt +0 -35
  22. harm_analysis-1.2.0/docs/source/conf.py +0 -49
  23. harm_analysis-1.2.0/docs/source/harm_analysis.rst +0 -6
  24. harm_analysis-1.2.0/docs/source/index.rst +0 -106
  25. harm_analysis-1.2.0/docs/source/tutorial/examples/run_harm_analysis.py +0 -30
  26. harm_analysis-1.2.0/docs/source/tutorial/examples/run_shaped_noise_example.py +0 -27
  27. harm_analysis-1.2.0/harm_analysis/__init__.py +0 -1
  28. harm_analysis-1.2.0/harm_analysis/_harm_analysis.py +0 -677
  29. harm_analysis-1.2.0/harm_analysis/cli.py +0 -49
  30. harm_analysis-1.2.0/harm_analysis.egg-info/PKG-INFO +0 -75
  31. harm_analysis-1.2.0/harm_analysis.egg-info/SOURCES.txt +0 -30
  32. harm_analysis-1.2.0/harm_analysis.egg-info/dependency_links.txt +0 -1
  33. harm_analysis-1.2.0/harm_analysis.egg-info/entry_points.txt +0 -2
  34. harm_analysis-1.2.0/harm_analysis.egg-info/requires.txt +0 -4
  35. harm_analysis-1.2.0/harm_analysis.egg-info/top_level.txt +0 -1
  36. harm_analysis-1.2.0/pyproject.toml +0 -40
  37. harm_analysis-1.2.0/requirents.txt +0 -4
  38. harm_analysis-1.2.0/setup.cfg +0 -4
  39. harm_analysis-1.2.0/tests/__init__.py +0 -0
  40. harm_analysis-1.2.0/tests/test_cli.py +0 -44
  41. harm_analysis-1.2.0/tests/test_data_cli.txt +0 -2048
  42. harm_analysis-1.2.0/tests/test_harm_analysis.py +0 -286
  43. harm_analysis-1.2.0/tests/test_harm_analysis_cli.py +0 -44
  44. {harm_analysis-1.2.0 → harm_analysis-1.3.0/tests}/test_data_cli.txt +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ericsmacedo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.1
2
+ Name: harm-analysis
3
+ Version: 1.3.0
4
+ Summary: A Python library to estimate parameters from a signal containing a tone.
5
+ Keywords: DSP,Signal-Processing,THD,SNR
6
+ Author-Email: Eric Macedo <ericsmacedo@gmail.com>
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Operating System :: OS Independent
13
+ Project-URL: Homepage, https://github.com/ericsmacedo/harm-analysis
14
+ Project-URL: Documentation, https://harm-analysis.readthedocs.io/en/stable/
15
+ Project-URL: Bug Tracker, https://github.com/ericsmacedo/harm-analysis/issues
16
+ Requires-Python: <4.0,>=3.10.0
17
+ Requires-Dist: click>=8.2.1
18
+ Requires-Dist: matplotlib>=3.10.3
19
+ Requires-Dist: numpy>=2.2.6
20
+ Requires-Dist: rich>=14.1.0
21
+ Requires-Dist: scipy>=1.15.3
22
+ Description-Content-Type: text/markdown
23
+
24
+
25
+ [![PyPI Version](https://badge.fury.io/py/harm-analysis.svg)](https://badge.fury.io/py/harm-analysis)
26
+ [![Python Build](https://github.com/ericsmacedo/harm-analysis/actions/workflows/main.yml/badge.svg)](https://github.com/ericsmacedo/harm-analysis/actions/workflows/main.yml)
27
+ [![Documentation](https://readthedocs.org/projects/harm-analysis/badge/?version=stable)](https://harm-analysis.readthedocs.io/en/stable/)
28
+ [![Coverage Status](https://coveralls.io/repos/github/ericsmacedo/harm-analysis/badge.svg?branch=main)](https://coveralls.io/github/ericsmacedo/harm-analysis?branch=main)
29
+ [![python-versions](https://img.shields.io/pypi/pyversions/harm-analysis.svg)](https://pypi.python.org/pypi/harm-analysis)
30
+ [![semantic-versioning](https://img.shields.io/badge/semver-2.0.0-green)](https://semver.org/)
31
+
32
+ [![Downloads](https://img.shields.io/pypi/dm/harm-analysis.svg?label=pypi%20downloads)](https://pypi.python.org/pypi/harm-analysis)
33
+ [![Contributors](https://img.shields.io/github/contributors/ericsmacedo/harm-analysis.svg)](https://github.com/ericsmacedo/harm-analysis/graphs/contributors/)
34
+ [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
35
+ [![Issues](https://img.shields.io/github/issues/ericsmacedo/harm-analysis)](https://github.com/ericsmacedo/harm-analysis/issues)
36
+ [![PRs open](https://img.shields.io/github/issues-pr/ericsmacedo/harm-analysis.svg)](https://github.com/ericsmacedo/harm-analysis/pulls)
37
+ [![PRs done](https://img.shields.io/github/issues-pr-closed/ericsmacedo/harm-analysis.svg)](https://github.com/ericsmacedo/harm-analysis/pulls?q=is%3Apr+is%3Aclosed)
38
+
39
+ # Harmonic Analysis package
40
+
41
+ * [Documentation](https://harm-analysis.readthedocs.io/en/stable/)
42
+ * [PyPI](https://pypi.org/project/harm-analysis/)
43
+ * [Sources](https://github.com/ericsmacedo/harm-analysis)
44
+ * [Issues](https://github.com/ericsmacedo/harm-analysis/issues)
45
+
46
+ ## Introduction
47
+
48
+ The harmonic analysis package uses FFT to estimate parameters of an input signal.
49
+ The package provides two main functions:
50
+
51
+ - `harm_analysis`: for simulations with an injected tone, returning SNR, THDN, Noise, etc.
52
+ - `spec_analysis`: for cases without an injected tone, that auto-detects DC, tones, and noise from the spectrum.
53
+
54
+ See [usage](./docs/usage.md) for examples.
55
+
56
+
57
+ ## Installation
58
+
59
+ Installing it is pretty easy:
60
+
61
+ ```bash
62
+ pip install harm-analysis
63
+ ```
@@ -0,0 +1,40 @@
1
+
2
+ [![PyPI Version](https://badge.fury.io/py/harm-analysis.svg)](https://badge.fury.io/py/harm-analysis)
3
+ [![Python Build](https://github.com/ericsmacedo/harm-analysis/actions/workflows/main.yml/badge.svg)](https://github.com/ericsmacedo/harm-analysis/actions/workflows/main.yml)
4
+ [![Documentation](https://readthedocs.org/projects/harm-analysis/badge/?version=stable)](https://harm-analysis.readthedocs.io/en/stable/)
5
+ [![Coverage Status](https://coveralls.io/repos/github/ericsmacedo/harm-analysis/badge.svg?branch=main)](https://coveralls.io/github/ericsmacedo/harm-analysis?branch=main)
6
+ [![python-versions](https://img.shields.io/pypi/pyversions/harm-analysis.svg)](https://pypi.python.org/pypi/harm-analysis)
7
+ [![semantic-versioning](https://img.shields.io/badge/semver-2.0.0-green)](https://semver.org/)
8
+
9
+ [![Downloads](https://img.shields.io/pypi/dm/harm-analysis.svg?label=pypi%20downloads)](https://pypi.python.org/pypi/harm-analysis)
10
+ [![Contributors](https://img.shields.io/github/contributors/ericsmacedo/harm-analysis.svg)](https://github.com/ericsmacedo/harm-analysis/graphs/contributors/)
11
+ [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
12
+ [![Issues](https://img.shields.io/github/issues/ericsmacedo/harm-analysis)](https://github.com/ericsmacedo/harm-analysis/issues)
13
+ [![PRs open](https://img.shields.io/github/issues-pr/ericsmacedo/harm-analysis.svg)](https://github.com/ericsmacedo/harm-analysis/pulls)
14
+ [![PRs done](https://img.shields.io/github/issues-pr-closed/ericsmacedo/harm-analysis.svg)](https://github.com/ericsmacedo/harm-analysis/pulls?q=is%3Apr+is%3Aclosed)
15
+
16
+ # Harmonic Analysis package
17
+
18
+ * [Documentation](https://harm-analysis.readthedocs.io/en/stable/)
19
+ * [PyPI](https://pypi.org/project/harm-analysis/)
20
+ * [Sources](https://github.com/ericsmacedo/harm-analysis)
21
+ * [Issues](https://github.com/ericsmacedo/harm-analysis/issues)
22
+
23
+ ## Introduction
24
+
25
+ The harmonic analysis package uses FFT to estimate parameters of an input signal.
26
+ The package provides two main functions:
27
+
28
+ - `harm_analysis`: for simulations with an injected tone, returning SNR, THDN, Noise, etc.
29
+ - `spec_analysis`: for cases without an injected tone, that auto-detects DC, tones, and noise from the spectrum.
30
+
31
+ See [usage](./docs/usage.md) for examples.
32
+
33
+
34
+ ## Installation
35
+
36
+ Installing it is pretty easy:
37
+
38
+ ```bash
39
+ pip install harm-analysis
40
+ ```
@@ -0,0 +1,156 @@
1
+ [project]
2
+ name = "harm-analysis"
3
+ dynamic = []
4
+ description = "A Python library to estimate parameters from a signal containing a tone."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Eric Macedo", email = "ericsmacedo@gmail.com" },
8
+ ]
9
+ classifiers = [
10
+ "Programming Language :: Python :: 3",
11
+ "Programming Language :: Python :: 3.10",
12
+ "Programming Language :: Python :: 3.11",
13
+ "Programming Language :: Python :: 3.12",
14
+ "Programming Language :: Python :: 3.13",
15
+ "Operating System :: OS Independent",
16
+ ]
17
+ requires-python = ">=3.10.0,<4.0"
18
+ dependencies = [
19
+ "click>=8.2.1",
20
+ "matplotlib>=3.10.3",
21
+ "numpy>=2.2.6",
22
+ "rich>=14.1.0",
23
+ "scipy>=1.15.3",
24
+ ]
25
+ keywords = [
26
+ "DSP",
27
+ "Signal-Processing",
28
+ "THD",
29
+ "SNR",
30
+ ]
31
+ version = "1.3.0"
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/ericsmacedo/harm-analysis"
35
+ Documentation = "https://harm-analysis.readthedocs.io/en/stable/"
36
+ "Bug Tracker" = "https://github.com/ericsmacedo/harm-analysis/issues"
37
+
38
+ [project.scripts]
39
+ harm-analysis = "harm_analysis.cli:harm_analysis_cmd"
40
+ spec-analysis = "harm_analysis.cli:spec_analysis_cmd"
41
+
42
+ [dependency-groups]
43
+ dev = [
44
+ "contextlib-chdir>=1.0.2",
45
+ "coveralls>=3.3.1",
46
+ "invoke>=2.2.0",
47
+ "mkdocs-click>=0.8.1",
48
+ "mkdocs-include-markdown-plugin>=6.0.5",
49
+ "mkdocs-literate-nav>=0.6.1",
50
+ "mkdocs-material>=9.5.18",
51
+ "mkdocstrings-python>=1.9.2",
52
+ "mypy>=1.9.0",
53
+ "pre-commit>=4.1.0",
54
+ "pytest-cov>=5.0.0",
55
+ "ruff>=0.11.2",
56
+ "test2ref>=0.4.2",
57
+ ]
58
+
59
+ [build-system]
60
+ requires = [
61
+ "pdm-backend",
62
+ ]
63
+ build-backend = "pdm.backend"
64
+
65
+ [tool.pdm.build]
66
+ includes = [
67
+ "src/harm_analysis",
68
+ ]
69
+
70
+ [tool.pdm.version]
71
+ source = "scm"
72
+ fallback_version = "0.0.0"
73
+
74
+ [tool.ruff]
75
+ line-length = 120
76
+ fix = true
77
+ target-version = "py310"
78
+
79
+ [tool.ruff.lint]
80
+ select = [
81
+ "I",
82
+ "F",
83
+ "E",
84
+ "W",
85
+ "D",
86
+ "N",
87
+ "YTT",
88
+ "B",
89
+ "Q",
90
+ "T10",
91
+ "INT",
92
+ "PL",
93
+ "PIE",
94
+ "PYI",
95
+ "TID",
96
+ "ISC",
97
+ "TC",
98
+ "C",
99
+ "C4",
100
+ "PGH",
101
+ "RUF",
102
+ "S102",
103
+ "NPY002",
104
+ "PERF",
105
+ "FLY",
106
+ "G",
107
+ "UP",
108
+ "ARG",
109
+ "PTH",
110
+ "RET",
111
+ "RSE",
112
+ ]
113
+ ignore = [
114
+ "RUF012",
115
+ "G004",
116
+ "D107",
117
+ "D105",
118
+ ]
119
+
120
+ [tool.ruff.lint.per-file-ignores]
121
+ "tests/*" = [
122
+ "PLR2004",
123
+ "ARG001",
124
+ "S101",
125
+ "PTH123",
126
+ ]
127
+
128
+ [tool.ruff.lint.pydocstyle]
129
+ convention = "google"
130
+
131
+ [tool.pytest.ini_options]
132
+ addopts = " --cov src/harm_analysis\n --cov-report term\n --cov-report html\n --doctest-glob=docs/*\n --doctest-modules\n --ignore-glob=tests/testdata/*\n --log-level=INFO\n --junitxml=report.xml\n"
133
+ filterwarnings = [
134
+ "error",
135
+ ]
136
+ testpaths = [
137
+ "tests",
138
+ ]
139
+
140
+ [tool.coverage.run]
141
+ omit = []
142
+
143
+ [tool.coverage.report]
144
+ exclude_lines = [
145
+ "return NotImplemented",
146
+ "raise NotImplementedError()",
147
+ "pragma: no cover",
148
+ "assert False",
149
+ ]
150
+
151
+ [tool.mypy]
152
+ disable_error_code = "misc"
153
+ ignore_missing_imports = true
154
+ overrides = [
155
+ { module = "tests.*", allow_untyped_defs = true },
156
+ ]
@@ -0,0 +1,29 @@
1
+ # MIT License
2
+ #
3
+ # Copyright (c) 2025 ericsmacedo
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+ """Harmonic Analysis."""
23
+
24
+ from ._harm_analysis import harm_analysis, spec_analysis
25
+
26
+ __all__ = [
27
+ "harm_analysis",
28
+ "spec_analysis",
29
+ ]