Closed seriousran closed 4 years ago
To solve this issue #1437 in prophet by @chongdae and this PR #1438 in prophet
cc @chongdae @1kko
code1:
import holidays import numpy as np holidays.__version__
output:
'0.10.2'
code2:
holidays.Korea(years=np.arange(1995, 2045))
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-16-a964978a10b6> in <module> ----> 1 holidays.Korea(years=np.arange(1995, 2045)) ~/anaconda3/envs/tf36/lib/python3.7/site-packages/holidays/countries/korea.py in __init__(self, **kwargs) 33 def __init__(self, **kwargs): 34 self.country = "KR" ---> 35 HolidayBase.__init__(self, **kwargs) 36 self.korean_cal = KoreanLunarCalendar() 37 ~/anaconda3/envs/tf36/lib/python3.7/site-packages/holidays/holiday_base.py in __init__(self, years, expand, observed, prov, state) 32 self.state = state 33 for year in list(self.years): ---> 34 self._populate(year) 35 36 def __setattr__(self, key, value): ~/anaconda3/envs/tf36/lib/python3.7/site-packages/holidays/countries/korea.py in _populate(self, year) 59 second_day_lunar = "The second day of " + name 60 ---> 61 dt = self.get_solar_date(year, 1, 1) 62 new_year_date = date(dt.year, dt.month, dt.day) 63 if self.observed and year >= 2015: ~/anaconda3/envs/tf36/lib/python3.7/site-packages/holidays/countries/korea.py in get_solar_date(self, year, month, day) 187 # convert lunar calendar date to solar 188 def get_solar_date(self, year, month, day): --> 189 self.korean_cal.setLunarDate(year, month, day, False) 190 return date(self.korean_cal.solarYear, self.korean_cal.solarMonth, 191 self.korean_cal.solarDay) AttributeError: 'Korea' object has no attribute 'korean_cal'
Merged, thank you very much! 👍
To solve this issue #1437 in prophet by @chongdae and this PR #1438 in prophet
cc @chongdae @1kko
code1:
output:
code2:
output: