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

Add dynamic option to append_name #644

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Add dynamic option to append_name #644

merged 2 commits into from
Jul 18, 2024

Conversation

JaGeo
Copy link
Member

@JaGeo JaGeo commented Jul 11, 2024

Hi @utf , @davidwaroquiers ,

I have made a draft implementation to address #639 . Let me know what you think. I hope I haven't overlooked anything.

@JaGeo
Copy link
Member Author

JaGeo commented Jul 11, 2024

I am working on materialsproject/atomate2#752. To finish it, this or a similar functionality would be needed. Otherwise, mock_vasp does not work.

@davidwaroquiers
Copy link
Contributor

Hi @JaGeo

I did not test but I think it should work. I guess for your own needs is fine but if I have to say one thing, maybe 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 ?")

@JaGeo
Copy link
Member Author

JaGeo commented Jul 11, 2024

I don't really have a use case for the other cases. My use case currently to make sure I can differentiate jobs for moch_vasp.

(And, yes, it works. I tested it 😅)

@utf
Copy link
Member

utf commented Jul 18, 2024

Thanks, @JaGeo. I'll merge this for now. I put @davidwaroquiers comment into a new issue #648.

@utf utf merged commit 06a2b36 into materialsproject:main Jul 18, 2024
7 checks passed
@JaGeo
Copy link
Member Author

JaGeo commented Jul 18, 2024

Thanks, @utf . Would a new version be okay? Then, I can finalize the Grüneise workflow in atomate2 as well

@utf utf added the enhancement New feature or request label Jul 22, 2024
@utf
Copy link
Member

utf commented Jul 22, 2024

I just pushed a new version (v0.1.18). It should be out soon.

@JaGeo
Copy link
Member Author

JaGeo commented Jul 22, 2024

Thank you @utf !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants