def test_sphere_callback(): with _cleanup_fname() as prefix: ax = "z" vector = [1.0, 1.0, 1.0] ds = fake_amr_ds(fields=("density",), units=("g/cm**3",)) p = ProjectionPlot(ds, ax, ("gas", "density")) p.annotate_sphere([0.5, 0.5, 0.5], 0.1) assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, ("gas", "density")) p.annotate_sphere([0.5, 0.5, 0.5], 0.1) assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, ("gas", "density")) p.annotate_sphere([0.5, 0.5, 0.5], 0.1) assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", ("gas", "density")) p.annotate_sphere([0.5, 0.5], 0.1, coord_system="axis", text="blah") p.save(prefix) with _cleanup_fname() as prefix: ds = fake_amr_ds(fields=("density",), units=("g/cm**3",), geometry="spherical") p = ProjectionPlot(ds, "r", ("gas", "density")) assert_raises( YTDataTypeUnsupported, p.annotate_sphere, [0.5, 0.5, 0.5], 0.1, ) p.annotate_sphere([0.5, 0.5], 0.1, coord_system="axis", text="blah") assert_fname(p.save(prefix)[0])
def test_sphere_callback(): with _cleanup_fname() as prefix: ax = 'z' vector = [1.0, 1.0, 1.0] ds = fake_amr_ds(fields=("density", )) p = ProjectionPlot(ds, ax, "density") p.annotate_sphere([0.5, 0.5, 0.5], 0.1) yield assert_fname, p.save(prefix)[0] p = SlicePlot(ds, ax, "density") p.annotate_sphere([0.5, 0.5, 0.5], 0.1) yield assert_fname, p.save(prefix)[0] p = OffAxisSlicePlot(ds, vector, "density") p.annotate_sphere([0.5, 0.5, 0.5], 0.1) yield assert_fname, p.save(prefix)[0] # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_sphere([0.5, 0.5], 0.1, coord_system='axis', text='blah') p.save(prefix)
def test_sphere_callback(): with _cleanup_fname() as prefix: ax = 'z' vector = [1.0,1.0,1.0] ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) yield assert_fname, p.save(prefix)[0] p = SlicePlot(ds, ax, "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) yield assert_fname, p.save(prefix)[0] p = OffAxisSlicePlot(ds, vector, "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) yield assert_fname, p.save(prefix)[0] # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_sphere([0.5,0.5], 0.1, coord_system='axis', text='blah') p.save(prefix)