Skip to content

Commit c8883e8

Browse files
committed
change mpl backend and remove old stylesheets
1 parent 86d91e8 commit c8883e8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/examples/ch08NPRefinement/solutions/diffpy-cmi/fitCdSeNP.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,6 @@ def plot_results(recipe, fig_name):
447447

448448
# Change some style details of the plot
449449
mpl.rcParams.update(mpl.rcParamsDefault)
450-
if (PWD.parent.parent.parent / "utils" / "billinge.mplstyle").exists():
451-
plt.style.use(
452-
str(PWD.parent.parent.parent / "utils" / "billinge.mplstyle")
453-
)
454450

455451
# Create a figure and an axis on which to plot
456452
fig, ax1 = plt.subplots(1, 1)

docs/examples/ch11ClusterXYZ/solutions/diffpy-cmi/fitCdSeNP.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ def plot_results(recipe, figname):
199199
diff = g - gcalc + diffzero
200200

201201
mpl.rcParams.update(mpl.rcParamsDefault)
202-
plt.style.use(
203-
str(PWD.parent.parent.parent / "utils" / "billinge.mplstyle")
204-
)
205202

206203
fig, ax1 = plt.subplots(1, 1)
207204

tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import shutil
55
from pathlib import Path
66

7+
import matplotlib
78
import pytest
89

910
PROJECT_ROOT = Path(__file__).resolve().parents[1]
@@ -23,6 +24,12 @@ def tmp_examples(tmp_path_factory):
2324
yield tmp_examples
2425

2526

27+
@pytest.fixture(scope="session", autouse=True)
28+
def use_headless_matplotlib():
29+
"""Force matplotlib to use a headless backend during tests."""
30+
matplotlib.use("Agg")
31+
32+
2633
@pytest.fixture
2734
def user_filesystem(tmp_path):
2835
base_dir = Path(tmp_path)

0 commit comments

Comments
 (0)