Conversation
|
Testing if the image cache gets changed. |
There was a problem hiding this comment.
Pull request overview
This PR targets faster (and less intrusive) test runs and plotting initialization by reducing per-test cleanup work and avoiding repeated glyph construction, and it also relaxes the optional dependency constraint for the visualization interface.
Changes:
- In test teardown, only scan/stop “extra” MAPDL instances when
DEBUG_TESTINGis enabled. - Change plotting defaults so boundary-condition glyphs are configured once (cached) instead of being recreated on every access.
- Relax the
ansys-tools-visualization-interfaceupper bound in optional dependencies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/conftest.py |
Gates expensive “extra MAPDL instance” cleanup behind DEBUG_TESTING. |
src/ansys/mapdl/core/plotting/plotting_defaults.py |
Switches BC glyph defaults to one-time configuration/caching. |
pyproject.toml |
Expands allowed versions of ansys-tools-visualization-interface for optional installs. |
Comments suppressed due to low confidence (1)
src/ansys/mapdl/core/plotting/plotting_defaults.py:78
- Switching back to one-time configuration means
DefaultSymbol.__call__returns the same mutable dict/PolyData instances on every access. Downstream plotting (notably legend creation and any in-place PyVista transforms) can mutate these meshes/dicts, which matches the glyph offset/flakiness described in #3568 and can reintroduce it. Consider returning defensive copies (e.g., copy the dict and deep-copy theglyphmesh) or storing factories/immutable templates so each call gets a fresh glyph object while still avoiding recomputing parameters unnecessarily.
if not self._configured: # Temporal patch pending on #3568
self._set_configuration()
self._configured = True
return getattr(self, name)
| if not self._configured: # Temporal patch pending on #3568 | ||
| self._set_configuration() |
There was a problem hiding this comment.
| if not self._configured: # Temporal patch pending on #3568 | ||
| self._set_configuration() | ||
| self._configured = True |
There was a problem hiding this comment.
There’s no regression coverage around the behavior that prompted #3568 (glyphs/legend geometry drifting across calls/tests). Since this change alters caching semantics, adding a test that exercises repeated BC plotting/legend creation and asserts glyph geometry stays stable would help prevent reintroducing the flakiness.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4425 +/- ##
==========================================
- Coverage 91.16% 91.06% -0.11%
==========================================
Files 196 196
Lines 16209 16209
==========================================
- Hits 14777 14760 -17
- Misses 1432 1449 +17 🚀 New features to boost your workflow:
|
…g-tests-performance
…m/ansys/pymapdl into tests/improving-tests-performance
Description
Some changes to improve testing:
Issue linked
Close #3568
Checklist
draftif it is not ready to be reviewed yet.feat: adding new MAPDL command)