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

Patch for get.trait.data.pft.R #2761

Merged
merged 6 commits into from Feb 9, 2021

Conversation

jessicaguo
Copy link
Collaborator

@jessicaguo jessicaguo commented Jan 28, 2021

Added an if/else to the existing_membership check, which pulls in either species.csv or cultivars.csv for comparison. Crucially, the column classes differ between the two types.

Description

'species.csv' has 4 columns, the first of which has to be numeric. 'cultivars.csv' has 6 columns, the first 2 of which have to be numeric.

Motivation and Context

When the meta-analysis update is set to FALSE in the pecan.xml file, pfts with cultivars can now have meta-analysis results ported over from a previous run, reducing the need to rerun the meta-analysis each time.

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

na.strings = c("", "NA")
)
diff_membership <- symmetric_setdiff(
if (pfttype == "plant") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a lot more duplicate code here than necessary. Could we just have the if be used to define the colClasses variable, and then use that variable in the existing_membership load?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fixed to be much more compact. Thanks!

@mdietze mdietze merged commit 626b6e5 into PecanProject:develop Feb 9, 2021
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.

None yet

3 participants