feat: add Plotly 3D WebGL viewer, close CylindricalLens sides, resolve Eigen3 via eigency, and add CI - #195
Open
hstarmans wants to merge 1 commit into
Open
feat: add Plotly 3D WebGL viewer, close CylindricalLens sides, resolve Eigen3 via eigency, and add CI#195hstarmans wants to merge 1 commit into
hstarmans wants to merge 1 commit into
Conversation
…e Eigen3, and add CI - Add `pyoptools.gui.plotly_viewer` providing interactive 3D WebGL optical visualization compatible with Marimo, JupyterLab 4, and VS Code. - Update `pyoptools.gui.ipywidgets.Plot3D` with `backend="auto"`, defaulting to Plotly without crashing if pythreejs is missing. - Complete `CylindricalLens` by adding lateral closing surfaces S3..S6 for watertight optical geometry and ray propagation. - Declare `eigency` in `[build-system] requires` in `pyproject.toml` and detect via `eigency.get_includes()` in `setup.py`, allowing native build via uv/pip without requiring root or system package managers for Eigen3 headers. - Add GitHub Actions CI workflow in `.github/workflows/test.yaml` running the test suite across Linux, macOS, and Windows on Python 3.10, 3.11, and 3.12. - Add comprehensive unit tests in `tests/gui/test_plotly_viewer.py` and `tests/raytrace/component/test_component.py`. - Make `tests/test_coding_standards.py` robust against missing linter tools.
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.
Hey @ramezquitao,
Great to see you still maintaining and updating the repository!
I've been working on upgrades to my open-source laser scanner project and needed pyoptools once again. While integrating it, I addressed a few practical pain points, which are consolidated here in a two commits.
The second contains much more, there was a small issue in shading with this commit which I addressed later.
All in all, I just want it to work and the code be decent. I looked at what the agent changed and it seems good..
The following is all created by Gemini 3.8.
Simplified the Eigen3 dependency so it builds out of the box with modern package managers (uv / pip) without requiring manual header installations or root access.
Closed the lateral sides of CylindricalLens so it behaves as a true watertight optical solid.
Added a Plotly-based 3D WebGL viewer compatible with modern reactive notebook environments like Marimo, JupyterLab 4, and VS Code (gracefully falling back when pythreejs is missing).
Added a cross-platform GitHub Actions CI matrix (ubuntu, macos, windows across Python 3.10–3.12) to ensure ongoing stability (all 9 checks currently pass green).
(Much of the scaffolding and testing was pair-programmed with Gemini.)
I have a few other smaller improvements and fixes that I'll submit in separate, focused pull requests once this is reviewed. Hope this helps the project!
Summary of Changes
Native Eigen3 Dependency Resolution via
eigency:"eigency"in[build-system] requiresinpyproject.tomland detect headers viaeigency.get_includes()insetup.py.uvorpipwithout needing root access, system packages, or hardcoded include paths.Watertight
CylindricalLens:S3(top),S4(bottom),S5(left), andS6(right) with exact analytical sag matching.TODO: Falta cerrar la lente por los ladosso ray propagation and 3D visualization treat cylindrical lenses as closed physical bodies.Universal 3D WebGL Viewer (
pyoptools.gui.plotly_viewer):pyoptools.gui.plotly_viewer.plot_system_plotly), compatible with modern browser notebooks (Marimo, JupyterLab 4, VS Code, and standalone HTML).pyoptools.gui.ipywidgets.Plot3Dwithbackend="auto", defaulting gracefully to Plotly without breaking ifpythreejsis not installed.Cross-Platform GitHub Actions CI (
.github/workflows/test.yaml):ubuntu-latest), macOS (macos-latest), and Windows (windows-latest) on Python 3.10, 3.11, and 3.12 usingastral-sh/setup-uv@v5.tests/raytrace/library/test_library.pyand specifiedencoding="utf-8"on data loading.