Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit c04dbbc3 authored by EXT José Ignacio Requeno Jarabo's avatar EXT José Ignacio Requeno Jarabo
Browse files

Bugfixing in OraclePoint

parent 2069ed52
Pipeline #32274 failed with stages
in 2 minutes and 58 seconds
......@@ -99,7 +99,7 @@ class OraclePoint(Oracle):
Example:
>>> xset = {(0,0,0), (1,1,1)}
>>> ora = OraclePoint()
>>> ora.add_point(xset)
>>> ora.add_points(xset)
"""
for point in setpoints:
self.add_point(point)
......@@ -119,7 +119,8 @@ class OraclePoint(Oracle):
Example:
>>> xset = {(0,0,0), (1,1,1)}
>>> ora = OraclePoint()
>>> ora.add_point(xset)
>>> ora.add_points(xset)
>>> ora.get_points(()
"""
return self.oracle.get_points()
......
......@@ -106,7 +106,7 @@ class OraclePointTestCase(unittest.TestCase):
# type: (OraclePointTestCase, float, float, bool) -> None
def f1(x):
return 1 / x if x > 0.0 else 1000
return 1 / x if x > 0.0 else 1000.0
tmpfile = tf.NamedTemporaryFile(delete=False)
nfile = tmpfile.name
......@@ -157,7 +157,7 @@ class OraclePointTestCase(unittest.TestCase):
# Points
def f1(x):
return 1 / x if x > 0.0 else 1000
return 1 / x if x > 0.0 else 1000.0
def f2(x):
return 0.1 + (1 / x) if x > 0.0 else 1000.1
......@@ -226,6 +226,13 @@ class OraclePointTestCase(unittest.TestCase):
print('Oracle 1 Parameters: {0}'.format(param1))
print('Oracle 2 Parameters: {0}'.format(param2))
points1 = sorted(ora1.get_points())
points2 = sorted(ora2.get_points())
print('Oracle 1 Points: {0}'.format(points1))
print('Oracle 2 Points: {0}'.format(points2))
self.assertEqual(points1, points2, 'Different oracles')
self.assertEqual(ora1, ora2, 'Different oracles')
self.assertEqual(hash(ora1), hash(ora2), 'Different oracles')
......
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