-
Notifications
You must be signed in to change notification settings - Fork 189
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
Issue 1183 fast cif parsing #1188
Issue 1183 fast cif parsing #1188
Conversation
formatting + fixing minor issues
Example: from aiida.orm.data.cif import CifData a = CifData('/path/to/file.cif', scan_type='flex') Also add test to check that results are identical.
@giovannipizzi Suggestions for improvement welcome. |
default2 = CifData(file=f.name, scan_type='default') | ||
self.assertEquals(default._prepare_cif(), default2._prepare_cif()) | ||
|
||
flex = CifData(file=f.name, scan_type='flex') |
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.
Is there a way to check that it is actually using flex as a scan type?
Maybe checking the attribute, but maybe it is not even enough, in case the parsing happens before the scan_type is read? It depends on whether the parsing occurs at init or at _prepare_cif.
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.
yes, it actually isn't using flex. I will put the default values in the constructor of CifData instead.
It's still not quite correct... |
I'm not sure I understand what happens when you don't use the property. Can't you use self.get_attr('scan_type') instead of self.scan_type? |
Closing this in favor of a new PR including also #1186 |
Fix #1183
This adds a
scan_type
attribute to CifData.Using
scan_type='flex'
uses C-routines of PyCifRW and is several times faster than the python-based implementation for large CIF files.Example:
cif.py
to linter (1st commit)scan_type
(2nd commit)