Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Fernbach
curves
Commits
e4d90fe3
Commit
e4d90fe3
authored
Jan 23, 2020
by
Pierre Fernbach
Committed by
Pierre Fernbach
Feb 10, 2020
Browse files
[Tests][Python] add (failling) test case for piecewise.curve_at_index method
parent
7884ae26
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/test/test.py
View file @
e4d90fe3
...
...
@@ -360,6 +360,11 @@ class TestCurves(unittest.TestCase):
pc
.
derivate
(
0.4
,
2
)
pc
.
is_continuous
(
0
)
pc
.
is_continuous
(
1
)
a0
=
pc
.
curve_at_index
(
0
)
self
.
assertTrue
(
array_equal
(
a0
(
0.5
),
pc
(
0.5
)))
self
.
assertTrue
(
a0
==
a
)
a0
=
b
# should not have any effect
self
.
assertTrue
(
array_equal
(
pc
.
curve_at_index
(
0
)(
0.5
),
a
(
0.5
)))
# Test serialization
pc
.
saveAsText
(
"serialization_pc.test"
)
pc_test
=
piecewise
()
...
...
@@ -413,6 +418,12 @@ class TestCurves(unittest.TestCase):
for
i
in
range
(
N
):
self
.
assertTrue
(
isclose
(
polC0
(
time_points
[
i
,
0
]),
points
[:,
i
]).
all
())
c0
=
polC0
.
curve_at_index
(
0
)
self
.
assertEqual
(
c0
.
min
(),
time_points
[
0
])
self
.
assertEqual
(
c0
.
max
(),
time_points
[
1
])
self
.
assertEqual
(
c0
.
dim
(),
3
)
self
.
assertTrue
(
array_equal
(
polC0
(
0.5
),
c0
(
0.5
)))
polC1
=
piecewise
.
FromPointsList
(
points
,
points_derivative
,
time_points
)
self
.
assertEqual
(
polC1
.
min
(),
time_points
[
0
,
0
])
self
.
assertEqual
(
polC1
.
max
(),
time_points
[
-
1
,
0
])
...
...
@@ -500,6 +511,11 @@ class TestCurves(unittest.TestCase):
pc
.
derivate
(
0.4
,
2
)
pc
.
is_continuous
(
0
)
pc
.
is_continuous
(
1
)
a0
=
pc
.
curve_at_index
(
0
)
self
.
assertTrue
(
array_equal
(
a0
(
0.5
),
pc
(
0.5
)))
self
.
assertTrue
(
a0
==
a
)
a0
=
b
# should not have any effect
self
.
assertTrue
(
array_equal
(
pc
.
curve_at_index
(
0
)(
0.5
),
a
(
0.5
)))
# Test serialization
pc
.
saveAsText
(
"serialization_pc.test"
)
pc_test
=
piecewise
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment