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

Improve robustness of parsing versions and element names from UPF files #2296

Merged

Conversation

astamminger
Copy link
Contributor

Fixes #2228

Changed parsing behavior such that regular expressions for elements and versions are now matched against the whole file instead of matching line by line. This makes the parsing process more robust and allows for parsing desired quantities independent of the actual position of the UPF file (See for instance the additional header line mentioned in issue #2228). Since re.search() returns the first match found in the string, there is no major performance impact expected compared to the previous implementation.

@sphuber
Copy link
Contributor

sphuber commented Dec 5, 2018

It would be good if you could add some tests that test the old failure

@astamminger
Copy link
Contributor Author

It would be good if you could add some tests that test the old failure

@sphuber Added required tests to check the parser function (Hope they are in the right place)

@giovannipizzi giovannipizzi merged commit 7a78f8a into aiidateam:provenance_redesign Dec 7, 2018
@coveralls
Copy link

coveralls commented Dec 8, 2018

Coverage Status

Coverage increased (+0.02%) to 68.957% when pulling 947ad22 on boschresearch:issue_2228 into c96b78e on aiidateam:provenance_redesign.

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.

4 participants