Repository navigation
fix(GG-3218): Add a strict mode to raise errors when params are missing - #4
Merged
Merged
Conversation
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.
When an expression uses a parameter that isn't defined, or whose value is
None, the solver returns the parameter's name as a text string instead of failing. What happens next depends on the operator:So a missing value can quietly produce a wrong result.
The change: an opt-in
strictmodeNone, strict mode raises aMathJSONException. The message readsParameter 'a' is not definedorParameter 'a' is None.["Greater", "a", 0.6], operatorGreater), so callers can show which rule failed.strict=True, nothing changes. Existing users of the library are not affected.Points to check in review
f()in__main__.py. Thereturn sat the very end is the line that turned unknown names into strings.Str:["Str", "plasma"]returns"plasma". The README now says this.Small related fixes
StrandNotnow see values defined withConstants.extract_variablesused the wrong variable in itsConstantsbranch. It also listed the text insideStrandDateas variables.IsDefinedwas listed in the docs but never implemented. It now is.