Skip to content

Commit

Permalink
Dev/upgrade prophet 1.1 (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
jklaise committed Sep 27, 2022
1 parent 7517112 commit df7edca
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 32 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
branches:
- master
- 'feature/*'
types: [opened, synchronize, reopened, ready_for_review]
types: [ opened, synchronize, reopened, ready_for_review ]
# Trigger workflow once per week
schedule:
- cron: '0 0 * * *'
Expand All @@ -29,13 +29,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
python-version: [ '3.7', '3.8', '3.9', '3.10.6' ]
include: # Run macos and windows tests on only one python version
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.10.6'
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.10.6'

steps:
- name: Checkout code
Expand All @@ -51,13 +51,10 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt
python -m pip install --upgrade --upgrade-strategy eager -e .
if [ "$RUNNER_OS" != "Windows" ] && ${{ matrix.python-version != '3.10.6' }}; then # Skip Prophet tests on Windows as installation complex. Skip on Python 3.10 as not supported.
python -m pip install --upgrade --upgrade-strategy eager -e .[prophet]
fi
if [ "$RUNNER_OS" == "Linux" ]; then # Currently, we only support KeOps on Linux.
python -m pip install --upgrade --upgrade-strategy eager -e .[keops]
fi
python -m pip install --upgrade --upgrade-strategy eager -e .[tensorflow,torch]
python -m pip install --upgrade --upgrade-strategy eager -e .[prophet,tensorflow,torch]
python -m pip freeze
- name: Lint with flake8
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test_all_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt -r testing/requirements.txt
python -m pip install --upgrade --upgrade-strategy eager -e .
if [ "$RUNNER_OS" != "Windows" ] && ${{ matrix.python-version != '3.10' }}; then # Skip Prophet tests on Windows as installation complex. Skip on Python 3.10 as not supported.
python -m pip install --upgrade --upgrade-strategy eager -e .[prophet]
fi
python -m pip install --upgrade --upgrade-strategy eager -e .[torch,tensorflow]
python -m pip install --upgrade --upgrade-strategy eager -e .[prophet,torch,tensorflow]
python -m pip freeze
- name: Run notebooks
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test_changed_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt -r testing/requirements.txt
python -m pip install --upgrade --upgrade-strategy eager -e .
if [ "$RUNNER_OS" != "Windows" ] && ${{ matrix.python-version != '3.10' }}; then # Skip Prophet tests on Windows as installation complex. Skip on Python 3.10 as not supported.
python -m pip install --upgrade --upgrade-strategy eager -e .[prophet]
fi
python -m pip install --upgrade --upgrade-strategy eager -e .[torch,tensorflow]
python -m pip install --upgrade --upgrade-strategy eager -e .[prophet,torch,tensorflow]
python -m pip freeze
- name: Run notebooks
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
See the [documentation](https://docs.seldon.io/projects/alibi-detect/en/latest/cd/methods/mmddrift.html) and [example notebook](https://docs.seldon.io/projects/alibi-detect/en/latest/examples/cd_mmd_keops.html) for more info ([#548](https://github.com/SeldonIO/alibi-detect/pull/548)).
- If a `categories_per_feature` dictionary is not passed to `TabularDrift`, a warning is now raised to inform the user that all features are assumed to be numerical ([#606](https://github.com/SeldonIO/alibi-detect/pull/606)).

### Changed
- Minimum `prophet` version bumped to `1.1.0` (used by `OutlierProphet`). This upgrade removes the dependency on `pystan` as `cmdstanpy` is used instead. This version also comes with pre-built wheels for all major platforms and Python versions, making both installation and testing easier ([#627](https://github.com/SeldonIO/alibi-detect/pull/627)).

### Development
- UTF-8 decoding is enforced when `README.md` is opened by `setup.py`. This is to prevent pip install errors on systems with `PYTHONIOENCODING` set to use other encoders ([#605](https://github.com/SeldonIO/alibi-detect/pull/605)).
- Skip specific save/load tests that require downloading remote artefacts if the relevant URI(s) is/are down ([#607](https://github.com/SeldonIO/alibi-detect/pull/607)).

## v0.10.3
## [v0.10.3](https://github.com/SeldonIO/alibi-detect/tree/v0.10.3) (2022-08-17)
[Full Changelog](https://github.com/SeldonIO/alibi-detect/compare/v0.10.2...v0.10.3)

### Fixed
- Fix to allow `config.toml` files to be loaded when the [meta] field is not present ([#591](https://github.com/SeldonIO/alibi-detect/pull/591)).

## v0.10.2
## [v0.10.2](https://github.com/SeldonIO/alibi-detect/tree/v0.10.2) (2022-08-16)
[Full Changelog](https://github.com/SeldonIO/alibi-detect/compare/v0.10.1...v0.10.2)

Expand Down
2 changes: 1 addition & 1 deletion alibi_detect/od/prophet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fbprophet import Prophet
from prophet import Prophet
import logging
import pandas as pd
from typing import Dict, List, Union
Expand Down
4 changes: 2 additions & 2 deletions alibi_detect/od/tests/test_prophet.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def prophet_params(request):

@pytest.mark.parametrize('prophet_params', list(range(n_tests)), indirect=True)
def test_prophet(prophet_params):
fbprophet = pytest.importorskip('fbprophet', reason="Prophet tests skipped as Prophet not installed")
prophet = pytest.importorskip('prophet', reason="Prophet tests skipped as Prophet not installed")
growth, return_instance_score, return_forecast = prophet_params
od = OutlierProphet(growth=growth)
assert isinstance(od.model, fbprophet.forecaster.Prophet)
assert isinstance(od.model, prophet.forecaster.Prophet)
assert od.meta == {'name': 'OutlierProphet', 'detector_type': 'outlier', 'data_type': 'time-series',
'online': False, 'version': __version__}
if growth == 'logistic':
Expand Down
4 changes: 1 addition & 3 deletions alibi_detect/utils/missing_optional_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
before the pip install message is issued as this is the most robust place to capture these differences.
"""
ERROR_TYPES = {
"fbprophet": 'prophet',
"holidays": 'prophet',
"pystan": 'prophet',
"prophet": 'prophet',
"tensorflow_probability": 'tensorflow',
"tensorflow": 'tensorflow',
"torch": 'torch',
Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ def readme():

extras_require = {
"prophet": [
"fbprophet>=0.5, <0.7",
"holidays==0.9.11",
"pystan<3.0"
"prophet>=1.1.0, <2.0.0",
],
"torch": [
"torch>=1.7.0, <1.13.0"
Expand All @@ -28,9 +26,7 @@ def readme():
"torch>=1.7.0, <1.13.0"
],
"all": [
"fbprophet>=0.5, <0.7",
"holidays==0.9.11",
"pystan<3.0",
"prophet>=1.1.0, <2.0.0",
"tensorflow_probability>=0.8.0, <0.18.0",
"tensorflow>=2.2.0, !=2.6.0, !=2.6.1, <2.10.0", # https://github.com/SeldonIO/alibi-detect/issues/375 and 387
"pykeops>=2.0.0, <2.2.0",
Expand Down

0 comments on commit df7edca

Please sign in to comment.