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

pp.x: fix gaussian cube file parsing. #535

Merged
merged 6 commits into from
Jul 9, 2020
Merged

Conversation

yakutovicha
Copy link
Collaborator

@yakutovicha yakutovicha commented Jun 29, 2020

The current implementation assumes that the number length is 13 digits, which is not
transferrable. In addition, it uses python loops, which are slow.

The PR replaces loops used to reshape the final array by the reshape method and
uses line.split() to split the data values in every line.

@yakutovicha yakutovicha requested a review from sphuber June 30, 2020 14:01
@sphuber
Copy link
Contributor

sphuber commented Jun 30, 2020

@yakutovicha Seems like one parser test is failing after I updated the branch to include the latest changes to support multiple file parsing for PpCalculation.

Fix gaussian cube file parsing and add structure parsing to it.
@yakutovicha
Copy link
Collaborator Author

@yakutovicha Seems like one parser test is failing after I updated the branch to include the latest changes to support multiple file parsing for PpCalculation.

The cube files were wrong. The number of data points per dimension is set to 1, but three data points instead of one were provided in the data array. I modified the cube files.

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @yakutovicha . Changes to parsing of volumetric data is fine, but not sure why you added the other changes. I would remove them because they are beyond the scope of this PR and they are just adding redundant information.

@@ -217,7 +217,7 @@ def detect_important_message(logs, line):
split_line = line.split('=')
if 'negative/imaginary' in line: # QE6.1
output_dict['negative_core_charge'] = float(split_line[-1].split()[0])
output_dict['imaginary_core_charge'] = float(split_line.split()[-1])
output_dict['imaginary_core_charge'] = float(split_line[-1].split()[-1])
Copy link
Contributor

Choose a reason for hiding this comment

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

This is apparently not being tested, correct? I guess that is because the output files we have are not from QE 6.1. However, why is there no imaginary_core_charge for the QE 6.4 branch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is apparently not being tested, correct?

Looks like it wasn't.

However, why is there no imaginary_core_charge for the QE 6.4 branch?

I don't know why, I can just say that there are no imaginary charges for QE 6.4, indeed:

Check: negative core charge= -0.000013

I should also mention, that in QE 6.5 this line is not present at all, while for 6.3 it is present, and looks as follows:

Check: negative/imaginary core charge=   -0.000001    0.000000

aiida_quantumespresso/parsers/pp.py Outdated Show resolved Hide resolved
aiida_quantumespresso/parsers/pp.py Outdated Show resolved Hide resolved
@yakutovicha
Copy link
Collaborator Author

Changes to parsing of volumetric data is fine, but not sure why you added the other changes. I would remove them because they are beyond the scope of this PR and they are just adding redundant information.

Thanks for the review @sphuber. In the reply to your comments I provided the reasoning why, I believe, parsing of the structure should be introduced. It is fine for me to add it in a separate PR if you agree with this change.

@yakutovicha
Copy link
Collaborator Author

not sure why some tests are failing now, but I believe it is unrelated to the changes in this PR.

@sphuber
Copy link
Contributor

sphuber commented Jul 8, 2020

Yeah, this also happened on aiida-core and is due to a bug on Github actions. I will merge a fix and then you can rebase.

Edit: actually, I am not sure if I can workaround this, because the problem is with the runners running Python 3.7. In aiida-core we don't run this version, so we could avoid it. However, for aiida-quantumespresso we need to run all versions 3.5 through 3.8

@yakutovicha yakutovicha requested a review from sphuber July 8, 2020 19:35
@sphuber sphuber merged commit 0031475 into develop Jul 9, 2020
@sphuber sphuber deleted the fix_gaussian_parsing branch July 9, 2020 15:13
@sphuber
Copy link
Contributor

sphuber commented Jul 9, 2020

Thanks a lot @yakutovicha

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.

2 participants