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

Fix for the ensemble weights in refactored/single site SDA #2405

Merged
merged 4 commits into from
Sep 4, 2019

Conversation

para2x
Copy link
Contributor

@para2x para2x commented Sep 4, 2019

After a short discussion with @kzarada and @araiho, I realized I pulled something from @araiho PR into the mainline which resulted a small bug for @kzarada project. After another discussion with @araiho here is a small fix for that bug.

Description

Motivation and Context

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.

@para2x para2x changed the title Fix the ensemble weights in SDA Fix for the ensemble weights in refactored/single site SDA Sep 4, 2019
PEcAn.logger::logger.warn("ensemble_weights.Rdata cannot be found. Make sure you generate samples by running the get.ensemble.weights function before running SDA if you want the ensembles to be weighted.")
#create null list
for(tt in 1:length(obs.times)){
weight_list[[tt]] <- rep(1,nens) #no weights
Copy link
Member

Choose a reason for hiding this comment

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

just checking, but doesn't this result in weight_list not being defined at all if settings$run$inputs$ensembleweights$path is NULL? That seems dangerous. To me it seems like we should run this for loop either when the file doesn't exist or when the path is null.

Also, what's the point of defining settings$run$inputs$ensembleweights$path if that path isn't the one being used to open the file? load(file.path(settings$outdir, "ensemble_weights.Rdata"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake this would have been fine with the original piece, The bug has to do with the change in the restart functionality which I'm trying to resolve.

@mdietze mdietze merged commit 4f9510e into PecanProject:develop Sep 4, 2019
@infotroph infotroph mentioned this pull request Sep 18, 2019
12 tasks
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

2 participants