Skip to content

Commit

Permalink
fix(timestep): Relax restrictions on wea and add timestep
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Dec 6, 2023
1 parent 709bf2f commit fe2a244
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 19 additions & 3 deletions pollination/annual_daylight/_prepare_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
from pollination.honeybee_radiance.sky import CreateSkyDome, CreateSkyMatrix
from pollination.honeybee_radiance.octree import CreateOctreeStatic
from pollination.honeybee_radiance.grid import SplitGridFolder
from pollination.honeybee_radiance.study import StudyInfo

# input/output alias
from pollination.alias.inputs.model import hbjson_model_grid_input
from pollination.alias.inputs.wea import wea_input_timestep_check
from pollination.alias.inputs.wea import wea_input
from pollination.alias.inputs.north import north_input
from pollination.alias.inputs.grid import grid_filter_input, \
min_sensor_count_input, cpu_count
Expand Down Expand Up @@ -66,10 +67,16 @@ class AnnualDaylightPrepareFolder(GroupedDAG):
wea = Inputs.file(
description='Wea file.',
extensions=['wea', 'epw'],
alias=wea_input_timestep_check
alias=wea_input
)

@task(template=CreateSunMtx)
timestep = Inputs.int(
description='Input wea timestep. This value will be used to compute '
'cumulative radiation results.', default=1,
spec={'type': 'integer', 'minimum': 1, 'maximum': 60}
)

@task(template=CreateSunMatrix)
def generate_sunpath(self, north=north, wea=wea):
"""Create sunpath for sun-up-hours."""
return [
Expand Down Expand Up @@ -156,6 +163,15 @@ def parse_sun_up_hours(self, sun_modifiers=generate_sunpath._outputs.sun_modifie
}
]

@task(template=StudyInfo)
def create_study_info(self, wea=wea, timestep=timestep):
return [
{
'from': StudyInfo()._outputs.study_info,
'to': 'results/study_info.json'
}
]

model_folder = Outputs.folder(
source='model', description='input model folder folder.'
)
Expand Down
12 changes: 9 additions & 3 deletions pollination/annual_daylight/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# input/output alias
from pollination.alias.inputs.model import hbjson_model_grid_input
from pollination.alias.inputs.wea import wea_input_timestep_check
from pollination.alias.inputs.wea import wea_input
from pollination.alias.inputs.north import north_input
from pollination.alias.inputs.radiancepar import rad_par_annual_input, \
daylight_thresholds_input
Expand Down Expand Up @@ -78,7 +78,13 @@ class AnnualDaylightEntryPoint(DAG):
wea = Inputs.file(
description='Wea file.',
extensions=['wea', 'epw'],
alias=wea_input_timestep_check
alias=wea_input
)

timestep = Inputs.int(
description='Input wea timestep. This value will be used to compute '
'cumulative radiation results.', default=1,
spec={'type': 'integer', 'minimum': 1, 'maximum': 60}
)

schedule = Inputs.file(
Expand Down Expand Up @@ -106,7 +112,7 @@ class AnnualDaylightEntryPoint(DAG):
@task(template=AnnualDaylightPrepareFolder)
def prepare_folder_annual_daylight(
self, north=north, cpu_count=cpu_count, min_sensor_count=min_sensor_count,
grid_filter=grid_filter, model=model, wea=wea
grid_filter=grid_filter, model=model, wea=wea, timestep=timestep
):
return [
{
Expand Down

0 comments on commit fe2a244

Please sign in to comment.