Skip to content

Commit 4584789

Browse files
committed
whenxuan: remove the demo test to data
1 parent 04ec9f2 commit 4584789

33 files changed

Lines changed: 222 additions & 481 deletions

‎examples/example.npy‎

-8.13 KB
Binary file not shown.

‎examples/plot_imfs.jpg‎

-1.02 MB
Binary file not shown.

‎examples/texture.mat‎

-352 KB
Binary file not shown.

‎examples/texture.txt‎

Lines changed: 0 additions & 256 deletions
This file was deleted.

‎pyproject.toml‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,4 @@ where = ["."]
6767
include = ["pysdkit*"]
6868

6969
[tool.setuptools.package-data]
70-
"*" = ["*.txt", "*.npy"]
71-
"pysdkit.data" = ["*.txt", "*.npy"]
72-
"pysdkit._tid" = ["data/*.npy"]
73-
"pysdkit._tid.data" = ["*.npy"]
74-
"pysdkit._imd" = ["data/*.npy"]
75-
"pysdkit._imd.data" = ["*.npy"]
76-
"pysdkit._vmd" = ["data/*.npy"]
77-
"pysdkit._vmd.data" = ["*.npy"]
78-
"pysdkit._tfa" = ["data/*.npy"]
79-
"pysdkit._tfa.data" = ["*.npy"]
70+
"pysdkit.data" = ["*.npy", "*.txt"]

‎pysdkit/_emd/esmd.py‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import numpy as np
1414
from scipy.interpolate import CubicSpline, interp1d
1515

16+
from pysdkit.data._loaders import load_wind_demo
17+
1618

1719
def find_extrema(x: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
1820
"""
@@ -438,19 +440,6 @@ def make_esmd_example3(
438440
}
439441

440442

441-
def load_wind_demo(path: str) -> Dict[str, np.ndarray]:
442-
"""
443-
Load a wind-demo CSV/TXT file (column 0 = wind series, ``dt=0.05`` s).
444-
445-
:param path: path to a comma-separated file whose first column is the series
446-
"""
447-
data = np.loadtxt(path, delimiter=",")
448-
y = data[:, 0]
449-
dt = 0.05
450-
t = np.arange(y.size, dtype=float) * dt
451-
return {"t": t, "signal": y, "dt": dt}
452-
453-
454443
class ESMD(object):
455444
"""
456445
Extreme-Point Symmetric Mode Decomposition (ESMD).

‎pysdkit/_imd/__init__.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
imd,
1111
fft_bandpass,
1212
segment_sparsity,
13-
load_imd_input_sig,
14-
load_imd_gearbox_snippet,
1513
)
14+
from pysdkit.data._loaders import load_imd_gearbox_snippet, load_imd_input_sig
1615

1716
__all__ = [
1817
"APMD",

‎pysdkit/_imd/imd.py‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010
from __future__ import annotations
1111

12-
from pathlib import Path
1312
from typing import Callable, Dict, List, Optional, Tuple, Union
1413

1514
import numpy as np
1615
from scipy.signal import hilbert
1716

17+
from pysdkit.data._loaders import load_imd_gearbox_snippet, load_imd_input_sig
18+
1819

1920
def fft_bandpass(
2021
signal: np.ndarray,
@@ -200,27 +201,6 @@ def band_split(
200201
return np.asarray(parts, dtype=float)
201202

202203

203-
def load_imd_input_sig() -> Dict[str, np.ndarray]:
204-
"""Load the packaged MATLAB ``InputSig`` demo (Fs = 12800 Hz, 2 s)."""
205-
path = Path(__file__).resolve().parent / "data" / "input_sig.npy"
206-
signal = np.load(path).astype(np.float64).ravel()
207-
fs = 12800.0
208-
t = np.arange(signal.size, dtype=float) / fs
209-
return {"signal": signal, "fs": fs, "t": t}
210-
211-
212-
def load_imd_gearbox_snippet() -> Dict[str, np.ndarray]:
213-
"""
214-
Load a short packaged snippet of the MCC5-THU gearbox CSV
215-
(``gearbox_vibration_x``, first 4096 samples, Fs = 12800 Hz).
216-
"""
217-
path = Path(__file__).resolve().parent / "data" / "gearbox_fault_snippet.npy"
218-
signal = np.load(path).astype(np.float64).ravel()
219-
fs = 12800.0
220-
t = np.arange(signal.size, dtype=float) / fs
221-
return {"signal": signal, "fs": fs, "t": t}
222-
223-
224204
class IMD(object):
225205
"""
226206
Impulsive Mode Decomposition (IMD).

‎pysdkit/_tfa/__init__.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
smooth_if,
1919
moving_average_if,
2020
omega_bins_to_hz,
21+
)
22+
from pysdkit.data._loaders import (
2123
load_dual_signal_noise,
22-
load_single_nsignal,
2324
load_map2,
25+
load_single_nsignal,
2426
)
2527

2628
__all__ = [

‎pysdkit/_tfa/data/__init__.py‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)