Skip to content
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

The function signature when supplying parsl_resource_specification is hacky #2168

Open
Andrew-S-Rosen opened this issue May 22, 2024 · 0 comments
Labels
housekeeping Things to tidy up that are otherwise kind of boring

Comments

@Andrew-S-Rosen
Copy link
Member

What would you like to report?

walltime = decorator_kwargs.pop("walltime", None)
parsl_resource_specification = decorator_kwargs.pop(
"parsl_resource_specification", {}
)
def wrapper(
*f_args,
walltime=walltime, # noqa: ARG001
parsl_resource_specification=parsl_resource_specification, # noqa: ARG001
**f_kwargs,
):
return func(*f_args, **f_kwargs)
wrapper.__name__ = func.__name__
return wrapper

Here, we don't want to change the underlying function name so have patched .__name__ of the wrapped function. This is hacky though and doesn't retain things like the original function signature or docstrings. In reality, we should be using something like @functools.wraps but supposedly that does not result in the parsl_resource_specification being retained.

@Andrew-S-Rosen Andrew-S-Rosen changed the title The function signature with parsl_resource_specification is hacky The function signature when supplying parsl_resource_specification is hacky May 22, 2024
@Andrew-S-Rosen Andrew-S-Rosen added the housekeeping Things to tidy up that are otherwise kind of boring label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Things to tidy up that are otherwise kind of boring
Development

No branches or pull requests

1 participant