-
Notifications
You must be signed in to change notification settings - Fork 20
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
Refactor environment #315
Refactor environment #315
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @aornugent . Some suggestions included.
tests/testthat/test-parameters.R
Outdated
expect_identical(p2$strategies[[1]]$control, ctrl_p) | ||
} | ||
}) | ||
# Now overwritten in call to SCM or Patch - will need appropriate test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to comment it out instead of delete? This will leave us wondering why it's commented out.
This still requires a little house keeping, including updating documentation and some R functions as you note above. The simplified FF16_Environment constructors work well and the differences between strategies are easily handled in the R API, with flexibility for users to override the defaults as needed. Only Will notify once final touches have been made, but please feel free to test and review whenever convenient. |
Codecov Report
@@ Coverage Diff @@
## develop #315 +/- ##
==========================================
Coverage ? 79.92%
==========================================
Files ? 94
Lines ? 8459
Branches ? 0
==========================================
Hits ? 6761
Misses ? 1698
Partials ? 0 Continue to review full report at Codecov.
|
Hi @aornugent This is overall really good. But still an important unresolved point above: #315 (comment) We should remove default type for "make_environment()" and "scm_base_control()", and draw these from the parameters object, using something like Otherwise it will be not very user friendly for any strategies other than "FF16" |
982d6bd
to
8bd8f15
Compare
canopy = Canopy(); | ||
}; | ||
|
||
// Light interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another incremental change toward #306.
This removes the Environment object from Parameters and passes it directly to SCM or Patch APIs as required. This is handled on the R side with what I hope are sensible defaults, but should be straightforward for users to configure.
The major motivation for this was to have strategy specific variants of the FF16 Environment. See
ff16_environment.cpp
andplant::Water_make_environment
for an example (noting that Water -> FF16w in the future).It's tripped up something in the Stochastic Patch which isn't initialising the cohort introduction schedule correctly. Will continue to investigate. Will rebase off develop once the issue has been resolved and #314 has been merged.