-
Notifications
You must be signed in to change notification settings - Fork 10
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 parse.py for reading spectral data from completed jobs #218
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #218 +/- ##
==========================================
- Coverage 77.21% 67.87% -9.34%
==========================================
Files 13 14 +1
Lines 1040 1183 +143
==========================================
Hits 803 803
- Misses 237 380 +143 ☔ 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.
I've reviewed extract_FEFF
for now. There are a few places where I think we need changes.
One thing in particular, I don't think we necessarily should be catching these errors in try/except statements. Since the user is going to use extract_FEFF
directly via our API, we want these errors to be thrown if, for example, the files are not found.
I'll review the rest of this after we make changes to extract_FEFF
!
@chuntian236 we should also clear the output of the Jupyter notebook before pushing so it takes up less space. |
I have a few general comments here:
|
Thank @fanchen0121 for a very comprehensive message. 1. Excellent point. ocean, exciting and vasp calculate epsilon2; feff and xspectra calculate cross section. 2. It is a good idea to save spectra from different polarization; in that event, we also need to save polarization directions. --perhaps for the next update. 3. I'd like to keep parsing spectra and performing edge alignment separately, as users may not need to do edge alignment. 4. Just from output, I don't think there is an easy way to remove this redundancy. 5. I think it is ok that ocean parser generate spectra on multiple elements, as far as the dict keys are clear. 6. That's a good idea. 7. I remember the same. We may need an option to "standardize" the site index. @chuntian236 please think about these suggestions, which can be addressed in this round and which can be pushed to a later update? |
Another thought on point 1, we do the conversion on the fly when parsing the data or we also save the structure data, which might also be useful for the site index. Otherwise, we cannot do the conversion if we do not have the structure data or don't do the conversion on the fly. |
@fanchen0121 For point 1, I think epsilon2 to cross section is not a general use case and most of the users don't have to worry about. I suggest that we treat this separately, and as you said we also need structure. For point 3, gs.out is always generated when a user compute xanes with xspectra, but gs.out is not required. So I think it makes sense to parse out total energy from es.out and leave the total energy in gs.out for the alignment module. |
Replying to Fanchen's comments:
|
@chuntian236 @deyulu Since I know you both want to merge we can basically proceed. Before we do, Chuntian, can you run the Black formatter on this code? It's failing Black and flake8 checks. It might seem petty but these types of formatting differences creep in and can make the code very hard to maintain/read. Once that's done we can merge. We also (later) might want to look into using something faster than a for loop over every line of the OUTCAR. I have a feeling that's going to be painfully slow. |
To pass code quality check.
To pass code quality check.
To pass quality check.
@chuntian236 I'm going to merge this for now and I'll take care of why Black is failing later. |
I think I know why's Black is failing. Shall I commit in the master branch? Or make a new branch to try? |
@chuntian236 go for another PR through another branch if you want! Thanks! |
Comments on the function for parsing spectra goes in this PR.
parse.py
Jupyter notebook:
parse_spectra.ipynb