Skip to content

Commit

Permalink
Package Pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
nvlinhvn committed May 9, 2024
1 parent 6fafd4d commit a173869
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 0 deletions.
11 changes: 11 additions & 0 deletions HSTransform.egg-info/PKG-INFO
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
9 changes: 9 additions & 0 deletions HSTransform.egg-info/SOURCES.txt
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
1 change: 1 addition & 0 deletions HSTransform.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions HSTransform.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
numpy
scipy
pandas
matplotlib
pytest
1 change: 1 addition & 0 deletions HSTransform.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 added build/lib/tests/__init__.py
Empty file.
50 changes: 50 additions & 0 deletions build/lib/tests/test_hstransform.py
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 added dist/HSTransform-0.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/HSTransform-0.1.tar.gz
Binary file not shown.

0 comments on commit a173869

Please sign in to comment.