Skip to content

composed functions can optionally supply namespace - #37

Merged
jcmgray merged 1 commit into
mainfrom
jcmgray/composed-namespace-supply
Aug 22, 2026
Merged

composed functions can optionally supply namespace#37
jcmgray merged 1 commit into
mainfrom
jcmgray/composed-namespace-supply

Conversation

@jcmgray

@jcmgray jcmgray commented Aug 22, 2026

Copy link
Copy Markdown
Owner

When you write a composed function, the first and default version can now take a namespace parameter (it could already accept a backend parameter):

@compose
def my_func(x, namespace):
    # get how many elements are needed to sum to 20
    return namespace.sum(namespace.cumsum(x, 0) < 20)

which is convenient and also saves dispatching overhead.

@jcmgray
jcmgray merged commit 0431772 into main Aug 22, 2026
18 checks passed
@jcmgray
jcmgray deleted the jcmgray/composed-namespace-supply branch August 22, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant