From 1e4368754dee9576d87e2255125773e5cd6269a6 Mon Sep 17 00:00:00 2001 From: Ardavan Oskooi Date: Tue, 21 Dec 2021 09:40:02 -0800 Subject: [PATCH] add missing fixed field phase to MPB unit test (#1860) --- python/tests/test_mpb.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/python/tests/test_mpb.py b/python/tests/test_mpb.py index 367e15675..ef6e3a4c4 100644 --- a/python/tests/test_mpb.py +++ b/python/tests/test_mpb.py @@ -408,6 +408,7 @@ def test_output_field_to_file(self): def test_compute_field_energy(self): ms = self.init_solver() ms.run_te() + mpb.fix_hfield_phase(ms, 8) ms.get_dfield(8) field_pt = ms.get_field_point(mp.Vector3(0.5, 0.5)) bloch_field_pt = ms.get_bloch_field_point(mp.Vector3(0.5, 0.5)) @@ -701,8 +702,10 @@ def test_diamond(self): def get_dpwr(ms, band): dpwr.append(ms.get_dpwr(band)) - ms.run(mpb.output_at_kpoint(mp.Vector3(0, 0.625, 0.375), mpb.fix_dfield_phase, - mpb.output_dpwr, get_dpwr)) + ms.run(mpb.output_at_kpoint(mp.Vector3(0, 0.625, 0.375), + mpb.fix_dfield_phase, + mpb.output_dpwr, + get_dpwr)) expected_brd = [ ((0.0, mp.Vector3(0.0, 0.0, 0.0)), @@ -812,7 +815,8 @@ def test_line_defect(self): ms.tolerance = 1e-12 ms.run_tm(mpb.output_at_kpoint(k_points[len(k_points) // 2]), - mpb.fix_efield_phase, mpb.output_efield_z) + mpb.fix_efield_phase, + mpb.output_efield_z) ref_fn = 'line-defect-e.k04.b12.z.tm.h5' ref_path = os.path.join(self.data_dir, ref_fn) @@ -973,8 +977,9 @@ def test_tri_rods(self): ms.tolerance = 1e-12 ms.filename_prefix = self.filename_prefix - ms.run_tm(mpb.output_at_kpoint(mp.Vector3(1 / -3, 1 / 3), mpb.fix_efield_phase, - mpb.output_efield_z)) + ms.run_tm(mpb.output_at_kpoint(mp.Vector3(1 / -3, 1 / 3), + mpb.fix_efield_phase, + mpb.output_efield_z)) ref_fn = 'tri-rods-e.k11.b08.z.tm.h5' ref_path = os.path.join(self.data_dir, ref_fn)