Skip to content

Commit

Permalink
fix(mtx): Use files for lists of clo, met and air speed
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Feb 2, 2022
1 parent 8d5eca6 commit a3a204f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
24 changes: 13 additions & 11 deletions pollination/ladybug_comfort/epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,19 @@ class AirSpeedJson(Function):
'multipled by in order to represent air speeds at ground level.', default=0.5
)

indoor_air_speed = Inputs.str(
description='A single number for air speed in m/s or a string of a JSON array '
'with numbers that align with run period. This will be used for all '
'indoor comfort evaluation.', default='0.1'
indoor_air_speed = Inputs.file(
description='The path to a CSV file containing a single number for air speed '
'in m/s or multiple numbers (with one value per row) that align with the '
'length of the run-period. This will be used for all '
'indoor comfort evaluation.', path='in_speed.txt', optional=True
)

outdoor_air_speed = Inputs.str(
description='A single number for air speed in m/s or a string of a JSON '
'array with numbers that align with the run-period. If None, the EPW wind '
'speed times the multiply-by will be used.', default='None'
outdoor_air_speed = Inputs.file(
description='The path to a CSV file containing a single number for air speed '
'in m/s or multiple numbers (with one value per row) that align with the '
'length of the run-period. If None, the resulting air speed JSON will use '
'the EPW wind speed times the multiply-by value.',
path='out_speed.txt', optional=True
)

run_period = Inputs.str(
Expand All @@ -87,9 +90,8 @@ class AirSpeedJson(Function):
@command
def get_air_speed_json(self):
return 'ladybug-comfort epw air-speed-json weather.epw enclosure_info.json ' \
'--multiply-by {{self.multiply_by}} --indoor-air-speed ' \
'"{{self.indoor_air_speed}}" --outdoor-air-speed ' \
'"{{self.outdoor_air_speed}}" --run-period "{{self.run_period}}" ' \
'--multiply-by {{self.multiply_by}} --indoor-air-speed in_speed.txt ' \
'--outdoor-air-speed out_speed.txt --run-period "{{self.run_period}}" ' \
'--output-file air_speed.json'

air_speeds = Outputs.file(
Expand Down
22 changes: 12 additions & 10 deletions pollination/ladybug_comfort/mtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ class PmvMtx(Function):
'for each row of the matrix in m/s.', path='air_speed.json', extensions=['json']
)

met_rate = Inputs.str(
description='A single number for metabolic rate in met or a string of a '
'JSON array with numbers that align with the result-sql reporting period.',
default='1.1'
met_rate = Inputs.file(
description='The path to a CSV file containing a single number for metabolic '
'rate in met or multiple numbers (with one value per row) that align with the '
'width of the input matrices. If unspecified, than 1.1 will be used.',
path='met.txt', optional=True
)

clo_value = Inputs.str(
description='A single number for clothing level in clo or a string of a JSON '
'array with numbers that align with the result-sql reporting period.',
default='0.7'
clo_value = Inputs.file(
description='The path to a CSV file containing a single number for clothing '
'level in clo or multiple numbers (with one value per row) that align with the '
'width of the input matrices. If unspecified, than 0.7 will be used.',
path='clo.txt', optional=True
)

comfort_par = Inputs.str(
Expand All @@ -64,8 +66,8 @@ class PmvMtx(Function):
def run_pmv_mtx(self):
return 'ladybug-comfort mtx pmv air_temperature.csv rel_humidity.csv ' \
'--rad-temperature-mtx rad_temperature.csv --rad-delta-mtx rad_delta.csv ' \
'--air-speed-json air_speed.json --met-rate "{{self.met_rate}}" ' \
'--clo-value "{{self.clo_value}}" --comfort-par "{{self.comfort_par}}" ' \
'--air-speed-json air_speed.json --met-rate met.txt ' \
'--clo-value clo.txt --comfort-par "{{self.comfort_par}}" ' \
'--{{self.write_set_map}} --folder output'

result_folder = Outputs.folder(
Expand Down

0 comments on commit a3a204f

Please sign in to comment.