fixed generation of results folder

This commit is contained in:
2026-05-12 23:40:32 +02:00
parent 005b69cec4
commit c3138ae776
2 changed files with 8 additions and 4 deletions
+4
View File
@@ -38,6 +38,10 @@
"\n",
"mp.verbosity(1)\n",
"\n",
"#setup a results folder\n",
"if not os.path.exists(\"results\"):\n",
" os.makedirs(\"results\")\n",
"\n",
"subs_index = 3.4\n",
"subs_perm = subs_index**2\n",
"\n",
+4 -4
View File
@@ -17,6 +17,10 @@ import os
mp.verbosity(1)
#setup a results folder
if not os.path.exists("results"):
os.makedirs("results")
subs_index = 3.4
subs_perm = subs_index**2
@@ -267,9 +271,6 @@ def f(v, gradient, cur_beta):
circ2 = Circle((2,2), minimum_length/2)
ax2.add_patch(circ2)
if not os.path.exists("results"):
os.makedirs("results")
plt.savefig("results/iter_{}.pdf".format(cur_iter[0]+1))
cur_iter[0] += cur_iter[0] + 1
@@ -308,7 +309,6 @@ if optimization_start:
cur_beta = cur_beta * beta_scale #update beta
print("current beta: ", cur_beta)
######RESULTS######
#plot the figure of merit over iterations
plt.figure()