Skip to content

Commit

Permalink
fix(thermal_map): Add step to copy result info to environmental conds
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Mar 10, 2022
1 parent 1575309 commit b63322b
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def output_artifacts(self):
}]


class _ComfortMappingEntryPoint_eb938b5bOrchestrator(luigi.WrapperTask):
class _ComfortMappingEntryPoint_a0dda991Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def output_artifacts(self):
}]


class _RadianceContribEntryPoint_eb938b5bOrchestrator(luigi.WrapperTask):
class _RadianceContribEntryPoint_a0dda991Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pathlib
from queenbee_local import QueenbeeTask
from queenbee_local import load_input_param as qb_load_input_param
from .dependencies.radiance_contrib_entry_point import _RadianceContribEntryPoint_eb938b5bOrchestrator as RadianceContribEntryPoint_eb938b5bWorkerbee
from .dependencies.radiance_contrib_entry_point import _RadianceContribEntryPoint_a0dda991Orchestrator as RadianceContribEntryPoint_a0dda991Workerbee


_default_inputs = { 'group_name': None,
Expand Down Expand Up @@ -220,7 +220,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [RadianceContribEntryPoint_eb938b5bWorkerbee(_input_params=self.map_dag_inputs)]
yield [RadianceContribEntryPoint_a0dda991Workerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_radiance_window_contrib.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -280,7 +280,7 @@ def output(self):
}


class _DynamicContributionEntryPoint_eb938b5bOrchestrator(luigi.WrapperTask):
class _DynamicContributionEntryPoint_a0dda991Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def output_artifacts(self):
}]


class _RadianceMappingEntryPoint_eb938b5bOrchestrator(luigi.WrapperTask):
class _RadianceMappingEntryPoint_a0dda991Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
70 changes: 62 additions & 8 deletions lbt_recipes/adaptive_comfort_map/flow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import pathlib
from queenbee_local import QueenbeeTask
from queenbee_local import load_input_param as qb_load_input_param
from .dependencies.comfort_mapping_entry_point import _ComfortMappingEntryPoint_eb938b5bOrchestrator as ComfortMappingEntryPoint_eb938b5bWorkerbee
from .dependencies.dynamic_contribution_entry_point import _DynamicContributionEntryPoint_eb938b5bOrchestrator as DynamicContributionEntryPoint_eb938b5bWorkerbee
from .dependencies.radiance_mapping_entry_point import _RadianceMappingEntryPoint_eb938b5bOrchestrator as RadianceMappingEntryPoint_eb938b5bWorkerbee
from .dependencies.comfort_mapping_entry_point import _ComfortMappingEntryPoint_a0dda991Orchestrator as ComfortMappingEntryPoint_a0dda991Workerbee
from .dependencies.dynamic_contribution_entry_point import _DynamicContributionEntryPoint_a0dda991Orchestrator as DynamicContributionEntryPoint_a0dda991Workerbee
from .dependencies.radiance_mapping_entry_point import _RadianceMappingEntryPoint_a0dda991Orchestrator as RadianceMappingEntryPoint_a0dda991Workerbee


_default_inputs = { 'additional_idf': None,
Expand Down Expand Up @@ -257,6 +257,60 @@ def output_artifacts(self):
}]


class CopyResultInfo(QueenbeeTask):
"""Copy a file or folder to a destination."""

# DAG Input parameters
_input_params = luigi.DictParameter()

# Task inputs
@property
def src(self):
value = pathlib.Path(self.input()['CreateResultInfo']['temperature_info'].path)
return value.as_posix() if value.is_absolute() \
else pathlib.Path(self.initiation_folder, value).resolve().as_posix()

@property
def execution_folder(self):
return pathlib.Path(self._input_params['simulation_folder']).as_posix()

@property
def initiation_folder(self):
return pathlib.Path(self._input_params['simulation_folder']).as_posix()

@property
def params_folder(self):
return pathlib.Path(self.execution_folder, self._input_params['params_folder']).resolve().as_posix()

def command(self):
return 'echo copying input path...'

def requires(self):
return {'CreateResultInfo': CreateResultInfo(_input_params=self._input_params)}

