import math
from kneed import data_generator, knee_locator
import pytest


def test_figure2():
    """From the kneedle manuscript"""
    DG = data_generator()
    x, y = DG.figure2()
    kl = knee_locator(x, y, S=1.0, invert=False)
    assert math.isclose(kl.knee, 0.22, rel_tol=1e-02)


def test_NoisyGaussian():
    """From the Kneedle manuscript"""
    DG = data_generator()
    x, y = DG.NoisyGaussian(mu=50, sigma=10, N=1000)
    kl = knee_locator(x, y, S=1.0, invert=False)
    assert math.isclose(kl.knee, 60.5, rel_tol=0.05)

@@ -19,16 +19,31 @@
 need
+.data_generator
  import 
 data
@@ -38,30 +38,29 @@
  import 
-data_g
+DataG
 enerator
 , knee_l
@@ -55,16 +55,45 @@
 ator
-, knee_l
+%0Afrom kneed.knee_locator import KneeL
 ocat
@@ -170,38 +170,37 @@
 ipt%22%22%22%0A    DG = 
-data_g
+DataG
 enerator()%0A    x
@@ -219,38 +219,37 @@
 ure2()%0A    kl = 
-knee_l
+KneeL
 ocator(x, y, S=1
@@ -395,22 +395,21 @@
    DG = 
-data_g
+DataG
 enerator
@@ -473,22 +473,21 @@
    kl = 
-knee_l
+KneeL
 ocator(x

update testing