Skip to content

Commit

Permalink
tolerance fixes/hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mathematicalmichael committed Mar 23, 2021
1 parent 24f3d23 commit 9690439
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mud_examples/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def plot_experiment_equipment(tolerances, res, prefix, fsize=32, linewidth=5,
plt.yscale('log')
plt.xscale('log')
plt.Axes.set_aspect(plt.gca(), 1)
plt.ylim(2E-3, 2E-2)
# plt.ylim(2E-3, 2E-2)
# plt.ylabel("Absolute Error", fontsize=fsize)
plt.xlabel('Tolerance', fontsize=fsize)
plt.legend()
Expand All @@ -116,7 +116,7 @@ def plot_experiment_equipment(tolerances, res, prefix, fsize=32, linewidth=5,
plt.scatter(tolerances, sd_vars, marker='x', lw=20)
plt.xscale('log')
plt.yscale('log')
plt.ylim(2E-5, 2E-4)
# plt.ylim(2E-5, 2E-4)
plt.Axes.set_aspect(plt.gca(), 1)
# plt.ylabel("Absolute Error", fontsize=fsize)
plt.xlabel('Tolerance', fontsize=fsize)
Expand Down
7 changes: 4 additions & 3 deletions src/mud_examples/pde.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,10 @@ def main_pde(
if input_dim > 1:
if example == 'mud':
P.plot_initial()
for m in measurements:
P.plot_solutions(solutions, m, example=example)
# P.plot_solutions(solutions, 100, example=example, save=True)
if len(measurements) > 1: # FIXME: make plots reflect level of std.
for m in measurements:
P.plot_solutions(solutions, m, example=example) # assumes keys = num_measurements. broken for tolerance comparison.
# P.plot_solutions(solutions, 100, example=example, save=True)
return res


Expand Down
2 changes: 1 addition & 1 deletion src/mud_examples/poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def plot(self, sols=None, num_measurements=20, example='mud', fsize=36, ftype='p

if sols is not None:
if sols.get(num_measurements, None) is None:
raise AttributeError(f"Solutions `sols` missing requested N={num_measurements}.")
raise AttributeError(f"Solutions `sols` missing requested N={num_measurements}. `sols`={sols!r}")
else:
prefix = f'{fname}/{example}_solutions_N{num_measurements}'
plot_lam = np.array(sols[num_measurements])
Expand Down

0 comments on commit 9690439

Please sign in to comment.