Skip to content

Commit 3e0a6d3

Browse files
committed
use new functionality; rename figure and main function
1 parent fe2cbc5 commit 3e0a6d3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cr_bayesian_optim/fractal_dim.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def calculate_fractal_dim_for_pos(
152152
return x, count_boxes, popt, pcov
153153

154154

155-
def fractal_dim_main():
155+
def fractal_dim_comparison():
156156
# Initialize Graph
157157
fig, ax = plt.subplots(figsize=(8, 8))
158158

@@ -161,19 +161,14 @@ def fractal_dim_main():
161161
ymin = np.inf
162162
ymax = -np.inf
163163

164-
options = crb.Options(
165-
show_progressbar=True, storage_location="out/fractal_dim_multi"
166-
)
167-
options.time.t_max = 2000
168-
options.domain.domain_size = 2000
169-
options.time.dt = 0.3
164+
options = produce_options()
170165
diffusion_constants = [80, 5, 0.5]
171166

172167
results = []
173168
for diffusion_constant in diffusion_constants:
174169
options.domain.diffusion_constant = diffusion_constant
175170

176-
cells, out_path = load_or_compute(options)
171+
cells, out_path = load_or_compute_last_iter(options)
177172
last_pos = np.array([c[0].mechanics.pos for c in cells.values()])
178173

179174
x, y, popt, _ = calculate_fractal_dim_for_pos(last_pos, options, out_path)
@@ -245,4 +240,9 @@ def fractal_dim_main():
245240
ax.grid(True, which="minor", linestyle="-", linewidth=0.25, alpha=0.15)
246241
ax.set_axisbelow(True)
247242
fig.tight_layout()
248-
fig.savefig(options.storage_location / "fractal-dimension.pdf")
243+
fig.savefig(options.storage_location / "fractal-dim-box-size-scaling.pdf")
244+
plt.close(fig)
245+
246+
247+
def fractal_dim_main():
248+
fractal_dim_comparison()

0 commit comments

Comments
 (0)