xaver-k / pytf3d Goto Github PK
View Code? Open in Web Editor NEWa lightweight library for handling rigid body transformations in 3D
License: Mozilla Public License 2.0
a lightweight library for handling rigid body transformations in 3D
License: Mozilla Public License 2.0
Add a document / webpage explaining each representation of rotations
test_equality_returns_false_for_inequality()
fails for some examples produced by hypotesis if the quaternions-vectors are very close.
============================= test session starts ==============================
platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/runner/work/pytf3d/pytf3d, configfile: pyproject.toml, testpaths: test
plugins: hypothesis-6.14.5, cov-2.12.1
collected 46 items
test/test_dummy.py . [ 2%]
test/test_rotation.py .......F..................................... [100%]
=================================== FAILURES ===================================
__________________ test_equality_returns_false_for_inequality __________________
@given(q1=UnitQuaternionStrategy, q2=UnitQuaternionStrategy)
> def test_equality_returns_false_for_inequality(q1: QUATERNION_T, q2: QUATERNION_T):
test/test_rotation.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
q1 = array([0., 0., 0., 1.])
q2 = array([0.0000000e+00, 0.0000000e+00, 1.0000889e-05, 1.0000000e+00])
@given(q1=UnitQuaternionStrategy, q2=UnitQuaternionStrategy)
def test_equality_returns_false_for_inequality(q1: QUATERNION_T, q2: QUATERNION_T):
assume(not np.allclose(q1, q2, atol=1e-5))
assume(not np.allclose(q1, -q2, atol=1e-5))
> assert not Rotation(q1).almost_equal(Rotation(q2))
E assert not True
E + where True = <bound method Rotation.almost_equal of Rotation(0.00000000 | 0.00000000, 0.00000000, 1.00000000)>(Rotation(0.00000000 | 0.00000000, 0.00001000, 1.00000000))
E + where <bound method Rotation.almost_equal of Rotation(0.00000000 | 0.00000000, 0.00000000, 1.00000000)> = Rotation(0.00000000 | 0.00000000, 0.00000000, 1.00000000).almost_equal
E + where Rotation(0.00000000 | 0.00000000, 0.00000000, 1.00000000) = Rotation(array([0., 0., 0., 1.]))
E + and Rotation(0.00000000 | 0.00000000, 0.00001000, 1.00000000) = Rotation(array([0.0000000e+00, 0.0000000e+00, 1.0000889e-05, 1.0000000e+00]))
test/test_rotation.py:72: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_equality_returns_false_for_inequality(
q1=array([0., 0., 0., 1.]),
q2=array([0.0000000e+00, 0.0000000e+00, 1.0000889e-05, 1.0000000e+00]),
)
You can reproduce this example by temporarily adding @reproduce_failure('6.14.5', b'AXicY2DADaSuf5qNXUZwBkweAGDaBaY=') as a decorator on your test case
=========================== short test summary info ============================
FAILED test/test_rotation.py::test_equality_returns_false_for_inequality - as...
======================== 1 failed, 45 passed in 10.20s =========================
Error: Process completed with exit code 1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.