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

"SyntaxError: invalid escape sequence \s" when import v0.9.1 API as a module #294

Open
chemsh opened this issue Dec 24, 2023 · 2 comments
Open

Comments

@chemsh
Copy link

chemsh commented Dec 24, 2023

Dear BSE developers,

we find when importing the BSE Python API v0.9 or v0.9.1 as a module in Py-ChemShell by

from .src.build.lib import basis_set_exchange

the Python3 interpreter (v3.8.10) reports a few errors of

SyntaxError: invalid escape sequence \s

in src/basis_set_exchange/ints.py

due to the multiple docstrings containing content

\sum_ which should be \\sum_

and similar issues of escapes \s and \d are found in the lines

# Start for new basis entry
basis_head_re = re.compile(r'^/([a-zA-Z]+).({}|)....(aCD|acCD)-aux-basis.\s*$'.format(helpers.basis_name_re_str))
# Elemental charge, lmax, number of basis set blocks
charge_line_re = re.compile(r'^\s*({})\s+(\d+)\s+(\d+)\s*$'.format(helpers.floating_re_str))
dummy_line_re = re.compile(r'^\s*Dummy reference line.\s*$')
# nprim, ncontr, functype
shell_start_re = re.compile('^\s*(\d+)\s+(\d+)\s+(\d+)\s*$')

# Floating point data
array_data_re = re.compile(r'^\s*(?:\s({}))+\s*$'.format(helpers.floating_re_str))

of src/basis_set_exchange/readers/ricdlib.py

We appreciate if you could have this fixed.

Happy Christmas!

You

@bennybp
Copy link
Member

bennybp commented Jan 2, 2024

Hello

I can't reproduce on any python version for whatever reason, but these are indeed issues. I've opened a PR to fix them (#297)

@chemsh
Copy link
Author

chemsh commented Jan 2, 2024

Hello

I can't reproduce on any python version for whatever reason, but these are indeed issues. I've opened a PR to fix them (#297)

Much appreciated!

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

No branches or pull requests

2 participants