Refactor tests - #10
Merged
Merged
Conversation
mascarade vendors ggforce's labelboxGrob() and stamped its grobs with ggforce's 'mark_label' class string, while its own widthDetails/ heightDetails methods were never registered in NAMESPACE. Sizing therefore dispatched to ggforce's identically-named methods by coincidence of the shared string -- and would have silently fallen back to widthDetails.default had ggforce renamed the class or dropped them. Give the grob its own class and register the methods with @exportS3Method, so mascarade's label boxes are sized by mascarade's own code. Also silences the unregistered-S3-method warnings newly emitted by roxygen2 8.0.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017NCXs2e4Vw5asEG3MouXLW
Rework the test helpers and placement/fancyMask tests for readability and determinism: - Rewrite helper-score.R to the project style (descriptive names, braces, roxygen); split fixture construction/loading into helper-fixtures.R. - Freeze the placement geometry into fixtures/placement_geom.rds instead of rebuilding it via generateMask() at test time, so the tests no longer depend on spatstat/polylabelr drift. The box-fit R-tree is an external pointer that cannot be serialised, so the fixture stores plain data and restorePlacementGeom() rebuilds the tree on load. - Use the shipped exampleMaskTable (via exampleMask()) in the colour/label tests rather than calling generateMask() per case (~15.7s -> ~5.4s). - Add make-placement-fixtures.R to regenerate the geometry and golden scores; gate the golden with an explicit length tolerance via expectNoWorseThan(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017NCXs2e4Vw5asEG3MouXLW
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.
No description provided.