-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from dataclasses import dataclass | ||
from pollination_dsl.dag import Inputs, GroupedDAG, task, Outputs | ||
from pollination.honeybee_display.translate import ModelToVis | ||
from pollination.path.copy import CopyFolder | ||
from pollination.honeybee_radiance_postprocess.leed import DaylightOptionOneVisMetadata | ||
|
||
|
||
@dataclass | ||
class DaylightOptionOneVisualization(GroupedDAG): | ||
"""Create visualization.""" | ||
|
||
# inputs | ||
model = Inputs.file( | ||
description='Input Honeybee model.', | ||
extensions=['json', 'hbjson', 'pkl', 'hbpkl', 'zip'] | ||
) | ||
|
||
pass_fail = Inputs.folder( | ||
description='Pass/fail results.', | ||
path='results' | ||
) | ||
|
||
@task(template=CopyFolder) | ||
def copy_pass_fail(self, src=pass_fail): | ||
return [ | ||
{ | ||
'from': CopyFolder()._outputs.dst, | ||
'to': 'visualization' | ||
} | ||
] | ||
|
||
@task( | ||
template=DaylightOptionOneVisMetadata, | ||
) | ||
def create_vis_metadata(self): | ||
return [ | ||
{ | ||
'from': DaylightOptionOneVisMetadata()._outputs.vis_metadata_folder, | ||
'to': 'visualization' | ||
} | ||
] | ||
|
||
@task( | ||
template=ModelToVis, | ||
needs=[copy_pass_fail, create_vis_metadata] | ||
) | ||
def create_vsf( | ||
self, model=model, grid_data='visualization', | ||
active_grid_data='DA', output_format='vsf' | ||
): | ||
return [ | ||
{ | ||
'from': ModelToVis()._outputs.output_file, | ||
'to': 'visualization.vsf' | ||
} | ||
] | ||
|
||
visualization = Outputs.file( | ||
source='visualization.vsf', | ||
description='Visualization in VisualizationSet format.' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pollination-two-phase-daylight-coefficient==1.1.33 | ||
pollination-honeybee-display==0.1.17 |