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

PhCalculation: Fix bug when only_initialization=True #813

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented May 5, 2022

Fixes #811

When the only_initialization setting is set to True the plugin would
add an instruction to the remote_copy_list to copy DYN_MAT folder
from the parent_folder. However, this would fail if the parent_folder
was that of a PwCalculation, which is one of the main use cases of the
PhCalculation.

It is not entirely clear why this was added in the commit that added it
dfdca7e which was just adding a plugin
for EPW. We assume it was added by mistake and so remove it.

@sphuber sphuber requested a review from mbercx May 5, 2022 22:05
@sphuber sphuber force-pushed the fix/811/phcalculation-only-initialization branch from b92b00d to ef76d76 Compare May 6, 2022 07:18
mbercx
mbercx previously approved these changes Jun 2, 2022
Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

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

Cheers @sphuber! I have do double check, but I think this may be also required for my ElectronPhononWorkChain. However, ok to remove for now, I'll re-add it in a correct manner in case I need it.

@sphuber
Copy link
Contributor Author

sphuber commented Jun 2, 2022

However, ok to remove for now, I'll re-add it in a correct manner in case I need it.

In that case I maybe better add a test to ensure the current functionality is preserved.

When the `only_initialization` setting is set to `True` the plugin would
add an instruction to the `remote_copy_list` to copy `DYN_MAT` folder
from the `parent_folder`. However, this would fail if the `parent_folder`
was that of a `PwCalculation`, which is one of the main use cases of the
`PhCalculation`.

It is not entirely clear why this was added in the commit that added it
dfdca7e which was just adding a plugin
for EPW. We assume it was added by mistake and so remove it.

A test is added for the `only_initialization=True` case since that
didn't exist yet. Unfortunately, this test won't prevent the same bug
being introduced because the incorrect code isn't triggered until the
engine tries to execute the copy commands. This is not possible to
reproduce in this simple unit test.
@sphuber sphuber force-pushed the fix/811/phcalculation-only-initialization branch from ef76d76 to 0fe6f3d Compare June 2, 2022 16:27
@sphuber
Copy link
Contributor Author

sphuber commented Jun 2, 2022

@mbercx I added a test but realized that it won't actually prevent the same bug from being introduced in the future because it won't materialize until the engine tries to actually execute the file copy instructions. Still, thought this additional test is better than nothing. Don't feel like adding an integration test for this though.

@sphuber sphuber requested a review from mbercx June 2, 2022 16:28
Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

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

Let's get this baby merged then 🚀

@sphuber sphuber merged commit 679fe68 into develop Jun 2, 2022
@sphuber sphuber deleted the fix/811/phcalculation-only-initialization branch June 2, 2022 18:05
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.

PhCalculation is bugged when starting from parent_folder of PwCalculation and only_initialization = True
2 participants