Skip to content
Open
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
8 changes: 4 additions & 4 deletions wdl/wavgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ def loadWDL(infile, outfile="/dev/null", verbose=1):
Parameters.update({pname: pval})
continue
# look for constants
match = re.search("^constant\s+(\w+)=(\d+)\s*$", line)
match = re.search(r"^constant\s+(\w+)\s*=\s*([+-]?\d+(?:\.\d*)?)\s*$", line)
if match is not None:
cname = match.group(1)
cval = int(match.group(2))
cval = float(match.group(2))
Constants.update({cname: cval})
continue
# look for a label
Expand Down Expand Up @@ -1403,7 +1403,7 @@ def script(outfile=None, quiet=False):
if len(Constants) > 0:
outfilehandle.write("[CONSTANT#]\n")
for const in Constants:
outfilehandle.write("%s=%d\n" % (const, Constants[const]))
outfilehandle.write("%s=%f\n" % (const, Constants[const]))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is what you were missing.

Copy link
Contributor

Choose a reason for hiding this comment

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

any reason this can't be an f-string?

outfilehandle.write("[LINE#]\n")
if outfilehandle.name != "<stdout>":
outfilehandle.close()
Expand Down Expand Up @@ -1449,4 +1449,4 @@ def wplot(TimingObjectLabel):

Catalog[__index_of__(TimingObjectLabel)].plot()

return
return
Loading
Loading