def output(self):
return {
'dst': luigi.LocalTarget(
pathlib.Path(self.execution_folder, 'initial_results/conditions/results_info.json').resolve().as_posix()
)
}

@property
def input_artifacts(self):
return [
{'name': 'src', 'to': 'input_path', 'from': self.src, 'optional': False}]

@property
def output_artifacts(self):
return [
{
'name': 'dst', 'from': 'input_path',
'to': pathlib.Path(self.execution_folder, 'initial_results/conditions/results_info.json').resolve().as_posix(),
'optional': False,
'type': 'folder'
}]


class CreateDirectSky(QueenbeeTask):
"""Generate a sun-up sky matrix."""

Expand Down Expand Up @@ -1821,7 +1875,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [ComfortMappingEntryPoint_eb938b5bWorkerbee(_input_params=self.map_dag_inputs)]
yield [ComfortMappingEntryPoint_a0dda991Workerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_comfort_map.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -2110,7 +2164,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [DynamicContributionEntryPoint_eb938b5bWorkerbee(_input_params=self.map_dag_inputs)]
yield [DynamicContributionEntryPoint_a0dda991Workerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_radiance_dynamic_contribution.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -2295,7 +2349,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [RadianceMappingEntryPoint_eb938b5bWorkerbee(_input_params=self.map_dag_inputs)]
yield [RadianceMappingEntryPoint_a0dda991Workerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_radiance_simulation.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -2519,7 +2573,7 @@ def output_parameters(self):
return [{'name': 'sensor-grids', 'from': 'output_folder/_info.json', 'to': pathlib.Path(self.params_folder, 'output_folder/_info.json').resolve().as_posix()}]


class _Main_eb938b5bOrchestrator(luigi.WrapperTask):
class _Main_a0dda991Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand All @@ -2531,4 +2585,4 @@ def input_values(self):
return params

def requires(self):
yield [CopyGridInfo(_input_params=self.input_values), CopyRedistInfo(_input_params=self.input_values), CreateResultInfo(_input_params=self.input_values), RestructureConditionIntensityResults(_input_params=self.input_values), RestructureConditionResults(_input_params=self.input_values), RestructureCspResults(_input_params=self.input_values), RestructureHspResults(_input_params=self.input_values), RestructureTcpResults(_input_params=self.input_values), RestructureTemperatureResults(_input_params=self.input_values)]
yield [CopyGridInfo(_input_params=self.input_values), CopyRedistInfo(_input_params=self.input_values), CopyResultInfo(_input_params=self.input_values), RestructureConditionIntensityResults(_input_params=self.input_values), RestructureConditionResults(_input_params=self.input_values), RestructureCspResults(_input_params=self.input_values), RestructureHspResults(_input_params=self.input_values), RestructureTcpResults(_input_params=self.input_values), RestructureTemperatureResults(_input_params=self.input_values)]
2 changes: 1 addition & 1 deletion lbt_recipes/adaptive_comfort_map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "MetaData",
"annotations": {},
"name": "adaptive-comfort-map",
"tag": "0.5.3",
"tag": "0.6.3",
"app_version": null,
"keywords": [
"honeybee",
Expand Down
2 changes: 1 addition & 1 deletion lbt_recipes/adaptive_comfort_map/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LetAdaptiveComfortMapFly(luigi.WrapperTask):
_input_params = luigi.DictParameter()

def requires(self):
yield [adaptive_comfort_map_workerbee._Main_eb938b5bOrchestrator(_input_params=self._input_params)]
yield [adaptive_comfort_map_workerbee._Main_a0dda991Orchestrator(_input_params=self._input_params)]


def start(project_folder, user_values, workers):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def output_artifacts(self):
}]


class _ComfortMappingEntryPoint_e67309aaOrchestrator(luigi.WrapperTask):
class _ComfortMappingEntryPoint_e52ba12bOrchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def output_artifacts(self):
}]


