Skip to content

Commit

Permalink
fix(entry): Update recipe to match results folder for post-processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Dec 6, 2022
1 parent 94ef100 commit aecd5c8
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 304 deletions.
29 changes: 12 additions & 17 deletions pollination/three_phase/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

from pollination.path.read import ReadJSONList

from .two_phase.entry import TwoPhaseEntryPoint
from .two_phase.dynamic.entry import DynamicGroup
from .two_phase.dynamic.entry import TwoPhaseSimulation
from .three_phase.preparation import ThreePhaseInputsPreparation
from .three_phase.calculation import ThreePhaseMatrixCalculation

Expand Down Expand Up @@ -107,7 +106,7 @@ def create_rad_folder(self, input_model=model, grid_filter=grid_filter):
},
{
'from': CreateRadianceFolderGrid()._outputs.sensor_grids_file,
'to': 'results/_info.json'
'to': 'results/grids_info.json'
},
{
'from': CreateRadianceFolderGrid()._outputs.receivers,
Expand All @@ -120,8 +119,9 @@ def create_rad_folder(self, input_model=model, grid_filter=grid_filter):
def generate_sunpath(self, north=north, wea=wea):
"""Create sunpath for sun-up-hours."""
return [
{'from': CreateSunMatrix()._outputs.sunpath,
'to': 'resources/sky_vectors/sunpath.mtx'},
{
'from': CreateSunMatrix()._outputs.sunpath,
'to': 'resources/sky_vectors/sunpath.mtx'},
{
'from': CreateSunMatrix()._outputs.sun_modifiers,
'to': 'resources/sky_vectors/suns.mod'
Expand Down Expand Up @@ -194,7 +194,7 @@ def prepare_multiphase(
]

@task(
template=DynamicGroup,
template=TwoPhaseSimulation,
loop=prepare_multiphase._outputs.two_phase_info,
needs=[
create_rad_folder, prepare_multiphase,
Expand Down Expand Up @@ -260,10 +260,6 @@ def prepare_three_phase(
'from': ThreePhaseInputsPreparation()._outputs.grouped_apertures_folder,
'to': '../../model/sender'
}
# {
# 'from': ThreePhaseInputsPreparation()._outputs.results_info,
# 'to': '../../results/3_phase/_info.json'
# }
]

@task(template=ReadJSONList, needs=[prepare_three_phase])
Expand Down Expand Up @@ -297,12 +293,11 @@ def calculate_three_phase_matrix_total(
sky_matrix=create_total_sky._outputs.sky_matrix,
bsdf_folder=create_rad_folder._outputs.bsdf_folder,
):
# return [
# {
# 'from': ThreePhaseMatrixCalculation()._outputs.results,
# 'to': '../../results'
# }
# ]
pass
return [
{
'from': ThreePhaseMatrixCalculation()._outputs.results,
'to': '../../results'
}
]

results = Outputs.folder(source='results')
9 changes: 0 additions & 9 deletions pollination/three_phase/three_phase/preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ def get_three_phase_combinations(
states_info=model_folder
):
return [
# {
# 'from': MultiPhaseCombinations()._outputs.results_mapper,
# 'to': 'results/_info.json'
# },
{
'from': MultiPhaseCombinations()._outputs.multiplication_file,
'to': 'multiplication_info.json'
Expand All @@ -105,8 +101,3 @@ def get_three_phase_combinations(
description='A JSON file with matrix multiplication information.',
source='multiplication_info.json'
)

results_info = Outputs.file(
description='A JSON file with information for loading the results.',
source='results/_info.json'
)
Empty file.
142 changes: 0 additions & 142 deletions pollination/three_phase/two_phase/_raytracing.py

This file was deleted.

2 changes: 1 addition & 1 deletion pollination/three_phase/two_phase/dynamic/_raytracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@dataclass
class DynamicRayTracing(DAG):
class TwoPhaseRayTracing(DAG):
# inputs

radiance_parameters = Inputs.str(
Expand Down
14 changes: 7 additions & 7 deletions pollination/three_phase/two_phase/dynamic/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from dataclasses import dataclass
from pollination.honeybee_radiance_postprocess.grid import MergeFolderData

from ._raytracing import DynamicRayTracing
from ._raytracing import TwoPhaseRayTracing


@dataclass
class DynamicGroup(DAG):
class TwoPhaseSimulation(DAG):
"""Dynamic entry point.
This two phase workflow also includes the extra phase for accurately calculating the
Expand All @@ -17,14 +17,14 @@ class DynamicGroup(DAG):
# inputs
identifier = Inputs.str(
description='Identifier for this two-phase study. This value is usually the '
'identifier of the aperture group or is set to __static__ for the static '
'apertures in the model.', default='__static__'
'identifier of the aperture group or is set to __static_apertures__ for the '
'static apertures in the model.', default='__static_apertures__'
)

light_path = Inputs.str(
description='Identifier for the light path of this two-phase study. This value '
'is the identifier of the aperture group or is set to __static___ for the '
'static apertures in the model.', default='__static__'
'is the identifier of the aperture group or is set to __static_apertures__ for '
'the static apertures in the model.', default='__static_apertures__'
)

radiance_parameters = Inputs.str(
Expand Down Expand Up @@ -90,7 +90,7 @@ class DynamicGroup(DAG):
)

@task(
template=DynamicRayTracing,
template=TwoPhaseRayTracing,
loop=sensor_grids_info,
# create a subfolder for each grid
sub_folder='initial_results/{{item.full_id}}',
Expand Down
Loading

0 comments on commit aecd5c8

Please sign in to comment.