Repository navigation
Run without Biomass_speciesData in study areas with no tree species - #140
Merged
Merged
Conversation
With no Biomass_speciesData, .inputObjects builds speciesLayers from prepSpeciesLayers_SCANFI(), which returns NULL for an ELF with no tree species. NAcover2zero() then errored on NULL. Skip it; init's no-species branch already expects NULL. Co-Authored-By: Claude Opus 5.5 <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.
When Biomass_speciesData is not in a project, this module makes the species cover maps itself. In a study area with no tree species that step stopped the run. Now it carries on, as it already does when Biomass_speciesData supplies the maps.
Affects: projects that leave out Biomass_speciesData no longer fail in non-forested study areas; nothing else changes.
Technical details
prepSpeciesLayers_SCANFI()returnsNULLwhen there are no species (LandRR/maps.R,loadSCANFISpeciesLayers())..inputObjectsthen calledNAcover2zero(NULL, ...)(Biomass_borealDataPrep.R:1919), which errors:unable to find an inherited method for function 'cover' for signature 'x = "NULL"'. The fix skips that call forNULL. ThenoSpeciesbranch in init already handlesNULL, which is what Biomass_speciesData passes in this case (Biomass_speciesData.R:242).New test
tests/testthat/test-speciesLayersFallback.Revaluates the fallback block from the module source withprepSpeciesLayers_SCANFI()mocked to returnNULL. It fails without the fix.🤖 Generated with Claude Code