-
Notifications
You must be signed in to change notification settings - Fork 82
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
Flexible regex match error message in detect important massage #771
Conversation
One thing that is important to take into account is efficiency. The regexes will be executed a lot because each regex is matched against every line, so I can see this become very expensive. We should do some benchmarking to see the effect. And for a start, you may want to |
@sphuber thanks for the head up. That's true, I will make a quick banchmark. |
Regex slows down the parsing process of stdout raw (a little bit I would say?). Here are the benchmarks by using pytest-benchmark. The (1) using
(2) regex without
(3) regex with re.compile
For the results above, I think maybe we can both use compiled re and string as markers? Only do regex check when the marker is a
The benchmark for this strategy:
|
Hi @sphuber, could you have a look at this? I think from the benchmark, the loss of efficiency is acceptable even all the checks move to REGEX. |
I think it is fine to merge these changes. Would just ask you to try and trim down the test reference files. Especially for error testing, there is usually not a lot of the output file you exactly need, you can get rid of most of the text. Please try to get them as minimal as possible as to not bloat the repository too much |
e574e13
to
1ef9dba
Compare
Thanks @sphuber! |
Any idea why the tests are now failing? |
@sphuber Sorry that I didn't check the tests. Do we have a plan to deprecate py3.6? But always I can create a py3.6 environment to try to figure out why these fail. EDIT: Test failed because for py<3.7 module 're' has no attribute 'Pattern'. I replace it with But what concerns me most is when the test fails the error message is not so obvious. |
However the readthedocs test failed because of following error:
Is it some dependency broken for docs related packages? |
267e73d
to
9838c2e
Compare
The problem with the docs is due to a recent release of
I think the full stack trace is included and stored in the attributes. As for the timeline of deprecating Python 3.6, I think since As for the temporary fix,it is ok to keep, but please add the following comment behind it |
Fixed the docs in #790 |
9838c2e
to
55ec227
Compare
For new QE version (test on v6.8) 'some nodes have no k-points' is not raised as an error and stop the calculation. The output is different but still contain the same content, so instead of check content in line use regex match
@sphuber Thanks a lot! I rebased the PR and add the comment as you suggest. |
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.
THanks @unkcpz
For new QE version (test on v6.8) 'some nodes have no k-points' is not raised as an error and stop the
calculation. The output is different but still contain the same content,
so instead of check content in line use regex match