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

Fix the regex NUMBER_PATTERN in _input_base.py #72

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

singularitti
Copy link
Contributor

  • The pipe | character has no special meaning inside a character class and will be matched literally. Thus, this regex will actually match the | character in those places. It should be [-+] and [EedD] respectively.
  • [\.] is indeed redundant, \. should just work.

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7a42f10) 89.87% compared to head (8015c45) 89.89%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #72      +/-   ##
==========================================
+ Coverage   89.87%   89.89%   +0.02%     
==========================================
  Files          10       10              
  Lines         464      465       +1     
==========================================
+ Hits          417      418       +1     
  Misses         47       47              
Files Coverage Δ
src/qe_tools/__init__.py 100.00% <100.00%> (ø)
src/qe_tools/parsers/_input_base.py 88.25% <100.00%> (+0.03%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @singularitti good catch. I looked over the fact that | is a special character but not in a character set. The relevant part of the Python docs:

[]: Used to indicate a set of characters. In a set:
...
Special characters lose their special meaning inside sets. For example, [(+*)] will match any of the literal characters '(', '+', '*', or ')'.

@sphuber sphuber merged commit c0e3c51 into aiidateam:main Oct 28, 2023
5 checks passed
@singularitti singularitti deleted the patch-1 branch October 28, 2023 19:59
@singularitti singularitti restored the patch-1 branch October 28, 2023 20:00
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.

None yet

3 participants