diff --git a/honeybee_grasshopper_energy/icon/HB Seasonal Schedule.png b/honeybee_grasshopper_energy/icon/HB Seasonal Schedule.png index c83849b..8309b9a 100644 Binary files a/honeybee_grasshopper_energy/icon/HB Seasonal Schedule.png and b/honeybee_grasshopper_energy/icon/HB Seasonal Schedule.png differ diff --git a/honeybee_grasshopper_energy/json/HB_Seasonal_Schedule.json b/honeybee_grasshopper_energy/json/HB_Seasonal_Schedule.json index 1688d79..30412ae 100644 --- a/honeybee_grasshopper_energy/json/HB_Seasonal_Schedule.json +++ b/honeybee_grasshopper_energy/json/HB_Seasonal_Schedule.json @@ -1,5 +1,5 @@ { - "version": "1.7.0", + "version": "1.7.1", "nickname": "SeasonalSchedule", "outputs": [ [ @@ -78,7 +78,7 @@ } ], "subcategory": "2 :: Schedules", - "code": "\ntry: # import the core honeybee dependencies\n from ladybug.dt import Date\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-energy dependencies\n from honeybee_energy.schedule.day import ScheduleDay\n from honeybee_energy.schedule.ruleset import ScheduleRuleset\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry: # import ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # check that the input _season_scheds align with the _analysis_periods\n assert len(_season_scheds) == len(_analysis_periods), \\\n 'Length of the _season_scheds list must match that of the _analysis_periods.' \\\n '\\n{} does not equal {}'.format(len(_season_scheds), len(_analysis_periods))\n\n # start by duplicating the base schedule\n name = clean_and_id_ep_string('SeasonalSchedule') if _name_ is None else \\\n clean_ep_string(_name_)\n if isinstance(_base_schedule, str):\n _base_schedule = schedule_by_identifier(_base_schedule)\n schedule = _base_schedule.duplicate()\n schedule.identifier = name\n if _name_ is not None:\n schedule.display_name = _name_\n\n # translate the _season_scheds to individual Rules and apply them to the base\n for season_sch, a_period in zip(_season_scheds, _analysis_periods):\n if isinstance(season_sch, str):\n season_sch = schedule_by_identifier(season_sch)\n if a_period.is_reversed:\n season_rules = season_sch.to_rules(Date(1, 1), a_period.end_time.date) + \\\n season_sch.to_rules(a_period.st_time.date, Date(12, 31))\n else:\n season_rules = season_sch.to_rules(\n a_period.st_time.date, a_period.end_time.date)\n for rule in reversed(season_rules): # preserve priority order of rules\n schedule.add_rule(rule)\n\n # apply the summer and winter design days if specified\n if len(_summer_des_) != 0:\n s_vals = [_summer_des_[0]] * 24 if len(_summer_des_) == 1 else _summer_des_\n s_id = '{}_SmrDsn'.format(schedule.identifier)\n s_day = ScheduleDay.from_values_at_timestep(s_id, s_vals)\n schedule.summer_designday_schedule = s_day\n if len(_winter_des_) != 0:\n w_vals = [_winter_des_[0]] * 24 if len(_winter_des_) == 1 else _winter_des_\n w_id = '{}_WntrDsn'.format(schedule.identifier)\n w_day = ScheduleDay.from_values_at_timestep(s_id, s_vals)\n schedule.winter_designday_schedule = w_day\n\n # get the idf strings of the schedule\n idf_year, idf_week = schedule.to_idf()\n idf_days = [day_sch.to_idf(schedule.schedule_type_limit)\n for day_sch in schedule.day_schedules]\n", + "code": "\ntry: # import the core honeybee dependencies\n from ladybug.dt import Date\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-energy dependencies\n from honeybee_energy.schedule.day import ScheduleDay\n from honeybee_energy.schedule.ruleset import ScheduleRuleset\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry: # import ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # check that the input _season_scheds align with the _analysis_periods\n assert len(_season_scheds) == len(_analysis_periods), \\\n 'Length of the _season_scheds list must match that of the _analysis_periods.' \\\n '\\n{} does not equal {}'.format(len(_season_scheds), len(_analysis_periods))\n\n # start by duplicating the base schedule\n name = clean_and_id_ep_string('SeasonalSchedule') if _name_ is None else \\\n clean_ep_string(_name_)\n if isinstance(_base_schedule, str):\n _base_schedule = schedule_by_identifier(_base_schedule)\n schedule = _base_schedule.duplicate()\n schedule.identifier = name\n if _name_ is not None:\n schedule.display_name = _name_\n\n # translate the _season_scheds to individual Rules and apply them to the base\n for season_sch, a_period in zip(_season_scheds, _analysis_periods):\n if isinstance(season_sch, str):\n season_sch = schedule_by_identifier(season_sch)\n if a_period.is_reversed:\n season_rules = season_sch.to_rules(Date(1, 1), a_period.end_time.date) + \\\n season_sch.to_rules(a_period.st_time.date, Date(12, 31))\n else:\n season_rules = season_sch.to_rules(\n a_period.st_time.date, a_period.end_time.date)\n for rule in reversed(season_rules): # preserve priority order of rules\n schedule.add_rule(rule)\n\n # apply the summer and winter design days if specified\n if len(_summer_des_) != 0:\n s_vals = [_summer_des_[0]] * 24 if len(_summer_des_) == 1 else _summer_des_\n s_id = '{}_SmrDsn'.format(schedule.identifier)\n s_day = ScheduleDay.from_values_at_timestep(s_id, s_vals)\n schedule.summer_designday_schedule = s_day\n if len(_winter_des_) != 0:\n w_vals = [_winter_des_[0]] * 24 if len(_winter_des_) == 1 else _winter_des_\n w_id = '{}_WntrDsn'.format(schedule.identifier)\n w_day = ScheduleDay.from_values_at_timestep(w_id, w_vals)\n schedule.winter_designday_schedule = w_day\n\n # get the idf strings of the schedule\n idf_year, idf_week = schedule.to_idf()\n idf_days = [day_sch.to_idf(schedule.schedule_type_limit)\n for day_sch in schedule.day_schedules]\n", "category": "HB-Energy", "name": "HB Seasonal Schedule", "description": "Create a schedule using from other ScheduleRulesets and AnalysisPeriods over which\neach schedule should be applied.\n-" diff --git a/honeybee_grasshopper_energy/src/HB Seasonal Schedule.py b/honeybee_grasshopper_energy/src/HB Seasonal Schedule.py index eb3c959..4bfe6b3 100644 --- a/honeybee_grasshopper_energy/src/HB Seasonal Schedule.py +++ b/honeybee_grasshopper_energy/src/HB Seasonal Schedule.py @@ -65,7 +65,7 @@ ghenv.Component.Name = "HB Seasonal Schedule" ghenv.Component.NickName = 'SeasonalSchedule' -ghenv.Component.Message = '1.7.0' +ghenv.Component.Message = '1.7.1' ghenv.Component.Category = 'HB-Energy' ghenv.Component.SubCategory = '2 :: Schedules' ghenv.Component.AdditionalHelpFromDocStrings = "4" @@ -131,7 +131,7 @@ if len(_winter_des_) != 0: w_vals = [_winter_des_[0]] * 24 if len(_winter_des_) == 1 else _winter_des_ w_id = '{}_WntrDsn'.format(schedule.identifier) - w_day = ScheduleDay.from_values_at_timestep(s_id, s_vals) + w_day = ScheduleDay.from_values_at_timestep(w_id, w_vals) schedule.winter_designday_schedule = w_day # get the idf strings of the schedule diff --git a/honeybee_grasshopper_energy/user_objects/HB Seasonal Schedule.ghuser b/honeybee_grasshopper_energy/user_objects/HB Seasonal Schedule.ghuser index 686c382..4c0a076 100644 Binary files a/honeybee_grasshopper_energy/user_objects/HB Seasonal Schedule.ghuser and b/honeybee_grasshopper_energy/user_objects/HB Seasonal Schedule.ghuser differ