Skip to content

Commit

Permalink
fix(dcglare): Remove redundant warning
Browse files Browse the repository at this point in the history
I also added support for piping to rmtxop.
  • Loading branch information
mikkelkp authored and mostaphaRoudsari committed Mar 10, 2022
1 parent d296890 commit 7753aeb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions honeybee_radiance_command/options/dcglare.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ def _on_setattr(self):
if self._vf.is_set and self._vu.is_set:
warnings.warn(
'Both -vf and -vu are set. %s will ignore -vu.' % self.command)
if self._sf.is_set and not self._l.is_set:
warnings.warn(
'-sf is set but -l is not. %s will ignore -sf if -ls is not set.'
% self.command)
if self._ss.is_set and not self._l.is_set:
warnings.warn(
'-ss is set but -l is not. %s will ignore -ss if -ls is not set.'
Expand Down
2 changes: 2 additions & 0 deletions honeybee_radiance_command/rmtxop.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ def to_radiance(self, stdin_input=False):
comes from stdin. This is for instance the case when you pipe the input
from another command (default: False).
"""
if stdin_input:
self.matrices = '-'
self.validate(stdin_input)

command_parts = [self.command, self.options.to_radiance()]
Expand Down
9 changes: 9 additions & 0 deletions tests/rmtxop_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,12 @@ def test_input_matrix_limit():
rmtxop.matrices = ['dc1.mtx', 'dc2.mtx', 'dc3.mtx', 'dc4.mtx', 'dc5.mtx']
with pytest.raises(AssertionError):
rmtxop.validate()


def test_stdin_input():
"""Test assignments."""
rmtxop = Rmtxop()

rmtxop.matrices = ['dc.mtx', 'sky.mtx']
rmtxop.transforms = [['47.4', '119.9', '11.6']]
assert rmtxop.to_radiance(stdin_input=True) == 'rmtxop -c 47.4 119.9 11.6 -'

0 comments on commit 7753aeb

Please sign in to comment.