Commit dc8a275a authored by lars.quentin's avatar lars.quentin 💬
Browse files

🚧 WIP check_flat tests

parent 2b771ef3
Pipeline #247466 failed with stages
in 2 minutes and 44 seconds
......@@ -3,9 +3,21 @@ import numpy as np
from curvepy.utilities import distance_to_line
INTERVAL = (-20,20)
NUMBER_OF_TESTCASES = 30
def generate_noisy_lines(n, interval, noise):
f = lambda : random.randint(*interval)
res = []
for _ in range(n):
a,b = (np.array([f(),f()]),np.array([f(),f()]))
m = [a]
for _ in range(random.randint(10,21)):
# 50% to be negative
if random.random() < 0.5:
noise *= -1
lambda_ = random.random()
m.append((a*lambda_ + b*(1-lambda_))+(random.random() * noise))
m.append(b)
res.append(m)
return res
def main():
for _ in range(NUMBER_OF_TESTCASES):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment