Skip to content

Commit aeec2aa

Browse files
committed
Uncap matplotlib and regenerate baseline image hashes.
1 parent 7f21265 commit aeec2aa

7 files changed

Lines changed: 130 additions & 24 deletions

File tree

regen_mpl_baseline.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
tox -e py37 -- --mpl-generate-path=tests/baseline
4+
5+
tox -e py37 -- --mpl-generate-hash-library=tests/image_hashes_37.json
6+
tox -e py38 -- --mpl-generate-hash-library=tests/image_hashes_38.json
7+
tox -e py39 -- --mpl-generate-hash-library=tests/image_hashes.json
8+
# tox -e py313 -- --mpl-generate-hash-library=image_hashes_313.json
9+
10+
python3 sort_hashes_json.py

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
matplotlib<3.6.0,>=3.2.2
1+
matplotlib>=3.2.2
22
pymassspec>=2.3.0

sort_hashes_json.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# stdlib
2+
import json
3+
4+
expected_order = [
5+
"tests.test_plot.test_plot_mass_spec_linestyle",
6+
"tests.test_plot.test_plot_mass_spec_alpha",
7+
"tests.test_plot.test_plot_tic",
8+
"tests.test_plot.test_plot_ic_linewidth",
9+
"tests.test_plot.test_plot_tic_label",
10+
"tests.test_plot.test_plot_tic_linestyle",
11+
"tests.test_plot.test_plot_ic_multiple",
12+
"tests.test_plot.test_plot_head2tail",
13+
"tests.test_plot.test_plot_tic_title",
14+
"tests.test_plot.test_plot_ic_title",
15+
"tests.test_plot.test_plot_tic_linewidth",
16+
"tests.test_plot.test_plot_mass_spec_width",
17+
"tests.test_plot.test_plot_peaks_errors",
18+
"tests.test_plot.test_plot_ic_linestyle",
19+
"tests.test_plot.test_plot_ic_alpha",
20+
"tests.test_plot.test_plot_ic",
21+
"tests.test_plot.test_plot_peaks_with_tic",
22+
"tests.test_plot.test_plot_tic_alpha",
23+
"tests.test_plot.test_plot_ic_minutes",
24+
"tests.test_plot.test_plot_mass_spec",
25+
"tests.test_plot.test_plot_mass_spec_title",
26+
"tests.test_plot.test_plot_ic_label",
27+
]
28+
29+
for filename in [
30+
"tests/image_hashes_37.json",
31+
"tests/image_hashes_38.json", # "tests/image_hashes_313.json",
32+
"tests/image_hashes.json",
33+
]:
34+
with open(filename, encoding="UTF-8") as fp:
35+
data = list(json.load(fp).items())
36+
37+
data.sort(key=lambda x: expected_order.index(x[0]))
38+
with open(filename, 'w', encoding="UTF-8") as fp:
39+
json.dump(dict(data), fp, indent=2)
40+
fp.write('\n')

