Fixed NaNs in visualization of surface fields and adopted PyVista#190
Merged
Conversation
…ield viz - Add palace-toolkit as an optional dependency in pyproject.toml - Create gsim.palace.runtime with resolve_palace_binary() that delegates to palacetoolkit when installed, with tiered PALACE_BIN/PATH fallback - Wire resolver into PalaceSim.run_local (use_apptainer=False branch) with automatic LD_LIBRARY_PATH injection for bundled binaries - Create gsim.palace.fields with NaN-free plot_boundary_field, plot_volume_slice, plot_volume_contours, load_boundary_field_data, build_selector_context - Refactor gsim.viz: remove dead-code duplicates, clean up - Update nbs/palace_cpw_fields.ipynb to use new NaN-free API throughout - Add tests/palace/test_fields.py and tests/palace/test_runtime.py - Update CHANGELOG.md with v0.0.17 entry
mdmaas
requested review from
cdaunt,
flaport,
joamatab,
nikosavola and
vvahidd
as code owners
July 8, 2026 21:13
- F401: Add missing field-viz symbols to __all__ - cp1252: Replace Unicode arrows with ASCII in fields.py - E501: Wrap long lines in fields.py - RUF002: Replace en-dashes with hyphens in docstrings - RUF034: Simplify useless if-else in base.py - S603/PLW1510: Add check=False to subprocess.run in runtime.py - interrogate: Add docstrings for 100% coverage - jupytext: Sync paired notebook files
- F821: Remove dead else branch referencing undefined exe_candidate in base.py - F401: Add missing field-viz symbols to __all__ in __init__.py - ARG001: Prefix unused fake_load_fields args with underscore - PT019: Convert fixture params to @pytest.mark.usefixtures decorators - S603: Suppress subprocess.run false positive in runtime.py - RUF002: Replace en-dashes with hyphens in fields.py docstrings - RUF034: Simplify useless if-else in base.py - E501: Wrap long lines in fields.py - cp1252: Replace Unicode arrows with ASCII in fields.py - ty: Fix RunResult and MonkeyPatch.delitem type errors in tests - interrogate: Add docstrings for 100% coverage - jupytext: Sync paired notebook files
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
+ Coverage 60.73% 63.27% +2.54%
==========================================
Files 65 67 +2
Lines 9665 9757 +92
Branches 1946 1970 +24
==========================================
+ Hits 5870 6174 +304
+ Misses 3131 2900 -231
- Partials 664 683 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Ok, tests seems to be passing now. @vvahidd -- in the end I kept only |
vvahidd
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes visualization of surface fields, that were previously attempting to interpolate to a regular grid -- which resulted in NaNs (see Surface Currents plot at https://gdsfactory.github.io/gsim/nbs/palace_cpw_fields/).
Other plot types are also improved by replacing Matplotlib with PyVista and relying on native interpolation routines.