-
Notifications
You must be signed in to change notification settings - Fork 137
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: fix invalid escape sequence #647
fix: fix invalid escape sequence #647
Conversation
Fix the warning below: ``` ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:6 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:6: DeprecationWarning: invalid escape sequence '\|' latt_patt = "\|\s+([0-9]{1,}[.][0-9]*)\s+([0-9]{1,}[.][0-9]*)\s+([0-9]{1,}[.][0-9]*)" ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:7 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:7: DeprecationWarning: invalid escape sequence '\|' pos_patt_first = "\|\s+[0-9]{1,}[:]\s\w+\s(\w+)(\s.*[-]?[0-9]{1,}[.][0-9]*)(\s+[-]?[0-9]{1,}[.][0-9]*)(\s+[-]?[0-9]{1,}[.][0-9]*)" ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:8 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:8: DeprecationWarning: invalid escape sequence '\s' pos_patt_other = "\s+[a][t][o][m]\s+([-]?[0-9]{1,}[.][0-9]*)\s+([-]?[0-9]{1,}[.][0-9]*)\s+([-]?[0-9]{1,}[.][0-9]*)\s+(\w{1,2})" ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:9 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:9: DeprecationWarning: invalid escape sequence '\|' force_patt = "\|\s+[0-9]{1,}\s+([-]?[0-9]{1,}[.][0-9]*[E][+-][0-9]{1,})\s+([-]?[0-9]{1,}[.][0-9]*[E][+-][0-9]{1,})\s+([-]?[0-9]{1,}[.][0-9]*[E][+-][0-9]{1,})" ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:10 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/fhi_aims/output.py:10: DeprecationWarning: invalid escape sequence '\s' eng_patt = "Total energy uncorrected.*([-]?[0-9]{1,}[.][0-9]*[E][+-][0-9]{1,})\s+eV" ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/abacus/scf.py:41 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/abacus/scf.py:41: DeprecationWarning: invalid escape sequence '\s' while len(re.split("\s+", lines[blk_idx])) == 0: ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/abacus/scf.py:44 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/abacus/scf.py:44: DeprecationWarning: invalid escape sequence '\s' if len(re.split("\s+", lines[blk_idx])) == 0 or lines[blk_idx] == "": ../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/abacus/scf.py:332 /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/dpdata/abacus/scf.py:332: DeprecationWarning: invalid escape sequence '\s' if len(re.split("\s+", geometry_inlines[iline])) >= 3: ```
WalkthroughWalkthroughThe modifications involve updating regular expression patterns across two Python files by introducing raw string literals. This change enhances the accuracy of pattern matching operations within functions that process text data. The adjustment ensures that special characters in regular expressions are interpreted correctly, improving the reliability of data parsing in the codebase. Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review due to trivial changes (1)
Additional Context UsedRuff (7)
Additional comments not posted (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #647 +/- ##
=======================================
Coverage 83.67% 83.67%
=======================================
Files 80 80
Lines 7006 7006
=======================================
Hits 5862 5862
Misses 1144 1144 ☔ View full report in Codecov by Sentry. |
Fix the warning below: