MCPcopy Create free account
hub / github.com/NanoComp/meep / test_plot2D

Method test_plot2D

python/tests/test_visualization.py:187–213  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

185 mp.delete_directory(cls.temp_dir)
186
187 def test_plot2D(self):
188 # Check plotting of geometry with several sources, monitors, and PMLs
189 f = plt.figure()
190 ax = f.gca()
191 sim = setup_sim()
192 ax = sim.plot2D(ax=ax)
193 if mp.am_master():
194 hash_figure(f)
195 # self.assertAlmostEqual(hash_figure(f),10231488)
196
197 # Check plotting of fields after timestepping
198 f = plt.figure()
199 ax = f.gca()
200 sim.run(until=200)
201 ax = sim.plot2D(ax=ax, fields=mp.Ez)
202 if mp.am_master():
203 hash_figure(f)
204 # self.assertAlmostEqual(hash_figure(f),79786722)
205
206 # Check output_plane feature
207 f = plt.figure()
208 ax = f.gca()
209 vol = mp.Volume(center=mp.Vector3(), size=mp.Vector3(2, 2))
210 ax = sim.plot2D(ax=ax, fields=mp.Ez, output_plane=vol)
211 if mp.am_master():
212 hash_figure(f)
213 # self.assertAlmostEqual(hash_figure(f),68926258)
214
215 @unittest.skipIf(call(["which", "ffmpeg"]) != 0, "ffmpeg is not installed")
216 def test_animation_output(self):

Callers

nothing calls this directly

Calls 4

setup_simFunction · 0.85
hash_figureFunction · 0.85
plot2DMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected