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

[pyOpenSci] Tests #931

Closed
nicoguaro opened this issue Feb 6, 2025 · 4 comments
Closed

[pyOpenSci] Tests #931

nicoguaro opened this issue Feb 6, 2025 · 4 comments

Comments

@nicoguaro
Copy link

When I run the tests in my computer with a newly installed Felupe, I get the following

tests/test_constitution.py::test_optimize
  C:\Users\nguarinz\Workspace\felupe\.tox\py3\Lib\site-packages\tensortrax\math\_math_tensor.py:228: RuntimeWarning: invalid value encountered in log
    x = np.log(f(A))

tests/test_constitution.py::test_plot_negative_stretches
  C:\Users\nguarinz\Workspace\felupe\.tox\py3\Lib\site-packages\felupe\constitution\_view.py:77: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`). Consider using `matplotlib.pyplot.close()`.
    fig, ax = plt.subplots()

tests/test_job.py::test_job_xdmf
  C:\Users\nguarinz\Workspace\felupe\tests\test_job.py:20: DeprecationWarning: felupe.SolidBodyGravity is deprecated, use felupe.SolidBodyForce instead.
    gravity = SolidBodyForce(field, [0, 0, 0], 0)

tests/test_job.py: 11 warnings
  C:\Users\nguarinz\Workspace\felupe\.tox\py3\Lib\site-packages\felupe\mechanics\_solidbody_gravity.py:98: DeprecationWarning: felupe.SolidBodyGravity is deprecated, use felupe.SolidBodyForce instead.
    self.__init__(self.field, gravity, self.results.density)

tests/test_region.py::test_region
  C:\Users\nguarinz\Workspace\felupe\.tox\py3\Lib\site-packages\felupe\math\_tensor.py:417: RuntimeWarning: divide by zero encountered in divide
    return np.divide(detAinvA, detA, out=detAinvA)

tests/test_region.py::test_region
  C:\Users\nguarinz\Workspace\felupe\.tox\py3\Lib\site-packages\felupe\math\_tensor.py:417: RuntimeWarning: invalid value encountered in divide
    return np.divide(detAinvA, detA, out=detAinvA)

tests/test_region.py::test_region
  C:\Users\nguarinz\Workspace\felupe\.tox\py3\Lib\site-packages\felupe\region\_region.py:381: UserWarning: Negative volumes for cells
   [0]
  Try ``mesh.flip(np.any(region.dV < 0, axis=0))`` and re-create the region.
    warnings.warn(message_negative_volumes)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================================== 155 passed, 17 warnings in 51.14s =======================================================================================
  core: OK (95.30=setup[82.97]+cmd[12.33] seconds)
  py3: OK (120.30=setup[67.59]+cmd[52.70] seconds)
  congratulations :) (215.72 seconds)

There are some warnings regarding deprecation and negative jacobians, is this because of some updates in the test suite?

@adtzlr
Copy link
Owner

adtzlr commented Feb 6, 2025

Hi @nicoguaro!

Thanks!

P.S.: The invalid value (log) is due to a not well-defined (but original!) hyperelastic model using automatic differentiation. The warning is captured in #933.

@adtzlr
Copy link
Owner

adtzlr commented Feb 8, 2025

@nicoguaro, how would you like to handle the pyOpenSci-related Issues? Should I keep them open? Should I close them when I think they are finished? Would you like to close them once the fixes / enhancements are okay for you?

@nicoguaro
Copy link
Author

I think that you should handle them and let me know.

@adtzlr
Copy link
Owner

adtzlr commented Feb 8, 2025

Okay, @nicoguaro, then let's close this issue, all warnings are captured in in the tests now. One bug in the boundary-region for quadratic quads was detected in the warnings and is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants