Fix issue with holidays in some years

This commit is contained in:
Ben Letham 2020-09-03 16:47:22 -07:00
parent 5e88ede101
commit cb966a5244
4 changed files with 4 additions and 8 deletions

View file

@ -7,4 +7,4 @@
from fbprophet.forecaster import Prophet
__version__ = '0.7'
__version__ = '0.7.1'

View file

@ -54,10 +54,10 @@ def make_holidays_df(year_list, country, province=None, state=None):
to 'holidays' params in Prophet
"""
try:
holidays = getattr(hdays_part2, country)(years=year_list)
holidays = getattr(hdays_part2, country)(years=year_list, expand=False)
except AttributeError:
try:
holidays = getattr(hdays_part1, country)(prov=province, state=state, years=year_list)
holidays = getattr(hdays_part1, country)(prov=province, state=state, years=year_list, expand=False)
except AttributeError as e:
raise AttributeError(
"Holidays in {} are not currently supported!".format(country)) from e

View file

@ -207,10 +207,6 @@ class TestProphet(TestCase):
future['floor'] += 10.
m2.fit(history2, algorithm='Newton')
self.assertAlmostEqual(m2.history['y_scaled'][0], 1.)
fcst2 = m2.predict(future)
fcst2['yhat'] -= 10.
# Check for approximate shift invariance
self.assertTrue((np.abs(fcst1['yhat'] - fcst2['yhat']) < 1).all())
def test_flat_growth(self):
m = Prophet(growth='flat')

View file

@ -121,7 +121,7 @@ with open('requirements.txt', 'r') as f:
setup(
name='fbprophet',
version='0.7',
version='0.7.1',
description='Automatic Forecasting Procedure',
url='https://facebook.github.io/prophet/',
author='Sean J. Taylor <sjtz@pm.me>, Ben Letham <bletham@fb.com>',