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

Better dynamic append_name function. #648

Open
utf opened this issue Jul 18, 2024 · 0 comments
Open

Better dynamic append_name function. #648

utf opened this issue Jul 18, 2024 · 0 comments

Comments

@utf
Copy link
Member

utf commented Jul 18, 2024

I would make a new update_name method that has more functionalities:

  • Update the name without adding prefix/suffix (this is already available if you just do some_job.name = 'mynewname', but not in a dynamic way)
  • Filters similar to update_metadata and others

API of this method could be:

def update_metadata(
        self,
        newname: str | None = None,
        prefix: str | None = None,
        suffix: str | None = None,
        name_filter: str = None,
        function_filter: Callable = None,
        dynamic: bool = True,
    ):

Then the append_name can just be used by this method if prefix and/or suffix is provided. (and the dynamic in append_name is not needed, I guess it would be better/less confusing if it is only in one place)

Not sure if it is absolutely essential, but it would make thing consistent with the rest of the update_* methods. (and I guess it would not be a huge work but again, it's all a matter of "is it needed and worth it if there is no use case right now ?")

Originally posted by @davidwaroquiers in #644 (comment)

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

No branches or pull requests

1 participant