forked from yt-project/yt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport PR yt-project#3496: BUG: fix two bugs in yt.visualization.ep…
…s_writer
- Loading branch information
1 parent
4bd45bb
commit 3c8ec72
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import yt | ||
from yt.testing import fake_amr_ds, requires_external_executable, requires_module | ||
|
||
|
||
@requires_external_executable("tex") | ||
@requires_module("pyx") | ||
def test_eps_writer(tmp_path): | ||
import yt.visualization.eps_writer as eps | ||
|
||
fields = [ | ||
("gas", "density"), | ||
("gas", "temperature"), | ||
] | ||
units = [ | ||
"g/cm**3", | ||
"K", | ||
] | ||
ds = fake_amr_ds(fields=fields, units=units) | ||
slc = yt.SlicePlot( | ||
ds, | ||
"z", | ||
fields=fields, | ||
) | ||
eps_fig = eps.multiplot_yt(2, 1, slc, bare_axes=True) | ||
eps_fig.scale_line(0.2, "5 cm") | ||
savefile = tmp_path / "multi" | ||
eps_fig.save_fig(savefile, format="eps") | ||
assert savefile.with_suffix(".eps").exists() |