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 all 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
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ year of their first commit. GitHub handle is optional.
----

- Jinzhe Zeng (@njzjz)

2024
----

- Friedrich Haubensak (@hsk17)

We gratefully acknowledge code fixes contributed by
@quantifiedcode-bot from Quantified Code https://www.quantifiedcode.com
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==============================

2024-??-?? 0.9.1
orbeckst
orbeckst, hsk17

* templates in `config.templates` are now stored as
`importlib.resources.abc.Traversable` (PosixPath-like) objects instead of
Expand Down
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 @@ class MDP(odict, utilities.FileUtils):
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
# see regex in cbook.edit_mdp()
PARAMETER = re.compile(
r"""
Expand Down
16 changes: 10 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,19 @@ 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,
),
(
"^#.*(-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