Skip to content

Commit 076b0ff

Browse files
authored
Merge pull request #48 from cadenmyers13/stylesheets
chore: update stylesheets and remove posix
2 parents bf99045 + 9482d08 commit 076b0ff

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
lines changed

docs/examples/ch03NiModelling/exercises/diffpy-cmi/fitBulkNi.ipynb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
"import matplotlib as mpl\n",
3434
"import matplotlib.pyplot as plt\n",
3535
"import numpy as np\n",
36-
"from scipy.optimize import least_squares"
36+
"from scipy.optimize import least_squares\n",
37+
"from bg_mpl_stylesheets.styles import all_styles\n",
38+
"\n",
39+
"plt.style.use(all_styles['bg-style'])"
3740
]
3841
},
3942
{
@@ -470,12 +473,6 @@
470473
" # Calculate the residual (difference) array and offset it vertically.\n",
471474
" diff = g - gcalc + diffzero\n",
472475
"\n",
473-
" # Change some style details of the plot\n",
474-
" mpl.rcParams.update(mpl.rcParamsDefault)\n",
475-
" if (PWD.parent.parent.parent / \"utils\" / \"billinge.mplstyle\").exists():\n",
476-
" plt.style.use(str(PWD.parent.parent.parent /\n",
477-
" \"utils\" / \"billinge.mplstyle\"))\n",
478-
"\n",
479476
" # Create a figure and an axis on which to plot\n",
480477
" fig, ax1 = plt.subplots(1, 1)\n",
481478
"\n",
@@ -673,7 +670,7 @@
673670
],
674671
"metadata": {
675672
"kernelspec": {
676-
"display_name": "Python 3",
673+
"display_name": "cmi",
677674
"language": "python",
678675
"name": "python3"
679676
},
@@ -687,7 +684,7 @@
687684
"name": "python",
688685
"nbconvert_exporter": "python",
689686
"pygments_lexer": "ipython3",
690-
"version": "3.6.4"
687+
"version": "3.13.5"
691688
}
692689
},
693690
"nbformat": 4,

docs/examples/ch03NiModelling/exercises/diffpy-cmi/fitNPPt.ipynb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
"import matplotlib as mpl\n",
2828
"import matplotlib.pyplot as plt\n",
2929
"import numpy as np\n",
30-
"from scipy.optimize import least_squares"
30+
"from scipy.optimize import least_squares\n",
31+
"from bg_mpl_stylesheets.styles import all_styles\n",
32+
"\n",
33+
"plt.style.use(all_styles['bg-style'])"
3134
]
3235
},
3336
{
@@ -386,12 +389,6 @@
386389
" # Calculate the residual (difference) array and offset it vertically.\n",
387390
" diff = g - gcalc + diffzero\n",
388391
"\n",
389-
" # Change some style details of the plot\n",
390-
" mpl.rcParams.update(mpl.rcParamsDefault)\n",
391-
" if (PWD.parent.parent.parent / \"utils\" / \"billinge.mplstyle\").exists():\n",
392-
" plt.style.use(str(PWD.parent.parent.parent /\n",
393-
" \"utils\" / \"billinge.mplstyle\"))\n",
394-
"\n",
395392
" # Create a figure and an axis on which to plot\n",
396393
" fig, ax1 = plt.subplots(1, 1)\n",
397394
"\n",

news/stylesheets.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Add BG stylesheets for plotting.
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

tests/test_examples.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def test_all_examples(tmp_examples):
77
# sort list so that fitBulkNi.py runs first
88
scripts.sort(key=lambda s: 0 if s.name == "fitBulkNi.py" else 1)
99
for script in scripts:
10-
script_relative_path = script.relative_to(tmp_examples).as_posix()
11-
print("hello", script_relative_path)
10+
script_relative_path = script.relative_to(tmp_examples)
1211
print(f"Testing {script_relative_path}")
1312
runpy.run_path(str(script), run_name="__main__")

0 commit comments

Comments
 (0)