-
Notifications
You must be signed in to change notification settings - Fork 5
test: Run tutorials in tests #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
c58bb59
7cb8a66
86d91e8
c8883e8
199630b
b40a87f
c7b94c4
9490394
e3d5cff
5a1091a
ba6825a
eb8cab3
b77fb30
9b7c4c2
b8822b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -447,10 +447,6 @@ def plot_results(recipe, fig_name): | |
|
|
||
| # Change some style details of the plot | ||
| mpl.rcParams.update(mpl.rcParamsDefault) | ||
| if (PWD.parent.parent.parent / "utils" / "billinge.mplstyle").exists(): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is the group style added back in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbillinge I will have to add it to each file I think, I can do this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better on another PR, but can we also do this work on the examples scripts also? Not just the solutions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbillinge Yeah I can do this. Do you want me to revert back then? |
||
| plt.style.use( | ||
| str(PWD.parent.parent.parent / "utils" / "billinge.mplstyle") | ||
| ) | ||
|
|
||
| # Create a figure and an axis on which to plot | ||
| fig, ax1 = plt.subplots(1, 1) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * Add tests that run PDF example scripts | ||
|
|
||
| **Changed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ pytest-env | |
| pytest-mock | ||
| freezegun | ||
| DeepDiff | ||
| psutil | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import runpy | ||
|
|
||
|
|
||
| def test_all_examples(tmp_examples): | ||
| scripts = list(tmp_examples.rglob("**/solutions/diffpy-cmi/*.py")) | ||
| for script_path in scripts: | ||
| print(f"Testing {script_path.relative_to(tmp_examples)}") | ||
| runpy.run_path(str(script_path), run_name="__main__") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If user doesn't run the bulkNi script, the Qdamp and Qbroad values will be defined here. This is also needed to run tests (for now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's see if we can fix this properly and not this ugly workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbillinge To handle this, I had to add special handling for this script. I've pushed said special handling. Let me know if that looks okay.