tests/image_hashes.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"tests.test_plot.test_plot_mass_spec_linestyle": "78cb3e8166e81faf4b428a4a077fb1cec8c017506d599192f1061013e3c64be9",
3-
"tests.test_plot.test_plot_mass_spec_alpha": "f437422a43c7d7ae731c0a172759c9981163a5239d3e19813219d4baa86f1ca9",
4-
"tests.test_plot.test_plot_tic": "44eeae0bfc8ba2343203e48f6754143c8e560bff8598e6f658a201384066cd7e",
5-
"tests.test_plot.test_plot_ic_linewidth": "daca3e46ee11f875f92f82fb2780474f14e36514991f7982c816813c73c48422",
6-
"tests.test_plot.test_plot_tic_label": "17c1e76008e275baae6f0f9d43d3100355760d9ff354effb05e174bd55d45b57",
7-
"tests.test_plot.test_plot_tic_linestyle": "fcb3853db63b752784722ea8e2a30f4b864adc8e1e5615f74f0d66f0a91780e6",
8-
"tests.test_plot.test_plot_ic_multiple": "e0a8d8909b3634293830a3e07fca09156322587aede67d58552760522e8e2546",
9-
"tests.test_plot.test_plot_head2tail": "64cefa9821ca325b3090c9c9639c18af614ba3d85f9ab13c6c4fdae89ed564e0",
10-
"tests.test_plot.test_plot_tic_title": "c08ec71e647fcc7cc128753ad1c709b4a0f10fe8935908ae7c59fde112357ab3",
11-
"tests.test_plot.test_plot_ic_title": "e13eed4b1188caac4ed7583ed9253f3601440afefb6ff790bb89f3d5e1643f8f",
12-
"tests.test_plot.test_plot_tic_linewidth": "0d6504983e2100b6518f627caecdfbcb552c827820c7ed36e297e44ae3ca981f",
13-
"tests.test_plot.test_plot_mass_spec_width": "51541d98cd9fdb2d96e496da89529262837fd79bdc6b7f785a9bd27af5dc0ffd",
14-
"tests.test_plot.test_plot_peaks_errors": "096bc9e1518e797fe5eb85e11f4624dbd9b8fa118688436b754b4b6da878c4a4",
15-
"tests.test_plot.test_plot_ic_linestyle": "1cc4b604654be0eae3ac7e0a4724ce62382e43a2b62b4a3f1f39bd165721d617",
16-
"tests.test_plot.test_plot_ic_alpha": "51e80c1f2daff374c60e7f72f0252c579bce6f0a0e8f2104db91d800032e395a",
17-
"tests.test_plot.test_plot_ic": "ef953474ffb1cde3f2ff299e102bf149a359d2e1d15deea1527fb7154d499222",
18-
"tests.test_plot.test_plot_peaks_with_tic": "45c04fb36d00d6a52de64c83be5a9e0e278b3dc50aa97eba37af3985bfc7a685",
19-
"tests.test_plot.test_plot_tic_alpha": "292ff9006c534b0e4670bc07b74b5fd121dd92ea479c06d6cc3f9a6bd5cf8133",
20-
"tests.test_plot.test_plot_ic_minutes": "f6897d5993df30749f21c86c078777cde6ee52d82568f28f7dd4d6544927963c",
21-
"tests.test_plot.test_plot_mass_spec": "78cb3e8166e81faf4b428a4a077fb1cec8c017506d599192f1061013e3c64be9",
22-
"tests.test_plot.test_plot_mass_spec_title": "9e1d6cfb68b70da0d4625608755e1c3f1cc668754d9a4ca4c166a4ff22729783",
23-
"tests.test_plot.test_plot_ic_label": "99d64801b309ce6c999194b52cbb77627b8ab0986de2802294626e33e09a646e"
2+
"tests.test_plot.test_plot_mass_spec_linestyle": "2bf5adffda83a383b7d5d1b5858fd033be8222fd0fe568eefe975802ded0746a",
3+
"tests.test_plot.test_plot_mass_spec_alpha": "d9fbddaf7a9dd5e0ebeca7563315e81751bceb01486a1db4e8abc385db0ba3d2",
4+
"tests.test_plot.test_plot_tic": "b372d31c64e3291e3832d00a23ce68fadb3ea2d8735700f05ef8057620beec65",
5+
"tests.test_plot.test_plot_ic_linewidth": "64cba184d55f5ad751bf96cbb5f0a45cb95ef7357d5dea7fae6edd9275bc3535",
6+
"tests.test_plot.test_plot_tic_label": "1e14369208b79be937569cec64957923ac57a5c93b947fbd1c641ab851be1361",
7+
"tests.test_plot.test_plot_tic_linestyle": "c3c5e1c95c316dd63565f7369b528c3677500e53b5702cb21eee48f23c22a69a",
8+
"tests.test_plot.test_plot_ic_multiple": "d52028dafe5216324d93eaf762d4700b3ae3cf1d2d0505700b1ae811ee365fdf",
9+
"tests.test_plot.test_plot_head2tail": "f3728581bf8c4a2e2b151e383533a0679639932dbe7ab71b929dd0c03355724e",
10+
"tests.test_plot.test_plot_tic_title": "3dd40a7ae0d71897c464df73294e3492ae98cd767272e18d59a1d8decf307ab6",
11+
"tests.test_plot.test_plot_ic_title": "32cbef0a816574d3fea59b0b7e72ce1420dc0f7c8f05b447b27cc0ae51f9f925",
12+
"tests.test_plot.test_plot_tic_linewidth": "3c4a128807b5c5623b6835ed8acd805e7e7c26e5dfe95019bfc86b866b60b803",
13+
"tests.test_plot.test_plot_mass_spec_width": "81b155b36807638f0897d4f163ae5c3932c365dbf38dfd3cf1267d20e56d4fbb",
14+
"tests.test_plot.test_plot_peaks_errors": "a1bb075d07e386cc9e90be5e2614a01187423ed77ef50550e8c5745cdaed4bd4",
15+
"tests.test_plot.test_plot_ic_linestyle": "f3bde71d804cc0c67a7a6c467bf1aaed7fc193ff51d83025bbc705de07d814ad",
16+
"tests.test_plot.test_plot_ic_alpha": "e56d82b8ef4db63bb55d88d7d2fce1efa9a554f6e0a5dd28fd6ba92977f10399",
17+
"tests.test_plot.test_plot_ic": "86a48e733b0086dc9aa605617b5ebc3aa25642b509deea0294e3c454cb898cd2",
18+
"tests.test_plot.test_plot_peaks_with_tic": "00302994fb9ed825cc2382ad578224e1b4505148062b2ac689c7b2e150ff4cdd",
19+
"tests.test_plot.test_plot_tic_alpha": "21159bc075134ad02121ebfae555810408f760ef1385d946f0360405cc598749",
20+
"tests.test_plot.test_plot_ic_minutes": "0ee4ba15ab80416731eb47d046269a6b3693d95a050559443aba962d055a3f07",
21+
"tests.test_plot.test_plot_mass_spec": "2bf5adffda83a383b7d5d1b5858fd033be8222fd0fe568eefe975802ded0746a",
22+
"tests.test_plot.test_plot_mass_spec_title": "1270421b23d3067a0be39b021546ad827f5b25f908b8097c51e5ede8ab096a5b",
23+
"tests.test_plot.test_plot_ic_label": "9114b8a63fcf1f7b5488e33ad1740628a9c11b7dba07c259949700c9f9f10f97"
2424
}

