-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow use of noninteractive backend for plot_detector_models. Add test
- Loading branch information
1 parent
4ad0ce5
commit 74dee5f
Showing
3 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
``dxtbx.plot_detector_models``: use noninteractive matpotlib backend if using the pdf_file option |
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,17 @@ | ||
from __future__ import annotations | ||
|
||
import os.path | ||
import shutil | ||
import subprocess | ||
|
||
|
||
def test_plot_models_noninteractive_to_pdf(dials_data, tmp_path): | ||
ssx = dials_data("cunir_serial_processed", pathlib=True) | ||
expts = str(ssx / "imported_no_ref_5.expt") | ||
result = subprocess.run( | ||
[shutil.which("dxtbx.plot_detector_models"), expts, "pdf_file=plot_test.pdf"], | ||
cwd=tmp_path, | ||
capture_output=True, | ||
) | ||
assert not result.returncode and not result.stderr | ||
assert os.path.exists(tmp_path / "plot_test.pdf") |