Skip to content

curveID can now represent multiple columns in userGcMeta#28

Merged
cboisvenue merged 2 commits intodevelopmentfrom
suz-multiCurveID
Sep 3, 2025
Merged

curveID can now represent multiple columns in userGcMeta#28
cboisvenue merged 2 commits intodevelopmentfrom
suz-multiCurveID

Conversation

@suz-estella
Copy link
Copy Markdown
Contributor

Turns out this wasn't too difficult to implement. I added a test that gives a simple example of this.

I did make one change here that I think is better: Before, all 3 input tables userGcMeta, userGcM3, and userGcSPU had to have all columns in sim$curveID. In this update, userGcMeta and userGcM3 both have to have matching 'curveID' columns, but sim$curveID can be any number of columns, as long as they match in userGcMeta and userGcSPU. This makes it so that userGcM3 (a very large table) will never need to have all the same columns as userGcMeta; these tables will remain linked by the single column 'curveID'.

An example of what this could look like (pulled from the new test). userGcSPU no longer needs to have the 'curveID' column:

  SpaDES.project::setupProject(

    modules = "CBM_vol2biomass_SK",
    paths   = list(
      projectPath = spadesTestPaths$projectPath,
      modulePath  = spadesTestPaths$modulePath,
      packagePath = spadesTestPaths$packagePath,
      inputPath   = spadesTestPaths$inputPath,
      cachePath   = spadesTestPaths$cachePath,
      outputPath  = file.path(spadesTestPaths$temp$outputs, projectName)
    ),

    curveID = c("species", "moisture"),

    # Define growth curves and spatial unit combos found in the study area
    userGcSPU = data.frame(
      spatial_unit_id = 28,
      species         = "Balsam Fir",
      moisture        = 50
    ),

    # Growth curve metadata
    userGcMeta = data.frame(
      curveID     = 22,
      species     = "Balsam Fir",
      moisture    = 50
    ),

    # Growth curve columns
    userGcM3 = data.frame(
      curveID     = 22,
      Age         = 0:250,
      MerchVolume = 0:250
    )
  )

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@cboisvenue cboisvenue merged commit ac3be56 into development Sep 3, 2025
5 checks passed
@suz-estella suz-estella deleted the suz-multiCurveID branch September 9, 2025 20:16
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

Successfully merging this pull request may close these issues.

3 participants