rename src to pylib and in data.seq float rounding uses start as well
This commit is contained in:
@@ -12,8 +12,8 @@ import unittest
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
from data import read, unique_ending, get_id
|
||||
sys.path.insert(0, os.path.abspath('../pylib'))
|
||||
from data import read, unique_ending, get_id, seq
|
||||
|
||||
|
||||
class TestData(unittest.TestCase):
|
||||
@@ -51,6 +51,23 @@ class TestData(unittest.TestCase):
|
||||
'837c5378-9e6e-4bd0-b6a7-460d02fb62a3'
|
||||
)
|
||||
|
||||
def test_seq(self):
|
||||
"""test seq function"""
|
||||
self.assertEqual(seq(0), [])
|
||||
self.assertEqual(seq(1), [0])
|
||||
self.assertEqual(seq(2), [0, 1])
|
||||
self.assertEqual(seq(0, 3), [0, 1, 2])
|
||||
self.assertEqual(seq(3, 3), [])
|
||||
self.assertEqual(seq(3, 4), [3])
|
||||
self.assertEqual(seq(3, 5), [3, 4])
|
||||
self.assertEqual(seq(3, 5, 1), [3, 4])
|
||||
self.assertEqual(seq(3, 5, 0.5), [3, 3.5, 4, 4.5])
|
||||
self.assertEqual(seq(3, 5, 0.2), [3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8])
|
||||
self.assertEqual(seq(4, 0, -0.4), [4, 3.6, 3.2, 2.8, 2.4, 2, 1.6, 1.2, 0.8, 0.4])
|
||||
self.assertEqual(seq(4, 0, -0.41), [4, 3.59, 3.18, 2.77, 2.36, 1.95, 1.54, 1.13, 0.72, 0.31])
|
||||
self.assertEqual(seq(3.03, 5.07), [3.03, 4.03, 5.03])
|
||||
self.assertEqual(seq(3, 5.07), [3, 4, 5])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -13,7 +13,7 @@ import unittest
|
||||
import os
|
||||
import sys
|
||||
from pylab import array, argmax, subplot, plot, title, xlim, show, gradient, linspace
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
sys.path.insert(0, os.path.abspath('../pylib'))
|
||||
from data import data_read
|
||||
from numerical.fit import gauss_fit
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import os
|
||||
import sys
|
||||
import math
|
||||
from numpy import allclose
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
sys.path.insert(0, os.path.abspath('../pylib'))
|
||||
from data import fold_list
|
||||
from geometry import translate_xy, rotate_xy, interpolate_hermite, lines, cubics
|
||||
from geometry_plot import plot_lines, plot_cubic_lines
|
||||
|
||||
@@ -19,7 +19,7 @@ from matplotlib.pyplot import figure, subplots, plot, show
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
sys.path.insert(0, os.path.abspath('../pylib'))
|
||||
from numerical.ode import (e1, e2, e4, i1, newmark_newtonraphson,
|
||||
newmark_newtonraphson_rdk)
|
||||
from numerical.ode_model import disk, disk_nm, disk_nmmdk
|
||||
|
||||
@@ -14,7 +14,7 @@ from time import mktime
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
sys.path.insert(0, os.path.abspath('../pylib'))
|
||||
from time_of_day import (in_seconds, seconds, seconds_norm,
|
||||
minutes, minutes_norm, hours, hours_norm, days, days_norm,
|
||||
transform)
|
||||
|
||||
Reference in New Issue
Block a user