From a3a204f1c36654fef48df601e580c93d81ef1150 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Wed, 2 Feb 2022 14:29:04 -0500 Subject: [PATCH] fix(mtx): Use files for lists of clo, met and air speed --- pollination/ladybug_comfort/epw.py | 24 +++++++++++++----------- pollination/ladybug_comfort/mtx.py | 22 ++++++++++++---------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/pollination/ladybug_comfort/epw.py b/pollination/ladybug_comfort/epw.py index fc3c0cd..08df4f1 100644 --- a/pollination/ladybug_comfort/epw.py +++ b/pollination/ladybug_comfort/epw.py @@ -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( @@ -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( diff --git a/pollination/ladybug_comfort/mtx.py b/pollination/ladybug_comfort/mtx.py index 39473f9..058b1e7 100644 --- a/pollination/ladybug_comfort/mtx.py +++ b/pollination/ladybug_comfort/mtx.py @@ -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( @@ -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(