Skip to content

Commit 344bdb1

Browse files
authored
Simplify two colorbar tests and remove all others (#2981)
1 parent 0c8f61b commit 344bdb1

8 files changed

+12
-67
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: b274fb18c46c404e79dc293af9529567
3+
size: 2652
4+
hash: md5
5+
path: test_colorbar.png

pygmt/tests/baseline/test_colorbar_box.png.dvc

Lines changed: 0 additions & 4 deletions
This file was deleted.

pygmt/tests/baseline/test_colorbar_box_with_fill.png.dvc

Lines changed: 0 additions & 4 deletions
This file was deleted.

pygmt/tests/baseline/test_colorbar_scaled_z_values.png.dvc

Lines changed: 0 additions & 4 deletions
This file was deleted.

pygmt/tests/baseline/test_colorbar_shading_boolean.png.dvc

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
outs:
2-
- md5: 823a04eb5398f1b101cb7ebc4af006f1
3-
size: 56049
2+
- md5: 52364ac84db033b53f7125ce12e95cce
3+
size: 25000
44
path: test_colorbar_shading_list.png
5+
hash: md5

pygmt/tests/baseline/test_colorbar_truncated_to_zlow_zhigh.png.dvc

Lines changed: 0 additions & 4 deletions
This file was deleted.

pygmt/tests/test_colorbar.py

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,12 @@
77

88
@pytest.mark.benchmark
99
@pytest.mark.mpl_image_compare
10-
def test_colorbar_box():
10+
def test_colorbar():
1111
"""
12-
Create colorbar with box around it.
12+
Create a simple colorbar.
1313
"""
1414
fig = Figure()
15-
fig.colorbar(cmap="rainbow", box=True, position="x0c/0c+w1c/0.5c")
16-
return fig
17-
18-
19-
@pytest.mark.mpl_image_compare
20-
def test_colorbar_box_with_fill():
21-
"""
22-
Create colorbar with box that has a different colored fill.
23-
"""
24-
fig = Figure()
25-
fig.colorbar(cmap="rainbow", box="+gorange", position="x0c/0c+w1c/0.5c")
26-
return fig
27-
28-
29-
@pytest.mark.mpl_image_compare
30-
def test_colorbar_truncated_to_zlow_zhigh():
31-
"""
32-
Create colorbar truncated to z-low and z-high.
33-
"""
34-
fig = Figure()
35-
fig.colorbar(cmap="rainbow", truncate=[0.15, 0.85], position="x0c/0c+w2c/0.5c")
36-
return fig
37-
38-
39-
@pytest.mark.mpl_image_compare
40-
def test_colorbar_scaled_z_values():
41-
"""
42-
Create colorbar with z-values scaled to 0.1x of the original CPT.
43-
"""
44-
fig = Figure()
45-
fig.colorbar(cmap="rainbow", scale=0.1, position="x0c/0c+w2c/0.5c")
46-
return fig
47-
48-
49-
@pytest.mark.mpl_image_compare
50-
def test_colorbar_shading_boolean():
51-
"""
52-
Create colorbar and set shading with a Boolean value.
53-
"""
54-
fig = Figure()
55-
fig.basemap(region=[0, 10, 0, 10], projection="X15c", frame="a")
56-
fig.colorbar(cmap="geo", shading=True, frame=True)
15+
fig.colorbar(cmap="rainbow", position="x0c/0c+w4c", frame=True)
5716
return fig
5817

5918

@@ -63,6 +22,6 @@ def test_colorbar_shading_list():
6322
Create colorbar and set shading by passing the high/low values as a list.
6423
"""
6524
fig = Figure()
66-
fig.basemap(region=[0, 10, 0, 10], projection="X15c", frame="a")
25+
fig.basemap(region=[0, 10, 0, 2], projection="X10c/2c", frame="a")
6726
fig.colorbar(cmap="geo", shading=[-0.7, 0.2], frame=True)
6827
return fig

0 commit comments

Comments
 (0)