Skip to content

Commit

Permalink
Now collect parameters in 2 and 3 dimensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmurasko committed Nov 8, 2022
1 parent 3b9e958 commit 7adcbed
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

def getParam(name, comment):
try:
param=re.search(r"(?<="+name+"=)\d+",comment).group()
return param
param=re.findall(r"(?<="+name+"=)\d+",comment)
return " ".join(param)
except:
print("Could not find "+name)
return -1
Expand Down Expand Up @@ -491,7 +491,7 @@ def main(argv):
if(appendtofile):
with open(filename, "a") as myfile:
myfile.write(comment)
if hybrid and dimension == 1:
if hybrid:
with open(optFile,"a") as logfile:
logfile.write("#\n"+comment)
else:
Expand All @@ -501,10 +501,18 @@ def main(argv):
else:
with open(filename, "w") as myfile:
myfile.write(comment)
if hybrid and dimension == 1:
if hybrid:
with open(optFile,"w") as logfile:
logfile.write("# Optimal values for "+p+"\n")
logfile.write("# L M m p q C S D I"+"\n")
if dimension == 1:
logfile.write("# L M m p q C S D I\n")
if dimension == 2:
logfile.write("# L M mx my px py qx qy Cx Cy Sx\
Sy Dx Dy Ix Iy\n")
if dimension == 3:
logfile.write("# L M mx my mz px py pz qx qy\
qz Cx Cy Cz Sx Sy Sz Dx Dy Dz\
Ix Iy Iz\n")
logfile.write("#\n"+comment)

for i in range(a,b+1,1 if I == 0 else I):
Expand Down Expand Up @@ -573,9 +581,10 @@ def main(argv):
logfile.write(err.decode())

if (prc == 0): # did the process succeed?
if hybrid and dimension == 1:
if hybrid:
comment = out.decode()
params=collectParams(comment,L,M)
print(params)
with open(optFile, "a") as logfile:
logfile.write(params+"\n")

Expand Down

0 comments on commit 7adcbed

Please sign in to comment.