Skip to content

Commit 7753aeb

Browse files
mikkelkpmostaphaRoudsari
authored andcommitted
fix(dcglare): Remove redundant warning
I also added support for piping to rmtxop.
1 parent d296890 commit 7753aeb

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

honeybee_radiance_command/options/dcglare.py

-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ def _on_setattr(self):
5656
if self._vf.is_set and self._vu.is_set:
5757
warnings.warn(
5858
'Both -vf and -vu are set. %s will ignore -vu.' % self.command)
59-
if self._sf.is_set and not self._l.is_set:
60-
warnings.warn(
61-
'-sf is set but -l is not. %s will ignore -sf if -ls is not set.'
62-
% self.command)
6359
if self._ss.is_set and not self._l.is_set:
6460
warnings.warn(
6561
'-ss is set but -l is not. %s will ignore -ss if -ls is not set.'

honeybee_radiance_command/rmtxop.py

+2
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ def to_radiance(self, stdin_input=False):
242242
comes from stdin. This is for instance the case when you pipe the input
243243
from another command (default: False).
244244
"""
245+
if stdin_input:
246+
self.matrices = '-'
245247
self.validate(stdin_input)
246248

247249
command_parts = [self.command, self.options.to_radiance()]

tests/rmtxop_test.py

+9
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,12 @@ def test_input_matrix_limit():
100100
rmtxop.matrices = ['dc1.mtx', 'dc2.mtx', 'dc3.mtx', 'dc4.mtx', 'dc5.mtx']
101101
with pytest.raises(AssertionError):
102102
rmtxop.validate()
103+
104+
105+
def test_stdin_input():
106+
"""Test assignments."""
107+
rmtxop = Rmtxop()
108+
109+
rmtxop.matrices = ['dc.mtx', 'sky.mtx']
110+
rmtxop.transforms = [['47.4', '119.9', '11.6']]
111+
assert rmtxop.to_radiance(stdin_input=True) == 'rmtxop -c 47.4 119.9 11.6 -'

0 commit comments

Comments
 (0)