From 30edc7b92ced58137e02c8a0681082b84200595c Mon Sep 17 00:00:00 2001
From: many <VC6l9uBUTvTlcIjrI7sn>
Date: Wed, 2 Nov 2022 01:22:09 +0100
Subject: [PATCH] add test for integral_scales

---
 tests/timeseries/test_ntrfc_integral_scales    |  0
 tests/timeseries/test_ntrfc_integral_scales.py | 14 ++++++++++++++
 2 files changed, 14 insertions(+)
 delete mode 100644 tests/timeseries/test_ntrfc_integral_scales
 create mode 100644 tests/timeseries/test_ntrfc_integral_scales.py

diff --git a/tests/timeseries/test_ntrfc_integral_scales b/tests/timeseries/test_ntrfc_integral_scales
deleted file mode 100644
index e69de29b..00000000
diff --git a/tests/timeseries/test_ntrfc_integral_scales.py b/tests/timeseries/test_ntrfc_integral_scales.py
new file mode 100644
index 00000000..8a4a2ab8
--- /dev/null
+++ b/tests/timeseries/test_ntrfc_integral_scales.py
@@ -0,0 +1,14 @@
+import numpy as np
+
+from ntrfc.timeseries.integral_scales import integralscales
+
+
+def test_integralscales():
+
+    time = np.linspace(0,100,100000)
+    freq = 1
+    signal = np.sin(time*freq)+1
+
+    ts,ls=integralscales(signal,time)
+    assert np.isclose(ts,1,rtol=4e-3),"time scale not computed accurately"
+    assert np.isclose(ls,1,rtol=4e-3), "length scale not computed accurately"
-- 
GitLab