Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored pelvis axis unit test only accurate to 5 decimal places #139

Open
MattGonz opened this issue Aug 27, 2021 · 0 comments
Open

Refactored pelvis axis unit test only accurate to 5 decimal places #139

MattGonz opened this issue Aug 27, 2021 · 0 comments
Labels
documentation an issue with documentation or docstrings testing unit tests or doctests

Comments

@MattGonz
Copy link
Contributor

MattGonz commented Aug 27, 2021

The original test for pyCGM_Single/pyCGM.py/pelvisJointCenter expects the z component of the pelvis origin to equal 1032.89349365.

[np.array([251.60830688, 391.74131775, 1032.89349365]),

The new test for pelvisJointCenter (now pyCGM_Single/pyCGM.py/calc_axis_pelvis) expects the same value but in scientific notation: 1.03289349e+03

https://github.com/MattGonz/pyCGM/blob/15a9030e9c6e0835ab12f0e2bde0315488ce9b55/pyCGM_Single/tests/test_pycgm_axis.py#L973

It seems that when 1.03289349e+03 is evaluated and asserted almost equal to 1032.89349365 using np.testing.assert_almost_equal to six decimal places, the test fails.

image

Manual assertion: np.testing.assert_almost_equal(1032.89349365, 1032.89349, 6)

AssertionError:
Arrays are not almost equal to 6 decimals
 ACTUAL: 1032.89349365
 DESIRED: 1032.89349
@cadop cadop added documentation an issue with documentation or docstrings testing unit tests or doctests labels Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation an issue with documentation or docstrings testing unit tests or doctests
Projects
None yet
Development

No branches or pull requests

2 participants