lint fixes

This commit is contained in:
Ben Letham 2017-07-11 16:51:29 -07:00
parent d48b70b106
commit fb517b53d6
2 changed files with 10 additions and 10 deletions

View file

@ -28,7 +28,7 @@ from fbprophet.models import prophet_stan_models
# fb-block 1 end # fb-block 1 end
try: try:
import pystan import pystan # noqa F401
except ImportError: except ImportError:
logger.error('You cannot run prophet without pystan installed') logger.error('You cannot run prophet without pystan installed')
raise raise
@ -312,7 +312,7 @@ class Prophet(object):
expanded_holidays = defaultdict(lambda: np.zeros(dates.shape[0])) expanded_holidays = defaultdict(lambda: np.zeros(dates.shape[0]))
# Makes an index so we can perform `get_loc` below. # Makes an index so we can perform `get_loc` below.
# Strip to just dates. # Strip to just dates.
row_index = pd.DatetimeIndex(dates.apply(lambda x:x.date())) row_index = pd.DatetimeIndex(dates.apply(lambda x: x.date()))
for _ix, row in self.holidays.iterrows(): for _ix, row in self.holidays.iterrows():
dt = row.ds.date() dt = row.ds.date()

View file

@ -10,16 +10,13 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
from __future__ import unicode_literals from __future__ import unicode_literals
import os
import numpy as np import numpy as np
import pandas as pd import pandas as pd
# fb-block 1 start # fb-block 1 start
import os
from unittest import TestCase from unittest import TestCase
from fbprophet import Prophet from fbprophet import Prophet
# fb-block 1 end
# fb-block 2
DATA = pd.read_csv( DATA = pd.read_csv(
os.path.join(os.path.dirname(__file__), 'data.csv'), os.path.join(os.path.dirname(__file__), 'data.csv'),
@ -29,6 +26,9 @@ DATA2 = pd.read_csv(
os.path.join(os.path.dirname(__file__), 'data2.csv'), os.path.join(os.path.dirname(__file__), 'data2.csv'),
parse_dates=['ds'], parse_dates=['ds'],
) )
# fb-block 1 end
# fb-block 2
class TestProphet(TestCase): class TestProphet(TestCase):