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 incar_updates attribute to VASP workflows #552

Closed
jacksund opened this issue Dec 28, 2023 · 2 comments · Fixed by #601
Closed

add incar_updates attribute to VASP workflows #552

jacksund opened this issue Dec 28, 2023 · 2 comments · Fixed by #601
Assignees
Labels
enhancement New feature or request

Comments

@jacksund
Copy link
Owner

I'd like to improve the syntax for inheriting VASP settings and remove some boiler plate code in sub-flows. Rather than having devs use incar.copy() + incar.update(), we can replace those with a simple incar_updates attribute that is set instead. incar with then be a property method that builds the incar (and caches it for speedup).

current approach

class StaticEnergy__Vasp__WarrenLabHse(Relaxation__Vasp__WarrenLabHse):
    incar = Relaxation__Vasp__WarrenLabHse.incar.copy()
    incar.update(
        dict(
            IBRION=-1,
            NSW=0,
            LCHARG=True,
            LORBIT=11,
            LVHAR=True,
            LWAVE=True,
        )
    )

new approach

class StaticEnergy__Vasp__WarrenLabHse(Relaxation__Vasp__WarrenLabHse):
    incar_updates = dict(
        IBRION=-1,
        NSW=0,
        LCHARG=True,
        LORBIT=11,
        LVHAR=True,
        LWAVE=True,
    )

@SWeav02 let me know what you think of the proposed update. I'll wait on your approval before changing this throughout the repo

@jacksund jacksund added the enhancement New feature or request label Dec 28, 2023
@SWeav02
Copy link
Contributor

SWeav02 commented Jan 3, 2024

I like this a lot. When I was first building new workflows the current syntax was a little confusing.

@jacksund
Copy link
Owner Author

jacksund commented Jan 17, 2024

this is implemented now, but I'll update the guides for these changes in #592

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 a pull request may close this issue.

2 participants