From e70c07432f5e56f88d98acffa789605af664222a Mon Sep 17 00:00:00 2001 From: Mostapha Date: Sun, 21 Feb 2021 20:27:01 -0500 Subject: [PATCH] fix(daylight-factor): bump from version 0.4.1 to 0.5.0 --- .../flow/dependencies/daylight_factor_ray_tracing.py | 2 +- lbt_recipes/daylight_factor/flow/main.py | 11 ++++++++--- lbt_recipes/daylight_factor/package.json | 12 +++++++++++- lbt_recipes/daylight_factor/run.py | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lbt_recipes/daylight_factor/flow/dependencies/daylight_factor_ray_tracing.py b/lbt_recipes/daylight_factor/flow/dependencies/daylight_factor_ray_tracing.py index 7f236ae2..0ac2da16 100644 --- a/lbt_recipes/daylight_factor/flow/dependencies/daylight_factor_ray_tracing.py +++ b/lbt_recipes/daylight_factor/flow/dependencies/daylight_factor_ray_tracing.py @@ -6,7 +6,7 @@ _default_inputs = { 'grid_name': None, 'octree_file': None, 'params_folder': '__params', - 'radiance_parameters': '-ab 2', + 'radiance_parameters': '-ab 2 -aa 0.1 -ad 2048 -ar 64', 'sensor_count': 200, 'sensor_grid': None, 'simulation_folder': '.'} diff --git a/lbt_recipes/daylight_factor/flow/main.py b/lbt_recipes/daylight_factor/flow/main.py index 97072464..73f049c3 100644 --- a/lbt_recipes/daylight_factor/flow/main.py +++ b/lbt_recipes/daylight_factor/flow/main.py @@ -8,6 +8,7 @@ 'params_folder': '__params', 'radiance_parameters': '-ab 2 -aa 0.1 -ad 2048 -ar 64', 'sensor_count': 200, + 'sensor_grid': '*', 'simulation_folder': '.'} @@ -81,6 +82,10 @@ class CreateRadFolder(QueenbeeTask): _input_params = luigi.DictParameter() # Task inputs + @property + def sensor_grid(self): + return self._input_params['sensor_grid'] + @property def input_model(self): value = self._input_params['model'].replace('\\', '/') @@ -100,7 +105,7 @@ def params_folder(self): return os.path.join(self.execution_folder, self._input_params['params_folder']).replace('\\', '/') def command(self): - return 'honeybee-radiance translate model-to-rad-folder model.hbjson' + return 'honeybee-radiance translate model-to-rad-folder model.hbjson --grid "{sensor_grid}"'.format(sensor_grid=self.sensor_grid) def output(self): return { @@ -159,7 +164,7 @@ def radiance_parameters(self): @property def grid_name(self): - return self.item['name'] + return self.item['full_id'] @property def octree_file(self): @@ -169,7 +174,7 @@ def octree_file(self): @property def sensor_grid(self): - value = os.path.join(self.input()['CreateRadFolder']['model_folder'].path, 'grid/{item_name}.pts'.format(item_name=self.item['name'])).replace('\\', '/') + value = os.path.join(self.input()['CreateRadFolder']['model_folder'].path, 'grid/{item_full_id}.pts'.format(item_full_id=self.item['full_id'])).replace('\\', '/') return value if os.path.isabs(value) \ else os.path.join(self.initiation_folder, value) diff --git a/lbt_recipes/daylight_factor/package.json b/lbt_recipes/daylight_factor/package.json index 90315833..d67f8220 100644 --- a/lbt_recipes/daylight_factor/package.json +++ b/lbt_recipes/daylight_factor/package.json @@ -6,7 +6,7 @@ "type": "MetaData", "annotations": {}, "name": "daylight-factor", - "tag": "0.4.1", + "tag": "0.5.0", "app_version": null, "keywords": [ "honeybee", @@ -131,6 +131,16 @@ "type": "integer", "minimum": 1 } + }, + { + "type": "DAGStringInput", + "annotations": {}, + "name": "sensor-grid", + "description": "A grid name or a pattern to filter the sensor grids. By default all the grids in HBJSON model will be exported.", + "default": "*", + "alias": [], + "required": false, + "spec": null } ], "outputs": [ diff --git a/lbt_recipes/daylight_factor/run.py b/lbt_recipes/daylight_factor/run.py index a1671275..217ee0fe 100644 --- a/lbt_recipes/daylight_factor/run.py +++ b/lbt_recipes/daylight_factor/run.py @@ -10,7 +10,8 @@ _recipe_default_inputs = { 'model': None, 'radiance_parameters': '-ab 2 -aa 0.1 -ad 2048 -ar 64', - 'sensor_count': 200} + 'sensor_count': 200, + 'sensor_grid': '*'} class LetDaylightFactorFly(luigi.WrapperTask):