Skip to content

Commit fb2cf24

Browse files
authored
Merge pull request #525 from opendatacube/for_rel_1.8.3
Update default version number, ready for 1.8.3 tag/release.
2 parents 21a1e1a + d85313e commit fb2cf24

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

datacube_ows/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
try:
22
from ._version import version as __version__
33
except ImportError:
4-
__version__ = "1.8.1+?"
4+
__version__ = "1.8.3+?"

tests/test_styles.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,29 @@ def test_createcolordata_remask():
575575
data = ColorMapStyleDef.create_colordata(da, rgb, 0.0, np.array([True, True, True, True, True, True]))
576576
assert (np.isfinite(data["red"][0:3:1])).all()
577577
assert (np.isnan(data["red"][4:5:1])).all()
578-
579-
580-
581-
582578

579+
def test_scale_ramp():
580+
from datacube_ows.styles.ramp import scale_unscaled_ramp
581+
582+
input = [
583+
{"value": 0.0, "color": "red", "alpha": 0.5},
584+
{"value": 0.5, "color": "green"},
585+
{"value": 1.0, "color": "blue"},
586+
]
587+
output = scale_unscaled_ramp(-100.0, 100.0, input)
588+
assert output[0]["color"] == "red"
589+
assert output[0]["alpha"] == 0.5
590+
assert output[0]["value"] == -100.0
591+
assert output[1]["color"] == "green"
592+
assert output[1]["alpha"] == 1.0
593+
assert output[1]["value"] == 0.0
594+
assert output[2]["color"] == "blue"
595+
assert output[2]["alpha"] == 1.0
596+
assert output[2]["value"] == 100.0
597+
598+
def test_bad_mpl_ramp():
599+
from datacube_ows.styles.ramp import read_mpl_ramp
600+
601+
with pytest.raises(ConfigException) as e:
602+
ramp = read_mpl_ramp("definitely_not_a_real_matplotlib_ramp_name")
603+
assert "Invalid Matplotlib name: " in str(e.value)

0 commit comments

Comments
 (0)