Skip to content

Commit

Permalink
fix(visualization): Replace function to create visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Jun 26, 2024
1 parent c541622 commit ae444a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
16 changes: 12 additions & 4 deletions pollination/abnt_nbr_15575_daylight/_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pollination.honeybee_display.translate import ModelToVis
from pollination.path.copy import CopyFolder
from pollination.honeybee_radiance.post_process import AbntNbr15575DaylightVisMetadata
from pollination.honeybee_display.abnt import AbntNbr15575DaylightVis


@dataclass
Expand Down Expand Up @@ -40,6 +41,11 @@ class AbntNbr15575DaylightVisualization(GroupedDAG):
path='visualization/illuminance_levels'
)

center_points = Inputs.file(
description='A JSON file with 3D points to be visualized. These will be '
'displayed as DisplayPoint3D.',
path='center_points.json')

@task(template=CopyFolder)
def copy_illuminance_4_930am(self, src=illuminance_4_930am):
return [
Expand Down Expand Up @@ -86,14 +92,15 @@ def create_vis_metadata(self, output_folder='visualization'):
]

@task(
template=ModelToVis,
template=AbntNbr15575DaylightVis,
needs=[copy_illuminance_4_930am, copy_illuminance_4_330pm,
copy_illuminance_10_930am, copy_illuminance_10_330pm,
create_vis_metadata]
)
def create_vsf_illuminance(
self, model=model, grid_data='visualization',
active_grid_data='4_930AM', output_format='vsf'
active_grid_data='4_930AM', center_points=center_points,
output_format='vsf'
):
return [
{
Expand All @@ -102,10 +109,11 @@ def create_vsf_illuminance(
}
]

@task(template=ModelToVis)
@task(template=AbntNbr15575DaylightVis)
def create_vsf_illuminance_levels(
self, model=model, grid_data=illuminance_levels,
active_grid_data='4_930AM', output_format='vsf'
active_grid_data='4_930AM', center_points=center_points,
output_format='vsf'
):
return [
{
Expand Down
9 changes: 7 additions & 2 deletions pollination/abnt_nbr_15575_daylight/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,18 @@ def abnt_nbr_15575_postprocess(
@task(
template=AbntNbr15575DaylightVisualization,
needs=[prepare_folder, illuminance_simulation, abnt_nbr_15575_postprocess],
sub_paths={'illuminance_levels': 'illuminance_levels'}
sub_paths={
'illuminance_levels': 'illuminance_levels',
'center_points': 'center_points.json'
}
)
def create_visualization(
self, model=model, illuminance_4_930am='simulation/4_930AM/results',
illuminance_4_330pm='simulation/4_330PM/results',
illuminance_10_930am='simulation/10_930AM/results',
illuminance_10_330pm='simulation/10_330PM/results',
illuminance_levels=abnt_nbr_15575_postprocess._outputs.abnt_nbr_15575
illuminance_levels=abnt_nbr_15575_postprocess._outputs.abnt_nbr_15575,
center_points=abnt_nbr_15575_postprocess._outputs.abnt_nbr_15575
):
return [
{
Expand All @@ -165,6 +169,7 @@ def create_visualization(
}
]


abnt_nbr_15575 = Outputs.folder(
source='abnt_nbr_15575',
description='Folder with the ABNT NBR 15575 post-processing.'
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pollination-honeybee-radiance==0.22.55
pollination-honeybee-radiance-postprocess==0.0.60
pollination-path==0.3.2
pollination-alias==0.11.11
pollination-honeybee-display==0.1.15
pollination-honeybee-display==0.1.16

0 comments on commit ae444a2

Please sign in to comment.