From 39de82de7c7e270e4093f5852b34de90d7cd760a Mon Sep 17 00:00:00 2001 From: Ardavan Oskooi Date: Thu, 13 Jan 2022 03:54:23 +0000 Subject: [PATCH 1/2] specify default no subpixel smoothing for --- doc/docs/Python_User_Interface.md | 2 +- python/geom.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/docs/Python_User_Interface.md b/doc/docs/Python_User_Interface.md index baafa81ae..73869cf75 100644 --- a/doc/docs/Python_User_Interface.md +++ b/doc/docs/Python_User_Interface.md @@ -4414,7 +4414,7 @@ def __init__(self, medium2, weights=None, grid_type='U_DEFAULT', - do_averaging=True, + do_averaging=False, beta=0, eta=0.5, damping=0): diff --git a/python/geom.py b/python/geom.py index 465878dc2..e115916ae 100755 --- a/python/geom.py +++ b/python/geom.py @@ -541,7 +541,7 @@ def __init__(self, medium2, weights=None, grid_type="U_DEFAULT", - do_averaging=True, + do_averaging=False, beta=0, eta=0.5, damping=0): From 623a2d4c6138764ad768e37ee20da76d33f295c7 Mon Sep 17 00:00:00 2001 From: Ardavan Oskooi Date: Thu, 13 Jan 2022 05:46:54 +0000 Subject: [PATCH 2/2] slightly increase tolerance for single precision of two unit tests --- python/tests/test_adjoint_solver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tests/test_adjoint_solver.py b/python/tests/test_adjoint_solver.py index 5c2526fec..a02efc21b 100644 --- a/python/tests/test_adjoint_solver.py +++ b/python/tests/test_adjoint_solver.py @@ -381,7 +381,7 @@ def test_adjoint_solver_DFT_fields(self): adj_scale = (dp[None,:]@adjsol_grad).flatten() fd_grad = Ez2_perturbed-Ez2_unperturbed print("Directional derivative -- adjoint solver: {}, FD: {}".format(adj_scale,fd_grad)) - tol = 0.04 if mp.is_single_precision() else 0.006 + tol = 0.07 if mp.is_single_precision() else 0.006 self.assertClose(adj_scale,fd_grad,epsilon=tol) @@ -477,7 +477,7 @@ def test_complex_fields(self): adj_scale = (dp[None,:]@adjsol_grad).flatten() fd_grad = Ez2_perturbed-Ez2_unperturbed print("Directional derivative -- adjoint solver: {}, FD: {}".format(adj_scale,fd_grad)) - tol = 0.012 if mp.is_single_precision() else 0.002 + tol = 0.018 if mp.is_single_precision() else 0.002 self.assertClose(adj_scale,fd_grad,epsilon=tol) def test_damping(self):