Skip to content

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

Merged
giovannipizzi merged 6 commits into
aiidateam:provenance_redesignfrom
boschresearch:issue_2228
Dec 7, 2018
Merged

Improve robustness of parsing versions and element names from UPF files#2296
giovannipizzi merged 6 commits into
aiidateam:provenance_redesignfrom
boschresearch:issue_2228

Conversation

@astamminger
Copy link
Copy Markdown
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
Copy Markdown
Contributor

sphuber commented Dec 5, 2018

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

@astamminger
Copy link
Copy Markdown
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
Copy Markdown

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