tests/image_hashes_37.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"tests.test_plot.test_plot_mass_spec_linestyle": "78cb3e8166e81faf4b428a4a077fb1cec8c017506d599192f1061013e3c64be9",
3+
"tests.test_plot.test_plot_mass_spec_alpha": "f437422a43c7d7ae731c0a172759c9981163a5239d3e19813219d4baa86f1ca9",
4+
"tests.test_plot.test_plot_tic": "44eeae0bfc8ba2343203e48f6754143c8e560bff8598e6f658a201384066cd7e",
5+
"tests.test_plot.test_plot_ic_linewidth": "daca3e46ee11f875f92f82fb2780474f14e36514991f7982c816813c73c48422",
6+
"tests.test_plot.test_plot_tic_label": "17c1e76008e275baae6f0f9d43d3100355760d9ff354effb05e174bd55d45b57",
7+
"tests.test_plot.test_plot_tic_linestyle": "fcb3853db63b752784722ea8e2a30f4b864adc8e1e5615f74f0d66f0a91780e6",
8+
"tests.test_plot.test_plot_ic_multiple": "e0a8d8909b3634293830a3e07fca09156322587aede67d58552760522e8e2546",
9+
"tests.test_plot.test_plot_head2tail": "64cefa9821ca325b3090c9c9639c18af614ba3d85f9ab13c6c4fdae89ed564e0",
10+
"tests.test_plot.test_plot_tic_title": "c08ec71e647fcc7cc128753ad1c709b4a0f10fe8935908ae7c59fde112357ab3",
11+
"tests.test_plot.test_plot_ic_title": "e13eed4b1188caac4ed7583ed9253f3601440afefb6ff790bb89f3d5e1643f8f",
12+
"tests.test_plot.test_plot_tic_linewidth": "0d6504983e2100b6518f627caecdfbcb552c827820c7ed36e297e44ae3ca981f",
13+
"tests.test_plot.test_plot_mass_spec_width": "51541d98cd9fdb2d96e496da89529262837fd79bdc6b7f785a9bd27af5dc0ffd",
14+
"tests.test_plot.test_plot_peaks_errors": "096bc9e1518e797fe5eb85e11f4624dbd9b8fa118688436b754b4b6da878c4a4",
15+
"tests.test_plot.test_plot_ic_linestyle": "1cc4b604654be0eae3ac7e0a4724ce62382e43a2b62b4a3f1f39bd165721d617",
16+
"tests.test_plot.test_plot_ic_alpha": "51e80c1f2daff374c60e7f72f0252c579bce6f0a0e8f2104db91d800032e395a",
17+
"tests.test_plot.test_plot_ic": "ef953474ffb1cde3f2ff299e102bf149a359d2e1d15deea1527fb7154d499222",
18+
"tests.test_plot.test_plot_peaks_with_tic": "45c04fb36d00d6a52de64c83be5a9e0e278b3dc50aa97eba37af3985bfc7a685",
19+
"tests.test_plot.test_plot_tic_alpha": "292ff9006c534b0e4670bc07b74b5fd121dd92ea479c06d6cc3f9a6bd5cf8133",
20+
"tests.test_plot.test_plot_ic_minutes": "f6897d5993df30749f21c86c078777cde6ee52d82568f28f7dd4d6544927963c",
21+
"tests.test_plot.test_plot_mass_spec": "78cb3e8166e81faf4b428a4a077fb1cec8c017506d599192f1061013e3c64be9",
22+
"tests.test_plot.test_plot_mass_spec_title": "9e1d6cfb68b70da0d4625608755e1c3f1cc668754d9a4ca4c166a4ff22729783",
23+
"tests.test_plot.test_plot_ic_label": "99d64801b309ce6c999194b52cbb77627b8ab0986de2802294626e33e09a646e"
24+
}

