Repository navigation
Fixes and dispatch improvements - #940
Merged
Merged
Conversation
When the _util.cli function was rewritten on top of ags in commit 1d8b7db, it was incorrectly assumed that stringly_doc.presets and stringly_doc.defaults contained the already destringlified object values. This patch fixes that assumption, and adds arguments that are yet to be converted in a `string_args` dictionary first, before converting it to the `kwargs` dictionary of objects in the final loop.
This patch restores test.docs which got disabled as a side effect of moving nutils into the src directory.
This patch avoids the stack operation of the choose arguments which adds work that is entirely unnecessary.
This patch adds the equivalent to Choose._multiply, which was missing for no apparent reason. It also adds the test.evaluable.Choose unit test to make sure that the simplifications are operational.
This patch adds the nutils_dispatch decorator to the following functions in the nutils.function module: - piecewise - partition - heaviside - chain - vectorize - add_T - trignormal - trigtangent - rotmat - dotarg
This patch adds the _util.flatten utility function that will be used in subsequent commits to deal with arbitrarily nested function arguments.
This patch limits the kinds of arguments that are accepted by the @single_or_multiple decorator, no longer accepting maps or generators. The reason for this change is that in the scenario that a function is later decorated with @nutils_dispatch, it is preferable to replace the existing @single_or_multiple decorator and instead handle nested arguments internal to the function, as otherwise (using single_or_multiple) the function that is passed on by @nutils_dispatch (undecorated) does not match the function object in the module namespace (decorated). Since this means that every dispatch handler needs to be able to handle the complex argument, it at least eases the burden by not allowing iterators.
This patch generalizes the implementation of _util.nutils_dispatch by recursively entering arguments of type tuple of list in the search for argument types that have a __nutils_dispatch__ method.
This patch adds _util.nested_map, which will be used in situations that the @single_or_multiple decorator is not applicable.
joostvanzwieten
approved these changes
Sep 30, 2026
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.