class _RadianceContribEntryPoint_e67309aaOrchestrator(luigi.WrapperTask):
class _RadianceContribEntryPoint_e52ba12bOrchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pathlib
from queenbee_local import QueenbeeTask
from queenbee_local import load_input_param as qb_load_input_param
from .dependencies.radiance_contrib_entry_point import _RadianceContribEntryPoint_e67309aaOrchestrator as RadianceContribEntryPoint_e67309aaWorkerbee
from .dependencies.radiance_contrib_entry_point import _RadianceContribEntryPoint_e52ba12bOrchestrator as RadianceContribEntryPoint_e52ba12bWorkerbee


_default_inputs = { 'group_name': None,
Expand Down Expand Up @@ -220,7 +220,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [RadianceContribEntryPoint_e67309aaWorkerbee(_input_params=self.map_dag_inputs)]
yield [RadianceContribEntryPoint_e52ba12bWorkerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_radiance_window_contrib.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -280,7 +280,7 @@ def output(self):
}


class _DynamicContributionEntryPoint_e67309aaOrchestrator(luigi.WrapperTask):
class _DynamicContributionEntryPoint_e52ba12bOrchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def output_artifacts(self):
}]


class _RadianceMappingEntryPoint_e67309aaOrchestrator(luigi.WrapperTask):
class _RadianceMappingEntryPoint_e52ba12bOrchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
70 changes: 62 additions & 8 deletions lbt_recipes/pmv_comfort_map/flow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import pathlib
from queenbee_local import QueenbeeTask
from queenbee_local import load_input_param as qb_load_input_param
from .dependencies.comfort_mapping_entry_point import _ComfortMappingEntryPoint_e67309aaOrchestrator as ComfortMappingEntryPoint_e67309aaWorkerbee
from .dependencies.dynamic_contribution_entry_point import _DynamicContributionEntryPoint_e67309aaOrchestrator as DynamicContributionEntryPoint_e67309aaWorkerbee
from .dependencies.radiance_mapping_entry_point import _RadianceMappingEntryPoint_e67309aaOrchestrator as RadianceMappingEntryPoint_e67309aaWorkerbee
from .dependencies.comfort_mapping_entry_point import _ComfortMappingEntryPoint_e52ba12bOrchestrator as ComfortMappingEntryPoint_e52ba12bWorkerbee
from .dependencies.dynamic_contribution_entry_point import _DynamicContributionEntryPoint_e52ba12bOrchestrator as DynamicContributionEntryPoint_e52ba12bWorkerbee
from .dependencies.radiance_mapping_entry_point import _RadianceMappingEntryPoint_e52ba12bOrchestrator as RadianceMappingEntryPoint_e52ba12bWorkerbee


_default_inputs = { 'additional_idf': None,
Expand Down Expand Up @@ -260,6 +260,60 @@ def output_artifacts(self):
}]


class CopyResultInfo(QueenbeeTask):
"""Copy a file or folder to a destination."""

# DAG Input parameters
_input_params = luigi.DictParameter()

# Task inputs
@property
def src(self):
value = pathlib.Path(self.input()['CreateResultInfo']['temperature_info'].path)
return value.as_posix() if value.is_absolute() \
else pathlib.Path(self.initiation_folder, value).resolve().as_posix()

@property
def execution_folder(self):
return pathlib.Path(self._input_params['simulation_folder']).as_posix()

@property
def initiation_folder(self):
return pathlib.Path(self._input_params['simulation_folder']).as_posix()

@property
def params_folder(self):
return pathlib.Path(self.execution_folder, self._input_params['params_folder']).resolve().as_posix()

def command(self):
return 'echo copying input path...'

def requires(self):
return {'CreateResultInfo': CreateResultInfo(_input_params=self._input_params)}

def output(self):
return {
'dst': luigi.LocalTarget(
pathlib.Path(self.execution_folder, 'initial_results/conditions/results_info.json').resolve().as_posix()
)
}

@property
def input_artifacts(self):
return [
{'name': 'src', 'to': 'input_path', 'from': self.src, 'optional': False}]

@property
def output_artifacts(self):
return [
{
'name': 'dst', 'from': 'input_path',
'to': pathlib.Path(self.execution_folder, 'initial_results/conditions/results_info.json').resolve().as_posix(),
'optional': False,
'type': 'folder'
}]


