def test_get_core_cooling_day_baseline_setpoint_null_temperature_in( thermostat_template): index = pd.date_range(start=datetime(2011, 1, 1), periods=3, freq='D') thermostat_template.temperature_in = pd.Series([0, 1, 2], index=index) thermostat_template.equipment_type = 1 season_selector = pd.Series([True, True, True], index=index) core_day_set = CoreDaySet("FAKE", season_selector, season_selector, None, None) sp = thermostat_template.get_core_cooling_day_baseline_setpoint( core_day_set, source='cooling_setpoint') assert pd.isnull(sp) sp = thermostat_template.get_core_cooling_day_baseline_setpoint( core_day_set, source='temperature_in') assert_allclose(sp, 0.2) thermostat_template.temperature_in = pd.Series([np.nan, 1, 2], index=index) sp = thermostat_template.get_core_cooling_day_baseline_setpoint( core_day_set, source='temperature_in') assert_allclose(sp, 1.1) thermostat_template.temperature_in = pd.Series([0, 1, np.nan], index=index) sp = thermostat_template.get_core_cooling_day_baseline_setpoint( core_day_set, source='temperature_in') assert_allclose(sp, 0.1) thermostat_template.temperature_in = pd.Series([np.nan, np.nan, np.nan], index=index) sp = thermostat_template.get_core_cooling_day_baseline_setpoint( core_day_set, source='temperature_in') assert pd.isnull(sp)
def core_heating_day_set_type_1_empty(thermostat_type_1): core_heating_day_set = thermostat_type_1.get_core_heating_days( method="entire_dataset")[0] core_day_set = CoreDaySet( "empty", pd.Series(np.tile(False, core_heating_day_set.daily.shape), index=core_heating_day_set.daily.index), pd.Series(np.tile(False, core_heating_day_set.hourly.shape), index=core_heating_day_set.hourly.index), core_heating_day_set.start_date, core_heating_day_set.end_date) return core_day_set