Skip to content

Commit

Permalink
Add deprecation warning for old ARIMA primitive (#10)
Browse files Browse the repository at this point in the history
* Bump version: 0.1.4.dev0 → 0.1.4.dev1

* deprecate arima JSON

* add warning
  • Loading branch information
sarahmish authored Oct 1, 2023
1 parent 9297173 commit 84ddb36
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mlstars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = 'MIT Data To AI Lab'
__email__ = '[email protected]'
__version__ = '0.1.4.dev0'
__version__ = '0.1.4.dev1'

import os

Expand Down
12 changes: 11 additions & 1 deletion mlstars/adapters/statsmodels.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import warnings

import numpy as np
from statsmodels.tsa.arima import model

_ARIMA_MODEL_DEPRECATION_WARNING = (
"statsmodels.tsa.arima_model.Arima is deprecated "
"and will be removed in a future version. Please use "
"statsmodels.tsa.arima.model.ARIMA instead."
)


class ARIMA(object):
"""A Wrapper for the statsmodels.tsa.arima_model.ARIMA class."""
"""A Wrapper for the statsmodels.tsa.arima.model.ARIMA class."""

def __init__(self, p, d, q, trend, steps):
"""Initialize the ARIMA object.
Expand All @@ -22,6 +30,8 @@ def __init__(self, p, d, q, trend, steps):
steps (int):
Integer denoting the number of time steps to predict ahead.
"""
warnings.warn(_ARIMA_MODEL_DEPRECATION_WARNING, DeprecationWarning)

self.p = p
self.d = d
self.q = q
Expand Down
4 changes: 4 additions & 0 deletions mlstars/primitives/statsmodels.tsa.arima.model.ARIMA.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
},
"hyperparameters": {
"fixed": {
"trend": {
"type": "str",
"default": "t"
},
"steps": {
"type": "int",
"default": 10
Expand Down
66 changes: 66 additions & 0 deletions mlstars/primitives/statsmodels.tsa.arima_model.Arima.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "statsmodels.tsa.arima_model.Arima",
"contributors": [
"Alexander Geiger <[email protected]>"
],
"description": "ARIMA Model; mstatsmodels.tsa.arima_model.Arima is deprecated and will be removed in a future version. Please use statsmodels.tsa.arima.model.ARIMA instead.",
"classifiers": {
"type": "estimator",
"subtype": "regressor"
},
"modalities": [],
"primitive": "mlstars.adapters.statsmodels.ARIMA",
"produce": {
"method": "predict",
"args": [
{
"name": "X",
"type": "ndarray"
}
],
"output": [
{
"name": "y",
"type": "ndarray"
}
]
},
"hyperparameters": {
"fixed": {
"trend": {
"type": "str",
"default": "t"
},
"steps": {
"type": "int",
"default": 10
}
},
"tunable": {
"p": {
"type": "int",
"default": 1,
"range": [
0,
40
]
},
"d": {
"type": "int",
"default": 0,
"range": [
0,
3
]
},
"q": {
"type": "int",
"default": 0,
"range": [
0,
12
]
}
}
}
}
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.4.dev0
current_version = 0.1.4.dev1
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@
test_suite='tests',
tests_require=tests_require,
url='https://github.com/sintel-dev/ml-stars',
version='0.1.4.dev0',
version='0.1.4.dev1',
zip_safe=False,
)

0 comments on commit 84ddb36

Please sign in to comment.