Giter VIP home page Giter VIP logo

pytf3d's People

Contributors

pre-commit-ci[bot] avatar xaver-k avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pytf3d's Issues

set up CI tests

  • run python tests in CI
  • cover all python versions
  • extract coverage
  • add coverage badge to readme
  • upload test overview (if possible) to show in PRs

fix flaky test

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.