Repository navigation
test: cover the front ends of the explorer - #149
Merged
Merged
Conversation
The CI installed neither ipywidgets nor matplotlib, so notebook.py and plots.py could not be imported in the tests and fields.py was barely reached; the test job now installs the notebook extras. - fields: planar slices only, frames equal to Slice.to_global (one mesh, three meshes, cell-centred), a cell-centred slice on a mesh border with two sides, value ranges from the .bnd files and from the frames. - plots: series with one and two units, device activation, slices in all render modes. - notebook: loading a case, the time bar, render and scale modes, switching slices, a case with nothing to show, the directory browser and its errors. The overview of a loaded simulation is now built after its slices are read, so it counts them instead of showing the previous simulation's count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cli: a slice drawn as text, with a curve, out of range and as JSON; saving pictures and animations, and the errors when that is not possible; handing over to the interactive view; running as python -m fdsreader.explorer; the lazy exports of the package. - tui: key names, clipped writing, colour pairs for 8 and 256 colours, the list picker, drawing the screen and the help, and the main loop, on a fake window that plays back keys. save_figure now closes the figure when writing an animation fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tching the backend - save_figure counted a slice panel even without a slice, so saving curves alone gave an empty left panel; it now builds its figures with their own Agg canvas instead of switching matplotlib to Agg for the whole process, which would stop plots in a notebook that calls it. - The notebook explorer draws the curves once when loading a simulation. Tests: the number of panels of saved figures, the backend after saving, a strict xfail for the mesh-border nodes where the explorer and to_global differ, a skip for the curses tests where curses is missing, shared helpers and fixtures for the explorer tests (the touched test files are now formatted with ruff), and one copy of the case for the CLI tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
The test job installed neither
ipywidgetsnormatplotlib, so the notebook front end and the plots of the explorer could not be imported in the tests, and the terminal front ends were only partly tested. The CI now installs thenotebookextras, and new tests cover all front ends of the explorer.notebook.pyplots.pyfields.pytui.pycli.pyTotal coverage locally: 67 % → 80 %.
Tests
Slice.to_global(one mesh, three meshes, cell-centred), a cell-centred slice on a mesh border with two sides, value ranges from the.bndfiles and from the frames. Nodes shared by two meshes, where the explorer keeps the first mesh andto_globalthe upper one, are recorded as a strict xfail.python -m fdsreader.explorer.Fixes found on the way
save_figureswitched matplotlib to Agg for the whole process, which stops plots in a notebook that calls it; it now uses a figure with its own Agg canvas, which is also closed when writing an animation fails.The touched explorer test files are formatted with ruff by the pre-commit hook.
🤖 Generated with Claude Code