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

some more regex string fixes; and: use numpy.nan instead of numpy.NAN #288

Merged
merged 8 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gromacs/fileformats/mdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
default_extension = "mdp"
logger = logging.getLogger("gromacs.formats.MDP")

COMMENT = re.compile("""\s*;\s*(?P<value>.*)""") # eat initial ws
COMMENT = re.compile(r"""\s*;\s*(?P<value>.*)""") # eat initial ws

Check warning on line 58 in gromacs/fileformats/mdp.py

View check run for this annotation

Codecov / codecov/patch

gromacs/fileformats/mdp.py#L58

Added line #L58 was not covered by tests
# see regex in cbook.edit_mdp()
PARAMETER = re.compile(
r"""
Expand Down
12 changes: 6 additions & 6 deletions gromacs/qsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ def write_script(template):
template,
[
("^ *DEFFNM=", "(?<==)(.*)", deffnm),
("^#.*(-J)", "((?<=-J\s))\s*\w+", jobname),
("^#.*(-J)", r"((?<=-J\s))\s*\w+", jobname),
(
"^#.*(-A|account_no)",
"((?<=-A\s)|(?<=account_no\s))\s*\w+",
r"((?<=-A\s)|(?<=account_no\s))\s*\w+",
budget,
),
("^#.*(-t)", "(?<=-t\s)(\d+:\d+:\d+)", walltime),
("^#.*(-t)", r"(?<=-t\s)(\d+:\d+:\d+)", walltime),
("^ *WALL_HOURS=", "(?<==)(.*)", wall_hours),
("^ *STARTDIR=", "(?<==)(.*)", startdir),
("^ *NPME=", "(?<==)(.*)", npme),
Expand All @@ -430,15 +430,15 @@ def write_script(template):
template,
[
("^ *DEFFNM=", "(?<==)(.*)", deffnm),
("^#.*(-N|job_name)", "((?<=-N\s)|(?<=job_name\s))\s*\w+", jobname),
("^#.*(-N|job_name)", r"((?<=-N\s)|(?<=job_name\s))\s*\w+", jobname),
orbeckst marked this conversation as resolved.
Show resolved Hide resolved
(
"^#.*(-A|account_no)",
"((?<=-A\s)|(?<=account_no\s))\s*\w+",
r"((?<=-A\s)|(?<=account_no\s))\s*\w+",
budget,
),
(
"^#.*(-l walltime|wall_clock_limit)",
"(?<==)(\d+:\d+:\d+)",
r"(?<==)(\d+:\d+:\d+)",
walltime,
),
("^ *WALL_HOURS=", "(?<==)(.*)", wall_hours),
Expand Down
Loading