-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Metadata-Version: 2.1 | ||
Name: HSTransform | ||
Version: 0.1 | ||
Summary: A Package to Compute S-transform with Hyperbolic Window | ||
Author: Linh V Nguyen | ||
Author-email: [email protected] | ||
License: MIT | ||
Classifier: Development Status :: 4 - Beta | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: Programming Language :: Python :: 3.10 | ||
Requires-Python: >=3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
README.md | ||
setup.py | ||
HSTransform.egg-info/PKG-INFO | ||
HSTransform.egg-info/SOURCES.txt | ||
HSTransform.egg-info/dependency_links.txt | ||
HSTransform.egg-info/requires.txt | ||
HSTransform.egg-info/top_level.txt | ||
tests/__init__.py | ||
tests/test_hstransform.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
numpy | ||
scipy | ||
pandas | ||
matplotlib | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,3 +68,4 @@ or contact email: [email protected] | |
## 7. Citation | ||
|
||
If you use HS Transform in your research, please cite it as follows: | ||
Linh V Nguyen (2024). HS Transform (Version 0.1) [Computer software]. GitHub: github.com/nvlinhvn/hstransform |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" | ||
Unit Test for HS functions | ||
- Test Gaussian Windowed | ||
- Test HS-transform output | ||
""" | ||
import numpy as np | ||
import pytest | ||
from HSTransform.hstransform import HSTransform | ||
|
||
def test_hyperbolic_gaussian(): | ||
""" | ||
Tests aims to validate the output | ||
of Gaussian Window of a time array | ||
""" | ||
# Create a sinusoidal signal | ||
t = np.linspace(0, 1, 100) | ||
|
||
# Compute the S-transform | ||
st = HSTransform() | ||
|
||
# Test the _compute_hyperbolic_gaussian method | ||
result = st._compute_hyperbolic_gaussian(1000, 50, t) | ||
assert isinstance(result, np.float64) | ||
|
||
def test_fit_transform(): | ||
""" | ||
Tests aims to validate the S-transform output | ||
- shape | ||
- type | ||
- check any null | ||
""" | ||
# Create a sinusoidal signal | ||
t = np.linspace(0, 2, 100) | ||
signal = np.sin(2 * np.pi * 50 * t) | ||
|
||
# Compute the S-transform | ||
st = HSTransform() | ||
s_transformed = st.fit_transform(t, signal) | ||
|
||
# Add some assertions here to test the S-transform output | ||
# Dimension | ||
assert s_transformed.shape == (min(900, len(signal) // 2)+1, len(signal)) | ||
# Type of output | ||
assert isinstance(s_transformed, np.ndarray) | ||
assert np.issubdtype(s_transformed.dtype, np.complexfloating) | ||
# any null | ||
assert not np.isnan(s_transformed).any() | ||
|
||
if __name__ == "__main__": | ||
pytest.main() |
Binary file not shown.
Binary file not shown.