-
Notifications
You must be signed in to change notification settings - Fork 14
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
Remove hard coded codes from workflow #474
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #474 +/- ##
=======================================
Coverage 70.45% 70.46%
=======================================
Files 42 42
Lines 2955 2966 +11
=======================================
+ Hits 2082 2090 +8
- Misses 873 876 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just minor requests. @superstar54
# add codes info into input_parameters | ||
self.builder_parameters["codes"] = self.get_selected_codes() | ||
self.builder_parameters["resources"] = self.get_resources() | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# |
"pw_code": self.pw_code.value, | ||
"dos_code": self.dos_code.value, | ||
"projwfc_code": self.projwfc_code.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pw_code": self.pw_code.value, | |
"dos_code": self.dos_code.value, | |
"projwfc_code": self.projwfc_code.value, | |
"pw": self.pw_code.value, | |
"dos": self.dos_code.value, | |
"projwfc": self.projwfc_code.value, |
@@ -134,7 +132,7 @@ def get_builder_from_protocol( | |||
relax_overrides = {"base": parameters["advanced"]} | |||
protocol = parameters["workchain"]["protocol"] | |||
relax_builder = PwRelaxWorkChain.get_builder_from_protocol( | |||
code=pw_code, | |||
code=codes.get("pw_code"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code=codes.get("pw_code"), | |
code=codes.get("pw"), |
@unkcpz I changed as you suggested. Since we replaced the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks all good.
I just merge #449, and what to use it as a test. So I'll rebase this PR and see if from PR everything is built correctly. Hope you don't mind.
]: | ||
try: | ||
code_widget = getattr(self, code) | ||
code_widget = getattr(self, f"{code}_code") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't notice this is directly used in getattr
. Then the original code is good enough.
b6ecc51
to
8263953
Compare
Hi @superstar54, after rebasing the tests failed. But I compared the two branches and didn't find the difference. Do you have any clue why it is happening, can you check the changes are all correct? EDIT: should be fine now, I select incorrect branch when rebase. |
replace `pw_code` by `pw` update qeapp.yaml f-y
8263953
to
749309b
Compare
The codes (
pw_code
,dos_code
,projwfc_code
) are hard coded in the builder, which is not good for the plugin design. This PR usesget_selected_codes
.The
get_resources
method is also used to make the code more modularized.