forked from ma-bio21/pyms
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to regenerate and sort pytest-mpl baselines.
- Loading branch information
1 parent
d20f2d8
commit 8027508
Showing
2 changed files
with
47 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
tox -e py36 -- --mpl-generate-path=tests/baseline | ||
|
||
tox -e py36 -- --mpl-generate-hash-library=image_hashes_36.json | ||
tox -e py37 -- --mpl-generate-hash-library=image_hashes_37.json | ||
tox -e py38 -- --mpl-generate-hash-library=image_hashes_38.json | ||
tox -e py39 -- --mpl-generate-hash-library=image_hashes.json | ||
|
||
python3 sort_hashes_json.py |
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,37 @@ | ||
# stdlib | ||
import json | ||
|
||
expected_order = [ | ||
"tests.test_Display.test_plot_mass_spec_width", | ||
"tests.test_Display.test_plot_ic", | ||
"tests.test_Display.test_plot_tic", | ||
"tests.test_Display.test_plot_ic_title", | ||
"tests.test_Display.test_plot_ic_linestyle", | ||
"tests.test_Display.test_plot_tic_linewidth", | ||
"tests.test_Display.test_plot_mass_spec", | ||
"tests.test_Display.test_plot_ic_multiple", | ||
"tests.test_Display.test_plot_mass_spec_alpha", | ||
"tests.test_Display.test_plot_tic_alpha", | ||
"tests.test_Display.test_plot_tic_title", | ||
"tests.test_Display.test_plot_tic_linestyle", | ||
"tests.test_Display.test_plot_mass_spec_linestyle", | ||
"tests.test_Display.test_plot_ic_label", | ||
"tests.test_Display.test_plot_tic_label", | ||
"tests.test_Display.test_plot_ic_alpha", | ||
"tests.test_Display.test_plot_ic_linewidth", | ||
"tests.test_Display.test_plot_mass_spec_title", | ||
] | ||
|
||
for filename in [ | ||
"tests/image_hashes_36.json", | ||
"tests/image_hashes_37.json", | ||
"tests/image_hashes_38.json", | ||
"tests/image_hashes.json", | ||
]: | ||
with open(filename, encoding="UTF-8") as fp: | ||
data = list(json.load(fp).items()) | ||
|
||
data.sort(key=lambda x: expected_order.index(x[0])) | ||
with open(filename, 'w', encoding="UTF-8") as fp: | ||
json.dump(dict(data), fp, indent=2) | ||
fp.write('\n') |