tests/image_hashes_38.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"tests.test_plot.test_plot_mass_spec_linestyle": "6bc5c744663c449940d0221e1c309837982c23b235a04972ea40f5b9f381a07b",
3+
"tests.test_plot.test_plot_mass_spec_alpha": "cc3d3e14d132fb06e509233af413efd8f367a44c437fcf39148617701f8bf8bf",
4+
"tests.test_plot.test_plot_tic": "63c4a42a22bc63720b5a70eb92ac8c6e014fc0ab374e9c94747605e2d426124f",
5+
"tests.test_plot.test_plot_ic_linewidth": "e8b5522027dea6f78b770da8678e7117334c5b8e686ff85d48df61697059801a",
6+
"tests.test_plot.test_plot_tic_label": "33a36ca1eeba439e5c420dfa75fe347fd51289c90de9eae0cf2898187826b9cb",
7+
"tests.test_plot.test_plot_tic_linestyle": "bf7fb9198973c16ac60c741666de073afb190db220dd95bb069fe0ec38d4f4a9",
8+
"tests.test_plot.test_plot_ic_multiple": "62087365852adf56fa7d3750df3729e5400863f7ebc9c6289ef74dbfbe4a2a94",
9+
"tests.test_plot.test_plot_head2tail": "00152293962aaae894140ca7d29e4cdfb19b700f31cbad9f7331fa0d1f237576",
10+
"tests.test_plot.test_plot_tic_title": "700f8b12c636894f4fe37561b68ef017f7b6dabbc73fb6ef3a46de5cbb852389",
11+
"tests.test_plot.test_plot_ic_title": "b307748ab851eea99c805c0c5b9257be74ca3f02ca7def932ff3daa65e3ef764",
12+
"tests.test_plot.test_plot_tic_linewidth": "72610cbdb7c0b038eee291494adc6d89991978e05c3c1d7e18174a5ccb1df528",
13+
"tests.test_plot.test_plot_mass_spec_width": "35d04a43b3f59774e3538894e1a70b4f01ace795fee07727a4b7e99c936bce7d",
14+
"tests.test_plot.test_plot_peaks_errors": "ecb0cf7e7f26f240dbb7eae857f5f5a4320865832b2427389c481ce09402ace0",
15+
"tests.test_plot.test_plot_ic_linestyle": "a65129c53487140ed4a63bdcd3198c28f1dead8a6444d8ddbd10ee4827efa73c",
16+
"tests.test_plot.test_plot_ic_alpha": "392e94c623a568bb93a5e8fe49f76cc875195551cdb037169848d628dab9f82e",
17+
"tests.test_plot.test_plot_ic": "cd9d86aa4a79cbc5a461621a3149456dff05c7ef8da9c8c8920ad236eb31de4b",
18+
"tests.test_plot.test_plot_peaks_with_tic": "21f47c3701528a4d8d862d68e80a5f56502e09ea934feecaff42e17f40bc203d",
19+
"tests.test_plot.test_plot_tic_alpha": "775ec69853370ae8ce90d89a5e4a33ba2b737d3227a8ce94ad4e56c328a2aaa2",
20+
"tests.test_plot.test_plot_ic_minutes": "58c0410e358ee70c5aafa65a9f9c63be5c4625dd2de4e9afff373e1dc0b20658",
21+
"tests.test_plot.test_plot_mass_spec": "6bc5c744663c449940d0221e1c309837982c23b235a04972ea40f5b9f381a07b",
22+
"tests.test_plot.test_plot_mass_spec_title": "e236490472ce79bb68cc0b8adb19007c2ad8410c3da32691c86e5b5c1446fb86",
23+
"tests.test_plot.test_plot_ic_label": "c46e4702055290a4e2021a399dadc3335133da224b497c91c949beb8c1c50e08"
24+
}

tests/test_plot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# stdlib
22
import os
3+
import sys
34
from typing import List
45

56
# 3rd party
@@ -23,7 +24,14 @@
2324
baseline_dir = str(PathPlus(__file__).parent / "baseline")
2425
assert os.path.exists(baseline_dir)
2526

26-
image_hashes = str(PathPlus(__file__).parent / "image_hashes.json")
27+
if sys.version_info[:2] == (3, 7):
28+
image_hashes = str(PathPlus(__file__).parent / "image_hashes_37.json")
29+
elif sys.version_info[:2] == (3, 8):
30+
image_hashes = str(PathPlus(__file__).parent / "image_hashes_38.json")
31+
elif sys.version_info >= (3, 13):
32+
image_hashes = str(PathPlus(__file__).parent / "image_hashes_313.json")
33+
else:
34+
image_hashes = str(PathPlus(__file__).parent / "image_hashes.json")
2735

2836
check_images = pytest.mark.mpl_image_compare(
2937
baseline_dir=baseline_dir,

0 commit comments

Comments
 (0)