Skip to content

Commit

Permalink
Merge pull request #10 from nvlinhvn/linh-dev
Browse files Browse the repository at this point in the history
Publish in Pypi
  • Loading branch information
nvlinhvn authored May 19, 2024
2 parents 8d6697a + 4d168db commit 7c704b0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 175 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ __pycache__/__init__.cpython-39.pyc
.ipynb_checkpoints/__init__-checkpoint.py
tests/.ipynb_checkpoints/test_hstransform-checkpoint.py
.DS_Store
.ipynb_checkpoints/setup-checkpoint.py
38 changes: 0 additions & 38 deletions .ipynb_checkpoints/setup-checkpoint.py

This file was deleted.

22 changes: 20 additions & 2 deletions HSTransform.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: HSTransform
Version: 0.1.6
Version: 0.1.1
Summary: A Package to Compute S-transform with Hyperbolic Window
Home-page: https://github.com/nvlinhvn/HSTransform
Author: Linh V Nguyen
Expand Down Expand Up @@ -41,12 +41,18 @@ HS Transform requires the following Python packages:

## 3. How to Install

You can install HS Transform using pip:
After that, you can install HS Transform using pip:

```
pip install HSTransform
```

You can also install all dependencies and package in 1 statement

```
pip install numpy scipy pandas matplotlib pytest HSTransform
```

## 4. Run tests

After installation, you can test the package using the included test scripts:
Expand All @@ -56,7 +62,18 @@ After installation, you can test the package using the included test scripts:

Here’s an example of how to use HS Transform to analyze a signal with voltage disturbance and power system fault:

It's noted sometimes you need to include the installed HSTransform package location into sys

```python
import sys
import os

# Add the package directory to sys.path
package_path = os.path.abspath('/usr/local/Caskroom/miniconda/base/envs/YOUR_ENVIRONMENT/lib/python3.10/site-packages/')
if package_path not in sys.path:
sys.path.insert(0, package_path)

import numpy as np
from hstransform import HSTransform

# Create input signal (for example: Voltage signal)
Expand All @@ -80,6 +97,7 @@ S_transformed = hs.fit_transform(t, signal)

### 5.1 Power Quality Disturbance

Compare HS-transform vs. Morlet Wavelet Transform:
![Voltage Disturbance](https://raw.githubusercontent.com/nvlinhvn/HSTransform/main/img/power_quality_disturbance.png)

The figure showed HS-transform is able to detect the transient disturbances like notch, spike. Meanwhile, those signals from Morlet Wavelet transform are not obviously recognized.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ package_path = os.path.abspath('/usr/local/Caskroom/miniconda/base/envs/YOUR_ENV
if package_path not in sys.path:
sys.path.insert(0, package_path)

import numpy as np
from hstransform import HSTransform

# Create input signal (for example: Voltage signal)
Expand All @@ -82,6 +83,7 @@ S_transformed = hs.fit_transform(t, signal)

### 5.1 Power Quality Disturbance

Compare HS-transform vs. Morlet Wavelet Transform:
![Voltage Disturbance](https://raw.githubusercontent.com/nvlinhvn/HSTransform/main/img/power_quality_disturbance.png)

The figure showed HS-transform is able to detect the transient disturbances like notch, spike. Meanwhile, those signals from Morlet Wavelet transform are not obviously recognized.
Expand Down
Binary file added dist/HSTransform-0.1.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/HSTransform-0.1.1.tar.gz
Binary file not shown.
Binary file removed dist/HSTransform-0.1.6-py3-none-any.whl
Binary file not shown.
Binary file removed dist/HSTransform-0.1.6.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion hstransform/.ipynb_checkpoints/__init__-checkpoint.py

This file was deleted.

133 changes: 0 additions & 133 deletions hstransform/.ipynb_checkpoints/hstransform-checkpoint.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='HSTransform',
version='0.1.6',
version='0.1.1',
url='https://github.com/nvlinhvn/HSTransform',
packages=find_packages(),
license='MIT',
Expand Down

0 comments on commit 7c704b0

Please sign in to comment.