Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module code checks report possible issues #82

Open
13 tasks
achubaty opened this issue Dec 2, 2022 · 3 comments
Open
13 tasks

module code checks report possible issues #82

achubaty opened this issue Dec 2, 2022 · 3 comments

Comments

@achubaty
Copy link
Collaborator

achubaty commented Dec 2, 2022

missing or incorrect metadata

  • Biomass_borealDataPrep: defineParameter: 'speciesUpdateFunction' is not of specified type 'list'.
  • Biomass_borealDataPrep: outputObjects: standAgeMap, rstLCC, firePerimeters, speciesLayers, studyAreaLarge, cloudFolderID, ecoregionGroup are assigned to sim inside createBiomass_coreInputs, but are not declared in metadata outputObjects
  • Biomass_borealDataPrep: inputObjects: imputedPixID is assigned to sim inside .inputObjects, but is not declared in metadata inputObjects
  • Biomass_borealDataPrep: inputObjects: sppColorsVect, longevity, ecoregionGroup, pixelGroup are used from sim inside createBiomass_coreInputs, but are not declared in metadata inputObjects

declared in metadata but not used/created

  • Biomass_borealDataPrep: module code: rawBiomassMap is declared in metadata outputObjects, but is not assigned in the module

function name conflicts

  • Biomass_borealDataPrep: module code: the following function(s) is used that conflict(s)
    with base functions: scale, scale
    It is a good idea to be explicit about the package sources, e.g., raster::scale but only for the 'get' functions, not the 'set' function
    (e.g., don't change when on the left hand side of an assignment operator)

no default inputs provided

(probably OK)

  • Biomass_borealDataPrep: module code: cloudFolderID, ecoregionRst are declared in metadata inputObjects, but no default(s) are provided in .inputObjects

unused local variables

(very likely OK)

  • Biomass_borealDataPrep: module code: createBiomass_coreInputs: local variable ‘out’ assigned but may not be used (Biomass_borealDataPrep.R:801)
  • Biomass_borealDataPrep: module code: createBiomass_coreInputs: local variable ‘timePriorToFit’ assigned but may not be used (Biomass_borealDataPrep.R:848)
  • Biomass_borealDataPrep: module code: plotFn_speciesEcoregion: local variable ‘ggSpeciesEcoregion’ assigned but may not be used (R/plotFn_speciesEcoregion.R:2-9)
  • Biomass_borealDataPrep: module code: spinUpPartial: local variable ‘mySimOut’ assigned but may not be used (R/updateYoungBiomasses.R:194-202)
  • Biomass_borealDataPrep: module code: spinUpPartial: local variable ‘opts’ assigned but may not be used (R/updateYoungBiomasses.R:157-162)
  • Biomass_borealDataPrep: module code: updateYoungBiomasses: local variable ‘PI.time’ assigned but may not be used (R/updateYoungBiomasses.R:35-40)
@achubaty
Copy link
Collaborator Author

achubaty commented Dec 2, 2022

@CeresBarros some of these are real issues nthat need to be addressed ASAP -- maybe bad merges?

@CeresBarros
Copy link
Member

I'll have a look, but some have an answer:
(in resync-devel branch)

Biomass_borealDataPrep: defineParameter: 'speciesUpdateFunction' is not of specified type 'list'.

I see the default being list(quote(LandR::speciesTableUpdate(sim$species, sim$speciesTable, sim$sppEquiv, P(sim)$sppEquivCol))) and:

> is(list(quote(LandR::speciesTableUpdate(sim$species, sim$speciesTable, sim$sppEquiv, P(sim)$sppEquivCol))), 'list')
[1] TRUE

So not sure why this is being flagged. Could you be overriding defaults?

Biomass_borealDataPrep: inputObjects: sppColorsVect, longevity, ecoregionGroup, pixelGroup are used from sim inside createBiomass_coreInputs, but are not declared in metadata inputObjects

I see sppColorsVect missing from the metadata indeed. the others I don't see being used from sim and they are column names

Biomass_borealDataPrep: module code: rawBiomassMap is declared in metadata outputObjects, but is not assigned in the module

I see rawBiomassMap being assigned to sim in .inputObjects

Biomass_borealDataPrep: module code: cloudFolderID, ecoregionRst are declared in metadata inputObjects, but no default(s) are provided in .inputObjects

both are optional -- so more a problem of bad documentation here

@CeresBarros
Copy link
Member

I can fix many of these , but where do I push to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants