drop the quickPlot dependency - #57
Merged
Merged
Conversation
quickPlot is being archived on CRAN and is no longer maintained, so it would take NetLogoR down with it (#54). NetLogoR only ever borrowed four generics from it -- coordinates(), extent(), layerNames() and numLayers() -- and exported its own methods for them, so those are now defined here. Their signatures are unchanged, so calling code is unaffected. The one thing that genuinely needed quickPlot was .identifyGrobToPlot(), which dispatches on quickPlot's own .quickPlotGrob class and let Plot() draw a worldArray. Keeping Plot() working is not possible once the generics move: Plot() dispatches on *quickPlot's* generics, so the methods would have to be registered against both sets, which lands two S4 method tables in the namespace and emits "multiple methods tables found" for extent, coordinates and layerNames at install and on load. Plot() therefore no longer works on NetLogoR objects; plot() and points(), which draw through terra, are the replacement, and the vignettes, the shipped examples and the plotting tests now use them. Rename R/quickPlot.R to R/layers.R, since what is left of it is just the layer accessors. Also pass nrows/ncols rather than nrow/ncol to terra::rast() in world2spatRast(), which was partial-matching and warning on every plot of a world. Closes #54 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nothing in the package references quickPlot any more, so it no longer needs to be requested explicitly in extra-packages. It can still arrive transitively as a dependency of the SpaDES packages, which is fine; it is simply no longer something NetLogoR asks for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #54.
quickPlotis being archived on CRAN and is no longer maintained. It was inImports, so its archival would have takenNetLogoRwith it. This removes it fromDESCRIPTIONentirely — nothing inR/,tests/,vignettes/orinst/references it any more.What was actually coupled
NetLogoRonly ever borrowed four generics and exported its own methods for them:coordinatessetGeneric("coordinates", quickPlot::coordinates)extentsetGeneric("extent", quickPlot::extent)layerNamessetGeneric("layerNames", quickPlot::layerNames)numLayersThese are now defined in
NetLogoRwith the same signatures, so calling code is unaffected.bbox()already worked this way, so there was a template in-tree.The only piece that genuinely needed
quickPlotwas.identifyGrobToPlot(), which dispatches on quickPlot's internal.quickPlotGrobclass soPlot()could draw aworldArray.Why
Plot()support could not be keptquickPlot::Plot()dispatches on quickPlot's generics. Once the generics move intoNetLogoR, keepingPlot()working means registering the methods against both sets — which puts two S4 method tables in the namespace and emits, atR CMD INSTALLand on everylibrary(NetLogoR)for anyone with quickPlot installed:Verified causally by removing the dual registrations one at a time: 3 warnings with them, 0 without. Without the dual registration
Plot()fails for all three classes (worldMatrix,worldArray,agentMatrix) at theextentdispatch, so the hook was unreachable dead code.Plot()onNetLogoRobjects therefore no longer works.plot()andpoints(), which draw throughterra, are the replacement. Note this means no deprecation warning ships — there is no code path left to warn from, soquickPlot::Plot(w1)now surfaces quickPlot's own "unable to find an inherited method" error. TheNEWS.mdentry carries the explanation.Also in here
R/quickPlot.R→R/layers.R, since what remains is just the layer accessors.world2spatRast()passednrow=/ncol=toterra::rast(), which partial-matched and warned on every plot of a world. Corrected tonrows=/ncols=— this clears 7 warnings that were present in every test run.test-plotting.Rrewritten againstplot()/points(); vignette prose updated in both.Rmds; all four shipped examples updated, including the SpaDES module'sreqdPkgs.Verification
R CMD check --as-cran: 0 errors, 0 warnings, 0 notesdevtools::test(): 0 failures (and down from 8 warnings to 1, itself pre-existing and unrelated)_R_CHECK_DEPENDS_ONLY_=truecheck: passesquickPlotnot loaded:plot(),points(),numLayers(),layerNames(),extent()andcoordinates()all behave, with zero "multiple methods tables" warningsCI
All three workflows stop requesting
PredictiveEcology/quickPlot@developmentinextra-packages, since nothing in the package references it any more. It can still arrive transitively as a dependency of the SpaDES packages; it is simply no longer somethingNetLogoRasks for.🤖 Generated with Claude Code