Skip to content

Commit 44cdaca

Browse files
committed
fix(falsecolor): Add odim option
1 parent aeea0db commit 44cdaca

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

honeybee_radiance_command/options/falsecolor.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
NumericOption,
77
StringOption,
88
IntegerOption,
9-
FileOption
9+
FileOption,
10+
TupleOption
1011
)
1112

1213

@@ -31,7 +32,8 @@ class FalsecolorOptions(OptionCollection):
3132
"_e",
3233
"_r",
3334
"_g",
34-
"_b"
35+
"_b",
36+
"_odim"
3537
)
3638

3739
def __init__(self):
@@ -56,6 +58,10 @@ def __init__(self):
5658
self._r = StringOption("r", "Red channel mapping (expression of 'v')")
5759
self._g = StringOption("g", "Green channel mapping (expression of 'v')")
5860
self._b = StringOption("b", "Blue channel mapping (expression of 'v')")
61+
self._odim = TupleOption(
62+
"odim", "X and Y grid dimensions for value overlay", length=2,
63+
numtype=int
64+
)
5965
self._on_setattr_check = True
6066

6167
def _on_setattr(self):
@@ -258,3 +264,15 @@ def b(self):
258264
@b.setter
259265
def b(self, value):
260266
self._b.value = value
267+
268+
@property
269+
def odim(self):
270+
""""X and Y grid dimensions for value overlay.
271+
272+
The expression must be a tuple with two integer values.
273+
"""
274+
return self._odim
275+
276+
@odim.setter
277+
def odim(self, value):
278+
self._odim.value = value

tests/falsecolor_test.py

+10
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,13 @@ def test_validation():
5050
falsecolor.to_radiance()
5151
falsecolor.input = 'image.hdr'
5252
assert falsecolor.to_radiance() == 'falsecolor -i image.hdr'
53+
54+
55+
def test_odim():
56+
"""Test odim option."""
57+
falsecolor = Falsecolor()
58+
59+
falsecolor.input = 'image.hdr'
60+
falsecolor.output = 'image_odim.hdr'
61+
falsecolor.options.odim = (5, 5)
62+
assert falsecolor.to_radiance() == 'falsecolor -odim 5 5 -i image.hdr > image_odim.hdr'

0 commit comments

Comments
 (0)