ansys / pyacp

Python Client for Ansys Composite PrepPost
https://acp.docs.pyansys.com
MIT License
5 stars 1 forks source link

Make PyVista optional, fix optional deps definition #685

Closed greschd closed 5 days ago

greschd commented 6 days ago

Make the pyvista dependency optional, adding the plotting extra dependency group to install it.

Add a requires_pyvista decorator, which is added to functions which import PyVista internally. The user is advised to run pip install ansys-acp-core[plotting] to install PyVista if it is missing.

Mark tests which require PyVista with pytest.mark.plotting, and add a separate set of CI tests which:

Remove the duplication of dependencies between the extras and the dev dependency, since that didn't work properly. Instead add --all-extras or --extras <extra_name> to poetry install where needed.

Move some internal utilities from the top-level ansys.acp.core to the ansys.acp.core._utils module.

codecov[bot] commented 6 days ago

Codecov Report

Attention: Patch coverage is 90.90909% with 4 lines in your changes missing coverage. Please review.

Project coverage is 94.51%. Comparing base (fa58a45) to head (e977049). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ansys/acp/core/_tree_objects/cad_geometry.py 66.66% 2 Missing :warning:
src/ansys/acp/core/_utils/pyvista_import_check.py 85.71% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #685 +/- ## ========================================== - Coverage 94.54% 94.51% -0.04% ========================================== Files 106 108 +2 Lines 5720 5739 +19 ========================================== + Hits 5408 5424 +16 - Misses 312 315 +3 ``` | [Flag](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | Coverage Δ | | |---|---|---| | [minimum-deps](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `93.24% <77.27%> (?)` | | | [python-3.10](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `94.30% <90.90%> (-0.04%)` | :arrow_down: | | [python-3.11](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `94.23% <90.90%> (-0.04%)` | :arrow_down: | | [python-3.12](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `94.44% <90.90%> (-0.04%)` | :arrow_down: | | [server-2024R2](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `90.95% <90.90%> (-0.03%)` | :arrow_down: | | [server-2025R1](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `94.23% <90.90%> (-0.04%)` | :arrow_down: | | [server-2025R2](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `94.23% <90.90%> (-0.04%)` | :arrow_down: | | [server-latest](https://app.codecov.io/gh/ansys/pyacp/pull/685/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys) | `94.30% <90.90%> (-0.04%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansys#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: