Skip to content

Commit

Permalink
fix: add additional steps for creating visualization-set
Browse files Browse the repository at this point in the history
  • Loading branch information
mostaphaRoudsari authored and mikkelkp committed Feb 26, 2024
1 parent 3cf4e17 commit 67080b9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
36 changes: 35 additions & 1 deletion pollination/daylight_factor/_postprocess_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@

from pollination.honeybee_radiance.grid import MergeFolderData
from pollination.honeybee_radiance_postprocess.post_process import GridSummaryMetrics
from pollination.honeybee_radiance.post_process import DaylightFactorVisMetadata
from pollination.honeybee_display.translate import ModelToVis


@dataclass
class DaylightFactorPostProcessResults(GroupedDAG):
"""Daylight factor results post-process."""

model = Inputs.file(
description='Input Honeybee model.',
description='A Honeybee Model in either JSON or Pkl format. This can also '
'be a zipped honeybee-radiance folder.',
extensions=['json', 'hbjson', 'pkl', 'hbpkl', 'zip']
)

Expand Down Expand Up @@ -63,6 +66,37 @@ def grid_summary_metrics(
}
]

@task(
template=DaylightFactorVisMetadata,
needs=[restructure_results]
)
def create_vis_metadata(self):
return [
{
'from': DaylightFactorVisMetadata()._outputs.cfg_file,
'to': 'results/vis_metadata.json'
}
]

@task(
template=ModelToVis,
needs=[create_vis_metadata, copy_grid_info]
)
def create_vsf(
self, model=model, grid_data='results', output_format='vsf'
):
return [
{
'from': ModelToVis()._outputs.output_file,
'to': 'visualization.vsf'
}
]

visualization = Outputs.file(
source='visualization.vsf',
description='Result visualization in VisualizationSet format.'
)

results = Outputs.folder(
source='results',
description='Daylight factor results.'
Expand Down
9 changes: 9 additions & 0 deletions pollination/daylight_factor/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,18 @@ def post_process_results(
{
'from': DaylightFactorPostProcessResults()._outputs.grid_summary,
'to': 'grid_summary.csv'
},
{
'from': DaylightFactorPostProcessResults()._outputs.visualization,
'to': 'visualization.vsf'
}
]

visualization = Outputs.file(
source='visualization.vsf',
description='Result visualization in VisualizationSet format.'
)

results = Outputs.folder(
source='results', description='Folder with raw result files '
'(.res) that contain daylight factor values for each sensor.',
Expand Down

0 comments on commit 67080b9

Please sign in to comment.