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

fix setting default codes #704

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Apr 29, 2024

fix #698

Now the codes are automatically set to default ones if available

qeapp-auto-set-codes.mp4

code.value = orm.load_code(DEFAULT_PARAMETERS["codes"][name]).uuid
except NotExistent:
pass
self.set_selected_codes(DEFAULT_PARAMETERS["codes"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is set_seleceted_codes method accept None? If the code setup is not success (rarely but possible), will this raise an error? You can test by remove the code and see if this change still works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. Yes, the set_seleceted_codes can handle None.

def _get_code_uuid(code):

I tested as you suggested, I deleted the code, and it works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@superstar54 superstar54 requested a review from unkcpz April 29, 2024 15:42
@superstar54 superstar54 merged commit 098a8e6 into aiidalab:main Apr 30, 2024
14 checks passed
@superstar54 superstar54 deleted the fix_698_auto_set_codes branch April 30, 2024 08:03
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.

Codes are not automatically selected
2 participants