class CreateDirectSky(QueenbeeTask):
"""Generate a sun-up sky matrix."""

Expand Down Expand Up @@ -1781,7 +1835,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [ComfortMappingEntryPoint_e67309aaWorkerbee(_input_params=self.map_dag_inputs)]
yield [ComfortMappingEntryPoint_e52ba12bWorkerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_comfort_map.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -2070,7 +2124,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [DynamicContributionEntryPoint_e67309aaWorkerbee(_input_params=self.map_dag_inputs)]
yield [DynamicContributionEntryPoint_e52ba12bWorkerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_radiance_dynamic_contribution.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -2255,7 +2309,7 @@ def map_dag_inputs(self):
return inputs

def run(self):
yield [RadianceMappingEntryPoint_e67309aaWorkerbee(_input_params=self.map_dag_inputs)]
yield [RadianceMappingEntryPoint_e52ba12bWorkerbee(_input_params=self.map_dag_inputs)]
done_file = pathlib.Path(self.execution_folder, 'run_radiance_simulation.done')
done_file.parent.mkdir(parents=True, exist_ok=True)
done_file.write_text('done!')
Expand Down Expand Up @@ -2479,7 +2533,7 @@ def output_parameters(self):
return [{'name': 'sensor-grids', 'from': 'output_folder/_info.json', 'to': pathlib.Path(self.params_folder, 'output_folder/_info.json').resolve().as_posix()}]


class _Main_e67309aaOrchestrator(luigi.WrapperTask):
class _Main_e52ba12bOrchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand All @@ -2491,4 +2545,4 @@ def input_values(self):
return params

def requires(self):
yield [CopyGridInfo(_input_params=self.input_values), CopyRedistInfo(_input_params=self.input_values), CreateResultInfo(_input_params=self.input_values), RestructureConditionIntensityResults(_input_params=self.input_values), RestructureConditionResults(_input_params=self.input_values), RestructureCspResults(_input_params=self.input_values), RestructureHspResults(_input_params=self.input_values), RestructureTcpResults(_input_params=self.input_values), RestructureTemperatureResults(_input_params=self.input_values)]
yield [CopyGridInfo(_input_params=self.input_values), CopyRedistInfo(_input_params=self.input_values), CopyResultInfo(_input_params=self.input_values), RestructureConditionIntensityResults(_input_params=self.input_values), RestructureConditionResults(_input_params=self.input_values), RestructureCspResults(_input_params=self.input_values), RestructureHspResults(_input_params=self.input_values), RestructureTcpResults(_input_params=self.input_values), RestructureTemperatureResults(_input_params=self.input_values)]
2 changes: 1 addition & 1 deletion lbt_recipes/pmv_comfort_map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "MetaData",
"annotations": {},
"name": "pmv-comfort-map",
"tag": "0.6.4",
"tag": "0.6.11",
"app_version": null,
"keywords": [
"honeybee",
Expand Down
2 changes: 1 addition & 1 deletion lbt_recipes/pmv_comfort_map/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class LetPmvComfortMapFly(luigi.WrapperTask):
_input_params = luigi.DictParameter()

def requires(self):
yield [pmv_comfort_map_workerbee._Main_e67309aaOrchestrator(_input_params=self._input_params)]
yield [pmv_comfort_map_workerbee._Main_e52ba12bOrchestrator(_input_params=self._input_params)]


def start(project_folder, user_values, workers):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def output_artifacts(self):
}]


class _ComfortMappingEntryPoint_912d6202Orchestrator(luigi.WrapperTask):
class _ComfortMappingEntryPoint_0a97de84Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def output_artifacts(self):
}]


class _RadianceMappingEntryPoint_912d6202Orchestrator(luigi.WrapperTask):
class _RadianceMappingEntryPoint_0a97de84Orchestrator(luigi.WrapperTask):
"""Runs all the tasks in this module."""
# user input for this module
_input_params = luigi.DictParameter()
Expand Down
Loading

0 comments on commit b63322b

Please sign in to comment.