-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: fix two bugs in yt.visualization.eps_writer where
- a call to get_cmap was syntaxically erroneous - filename argument didn't accept Path objects
- Loading branch information
1 parent
bff9354
commit 5511de2
Showing
4 changed files
with
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import yt | ||
from yt.testing import fake_amr_ds, requires_module_pytest | ||
|
||
|
||
@requires_module_pytest("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 |