Conversation
…eporting Refactor the complex logic for dealing with merging different types into one place - the ValueList.render method. This removes the replication of the logic in the *item.merge_over methods. As part of the change the errors reported by ValueList.render when merging is not allowed have been changed from standard python TypeErrors to a reclass specific TypeMergeError which has more friendly error reporting giving the parameter name and locations of the error. To accomodate the error reporting change dicts and lists are subclassed in parameters.py to allow a uri tag to placed on a newly created dictionary or list.
The new modifer is used to declare a parameter to be fixed and not changeable in subsequent classes. If ignore_merging_onto_fixed is False then trying to change a fixed parameter will generate an error if ignore_merging_onto_fixed is True the the parameter will not be changed and no error will be generated
The valuelist.render refractor also tightened up several tests which test if an exception was raised. The changes added a test of the message returned by the exception. As the evaluation order of independant reclass parameters is not defined it's possible to get one of several different error message for some tests. python2 uses the same evaluation order on each reclass run but for python3 the order can and does change between reclass runs over the same data. The tests are fixed by allowing any of the valid error messages to pass the test.
The valuelist.render refractor also tightened up several tests which test if an exception was raised. The changes added a test of the message returned by the exception. As the evaluation order of independant reclass parameters is not defined it's possible to get one of several different error message for some tests. python2 uses the same evaluation order on each reclass run but for python3 the order can and does change between reclass runs over the same data. The tests are fixed by allowing any of the valid error messages to pass the test.
overwrite bug fix
This updates the docs, code and options to use the name constant parameters for parameters using the '=' prefix
add fixed/immutable parameter prefix
…class The Parameters._render_simple_dict and _render_simple_list methods now return a new dict or list instead of changing in place the dict or list passed to them. This commit updates the exports class appropriately and adds some additional tests for these changes.
Fix: use returned parameter from _render_simple_dict/list in exports class
MatteoVoges
pushed a commit
to neXenio/reclass
that referenced
this pull request
Apr 4, 2023
Add upgrade flag to kapitan install in CI Docker image
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.
No description provided.