Repository navigation
Remove redundant m_boundfix calls, fix to up instead of l - #943
Merged
Merged
Conversation
The calls in 10_land (runs before modules 31-35 set the vm_land bounds) and 29_cropland tree cover (variable fixed one line above) never change anything. At the remaining l sites, .l equals .up when the macro fires, so up gives identical results without depending on statement order.
flohump
marked this pull request as ready for review
October 5, 2026 09:53
# Conflicts: # CHANGELOG.md
georg-schroeter
approved these changes
Oct 5, 2026
tscheypidi
requested changes
Oct 8, 2026
tscheypidi
left a comment
Member
There was a problem hiding this comment.
Thanks for tackling this. Two requests:
-
I think the boundfix in module 10 must not be removed as you cannot assume that modules 31-35 will change the bounds. Is there any harm of having it?
-
I checked the different occurrences of the boundfix and with "l" now not being recommended I think all of them set the bound to up and the sensitiviy to 1e-6. For simplification and reduction of user error I would suggest to change the macro and remove the option to set sufx and sens, Just
$macro m_boundfix(x,arg) x.fx arg$(x.up arg-x.lo arg<1e-6) = x.up arg;instead
The macro always fixes to up with sensitivity 1e-6, the values used at all call sites. Keep the 10_land call, since not every realization of 29-35 resets the vm_land bounds (review by tscheypidi).
Contributor
Author
|
@tscheypidi Thanks. I adressed both of your points. Please check the code once more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐦 Description of this PR 🐦
Cleans up the
m_boundfixcalls. Results are unchanged.m_boundfix(x,arg), always fixing toupwith sensitivity 1e-6. All calls used these values except three sites withl(29 fallow, 35 secdforest, 35 other land), where.lequalled.upwhenever the macro fired.29_croplandtree cover (the variable is fixed one line above).lower bound > upper boundonv35_secdforest, rounding of order 1e-17), and up to ~1500 near-fixedv35_secdforestentries per step are left to CONOPT.gdxdiffoffulldata.gdxdiffers only inc_title.🔧 Checklist for PR creator 🔧
If a point is not applicable, check the checkbox anyway and write "non-applicable" next to the checkbox.
Label pull request from the label list.
Self-review own code
magpie4R library has been updated accordingly and backwards compatible where necessary.scenario_config.csvhas been updated accordingly (important ifdefault.cfghas been updated)Document changes
CHANGELOG.mdgoxygen::goxygen()and verify the modified code is properly documentedPerform test runs
Rscript start.R --> "compilation check"Rscript start.R --> "default"Rscript start.R --> "test runs"Reporting produces no errors and no new warnings
Get two approving reviews (at least one from RSE)
📉 Performance 📈
🚨 Checklist for reviewer 🚨
CHANGELOGis updated correctly