Skip to content

Commit

Permalink
Merge pull request #22 from vonum/update-fbprophet-version
Browse files Browse the repository at this point in the history
Update fbprophet to new prophet
  • Loading branch information
vonum committed Sep 5, 2022
2 parents 1792fa5 + 982899e commit d938f9d
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Initial Pipeline
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
os_image: ubuntu2004
blocks:
- name: tests
task:
jobs:
- name: unit tests
commands:
- sem-version python 3.7
- sem-version python 3.8
- checkout
- pip install -r requirements.txt
- python -m pytest tests
Expand All @@ -19,6 +19,6 @@ blocks:
jobs:
- name: build package
commands:
- sem-version python 3.7
- sem-version python 3.8
- checkout
- python3 setup.py sdist bdist_wheel
2 changes: 1 addition & 1 deletion multi_prophet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .prophet import Prophet
from .factories import model_pool_factory, dataframe_builder_factory

__version__ = "1.0.1"
__version__ = "1.1.0"


class MultiProphet:
Expand Down
2 changes: 1 addition & 1 deletion multi_prophet/plots.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fbprophet.plot import plot_plotly, plot_components_plotly
from prophet.plot import plot_plotly, plot_components_plotly


def plotly_plot(model, forecast, **kwargs):
Expand Down
7 changes: 3 additions & 4 deletions multi_prophet/prophet.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import fbprophet
from fbprophet.diagnostics import cross_validation, performance_metrics
import prophet
from prophet.diagnostics import cross_validation, performance_metrics
from . import plots


class Prophet:

def __init__(self, **kwargs):
self.prophet = fbprophet.Prophet(**kwargs)
self.prophet = prophet.Prophet(**kwargs)

def fit(self, df, **kwargs):
self.prophet.fit(df, **kwargs)
Expand Down
38 changes: 21 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
appnope==0.1.0
attrs==19.3.0
backcall==0.1.0
cmdstanpy==0.4.0
convertdate==2.2.0
attrs==22.1.0
cmdstanpy==0.9.68
convertdate==2.4.0
cycler==0.10.0
Cython==0.29.16
decorator==4.4.2
ephem==3.7.7.1
fbprophet==0.6
holidays==0.10.1
importlib-metadata==1.6.0
ipython==7.13.0
fonttools==4.37.1
hijri-converter==2.2.4
holidays==0.15
iniconfig==1.1.1
ipython-genutils==0.2.0
jedi==0.16.0
kiwisolver==1.2.0
korean-lunar-calendar==0.2.1
LunarCalendar==0.0.9
matplotlib==3.2.1
matplotlib==3.5.3
more-itertools==8.2.0
numpy==1.18.2
numpy==1.21.2
packaging==20.3
pandas==1.0.3
pandas==1.3.2
parso==0.6.2
pexpect==4.8.0
pickleshare==0.7.5
plotly==4.6.0
Pillow==9.2.0
plotly==5.10.0
pluggy==0.13.1
prompt-toolkit==3.0.5
prophet==1.0
ptyprocess==0.6.0
py==1.8.1
py==1.11.0
Pygments==2.6.1
PyMeeus==0.3.7
PyMeeus==0.5.11
pyparsing==2.4.7
pystan==2.19.1.1
pytest==5.4.1
pytest==7.1.3
python-dateutil==2.8.1
pytz==2019.3
retrying==1.3.3
setuptools-git==1.2
six==1.14.0
tenacity==8.0.1
tomli==2.0.1
tqdm==4.64.1
traitlets==4.3.3
ujson==5.4.0
wcwidth==0.1.9
zipp==3.1.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="multi-prophet",
version="1.0.1",
version="1.1.0",
author="Milan Keca",
author_email="vonum.mk@gmail.com",
description="Multivariate forecasting using Facebook Prophet",
Expand Down
1 change: 0 additions & 1 deletion tests/test_data_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class DataBuilderTestCase(unittest.TestCase):

def setUp(self):
self.df = pd.read_csv("tests/data/example_wp_log_peyton_manning.csv")
self.df["y1"] = self.df["y"]
Expand Down
5 changes: 2 additions & 3 deletions tests/test_factories.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import unittest
import fbprophet
import prophet
import multi_prophet

PREDICTOR_COLUMNS = ["y1", "y2"]

PREDICTOR_COLUMNS = ["y1", "y2"]

class FactoriesTestCase(unittest.TestCase):

def test_no_args(self):
model_pool = multi_prophet.model_pool_factory(columns=PREDICTOR_COLUMNS)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_multi_prophet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import matplotlib
import multi_prophet

PREDICTOR_COLUMNS = ["y", "y1"]

PREDICTOR_COLUMNS = ["y", "y1"]

class MultiProphetTestCase(unittest.TestCase):

Expand All @@ -14,7 +14,7 @@ def setUp(self):
self.df["y1"] = self.df["y"]

def test_version(self):
self.assertEqual("0.3.0", multi_prophet.__version__)
self.assertEqual("1.1.0", multi_prophet.__version__)

def test_constructor(self):
mp = multi_prophet.MultiProphet(columns=PREDICTOR_COLUMNS)
Expand Down
5 changes: 2 additions & 3 deletions tests/test_prophet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
import pandas as pd
import matplotlib
import plotly
import fbprophet
import prophet
import multi_prophet


class ProphetTestCase(unittest.TestCase):

def setUp(self):
self.df = pd.read_csv("tests/data/example_wp_log_peyton_manning.csv")

def test_constructor(self):
mp = multi_prophet.Prophet()
self.assertIsNotNone(mp)
self.assertIsInstance(mp.prophet, fbprophet.Prophet)
self.assertIsInstance(mp.prophet, prophet.Prophet)

def test_constructor_kwargs(self):
mp = multi_prophet.Prophet(growth="logistic")
Expand Down

0 comments on commit d938f9d

Please sign in to comment.