예제 #1
0
def defender_of_fatherland_observance(holidays):
    # Defender of the Fatherland Day did not follow the next-non-holiday rule
    # these years.
    holidays = holidays[(holidays.year != 2013) & (holidays.year != 2014) &
                        (holidays.year != 2019)]

    return pd.to_datetime([weekend_to_monday(day) for day in holidays])
예제 #2
0
 def test_weekend_to_monday(self):
     assert weekend_to_monday(self.sa) == self.mo
     assert weekend_to_monday(self.su) == self.mo
     assert weekend_to_monday(self.mo) == self.mo
예제 #3
0
 def test_weekend_to_monday(self):
     assert weekend_to_monday(self.sa) == self.mo
     assert weekend_to_monday(self.su) == self.mo
     assert weekend_to_monday(self.mo) == self.mo
예제 #4
0
def test_weekend_to_monday(day, expected):
    assert weekend_to_monday(day) == expected
예제 #5
0
def test_weekend_to_monday(day, expected):
    assert weekend_to_monday(day) == expected
예제 #6
0
 def test_weekend_to_monday(self):
     self.assertEqual(weekend_to_monday(self.sa), self.mo)
     self.assertEqual(weekend_to_monday(self.su), self.mo)
     self.assertEqual(weekend_to_monday(self.mo), self.mo)
예제 #7
0
 def test_weekend_to_monday(self):
     self.assertEqual(weekend_to_monday(self.sa), self.mo)
     self.assertEqual(weekend_to_monday(self.su), self.mo)
     self.assertEqual(weekend_to_monday(self.mo), self.mo)
예제 #8
0
def orthodox_christmas_observance(holidays):
    # Orthodox Christmas did not follow the next-non-holiday rule these years.
    holidays = holidays[(holidays.year != 2012) & (holidays.year != 2017)]

    return pd.to_datetime([weekend_to_monday(day) for day in holidays])
예제 #9
0
def new_years_holiday_observance(holidays):
    # New Year's Holiday did not follow the next-non-holiday rule in 2016.
    holidays = holidays[(holidays.year != 2016)]

    return pd.to_datetime([weekend_to_monday(day) for day in holidays])
예제 #10
0
def new_years_eve_observance(holidays):
    # For some reason New Year's Eve was not a holiday these years.
    holidays = holidays[(holidays.year != 2008) & (holidays.year != 2009)]

    return pd.to_datetime([weekend_to_monday(day) for day in holidays])
예제 #11
0
def new_years_eve_observance(holidays):
    # New Year's Eve is a holiday every year except for 2003 for some reason.
    holidays = holidays[holidays.year != 2003]

    return pd.to_datetime([weekend_to_monday(day) for day in holidays])