-
Notifications
You must be signed in to change notification settings - Fork 27
fix: use original Vensim names in generated headers for spec output vars #462
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f97985b
use original Vensim names in generated headers for spec output vars
ToddFincannonEI bc31a87
remove obsolete arrays_cname test model
ToddFincannonEI 821d8a1
rename arrays_varname test model to arrays
ToddFincannonEI 94edffc
use Vensim format outputVarNames in all test model spec files
ToddFincannonEI 07e36fe
escape double quotes in header variable names
ToddFincannonEI 3005eb0
update arrays test model name in the compile tests
ToddFincannonEI 39172e1
Merge branch 'main' into todd/461-validation-subs
ToddFincannonEI aa85254
fix: update comment to better reflect how input/outputVarNames are co…
chrispcampbell 9f23719
fix: simplify and clarify code gen logic now that only outputVarNames…
chrispcampbell f5f8625
fix: update README for cli package to show correct usage of input/out…
chrispcampbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
@ToddFincannonEI: It looks like the build is failing due to a test failure when running the "allocate" model, but probably others are affected as well:
https://github.com/climateinteractive/SDEverywhere/actions/runs/8741036880/job/23986139008
The error points back to this line, which will fail if
headerVarsis undefined.The issue is that there are two ways to specify output variables in the
spec.json, you can either useoutputVars(which takes C names) oroutputVarNames(which takes Vensim names). In the case ofoutputVarNames, we convert tooutputVarsin this code inModel.readso that the rest of the code only needs to deal withoutputVars(sort of a lowest common denominator):There are only 3 sample models that use the older
outputVarsform (allocate, arrays_cname, longeqns).There are a few different ways we could solve this. I don't think it's imperative that we retain support for
outputVars. For En-ROADS/C-ROADS we use the neweroutputVarNamesand all the new build stuff in SDE also uses that form, so I doubt anyone out in the wild is relying onoutputVars. I think if we changed those 3 tests to useoutputVarNamesand effectively drop support foroutputVars, then your proposed fix will be nearly correct (though I'd need to look through the rest of the code to see if any other changes are needed).Let me know which approach you'd like to take.
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.
Sorry I forgot to run the tests before submitting. EPS uses outputVarNames too, so your proposed solution looks good to me. I will change the tests and resubmit.
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.
It looks like the only purpose of the arrays_cname test model is to test the
outputVarsC name support in spec files. I propose deleting this model, since we are dropping support foroutputVars.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.
@ToddFincannonEI: I agree with deleting arrays_cname, and also suggest renaming arrays_varname back to just arrays, but I'd be OK handling that myself in a separate PR after this one.