diff --git a/python/chronos/src/bigdl/chronos/forecaster/__init__.py b/python/chronos/src/bigdl/chronos/forecaster/__init__.py index d1ccb8dd48a..68263bc74b3 100644 --- a/python/chronos/src/bigdl/chronos/forecaster/__init__.py +++ b/python/chronos/src/bigdl/chronos/forecaster/__init__.py @@ -21,6 +21,7 @@ tf_available = False prophet_available = False arima_available = False +orca_available = False try: import torch torch_available = True @@ -43,13 +44,19 @@ arima_available = True except: warnings.warn("Please install `pmdarima` to use ARIMAForecaster.") +try: + import bigdl.orca + orca_available = True +except: + warnings.warn("Please install `bigdl-orca` to use full collection of forecasters.") # import forecasters if torch_available: from .lstm_forecaster import LSTMForecaster from .tcn_forecaster import TCNForecaster from .seq2seq_forecaster import Seq2SeqForecaster - from .tcmf_forecaster import TCMFForecaster + if orca_available: + from .tcmf_forecaster import TCMFForecaster if tf_available: from .mtnet_forecaster import MTNetForecaster if prophet_available: diff --git a/python/chronos/src/setup-lite.py b/python/chronos/src/setup-lite.py new file mode 100644 index 00000000000..b9cff3e8d39 --- /dev/null +++ b/python/chronos/src/setup-lite.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +# +# Copyright 2016 The BigDL Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys +from shutil import copyfile, copytree, rmtree +import fnmatch +from setuptools import setup + +bigdl_home = os.path.abspath(__file__ + "/../../../..") +exclude_patterns = ["*__pycache__*", "*ipynb_checkpoints*"] + +VERSION = open(os.path.join(bigdl_home, 'python/version.txt'), 'r').read().strip() + + +def get_bigdl_packages(): + bigdl_python_home = os.path.abspath(__file__ + "/..") + bigdl_packages = [] + source_dir = os.path.join(bigdl_python_home, "bigdl") + for dirpath, dirs, files in os.walk(source_dir): + package = dirpath.split(bigdl_python_home)[1].replace('/', '.') + if any(fnmatch.fnmatchcase(package, pat=pattern) + for pattern in exclude_patterns): + print("excluding", package) + else: + bigdl_packages.append(package) + print("including", package) + return bigdl_packages + + +def setup_package(): + metadata = dict( + name='bigdl-chronos-lite', + version=VERSION, + description='Scalable time series analysis using AutoML', + author='BigDL Authors', + author_email='bigdl-user-group@googlegroups.com', + license='Apache License, Version 2.0', + url='https://github.com/intel-analytics/BigDL', + packages=get_bigdl_packages(), + install_requires=['bigdl-nano[pytorch]', 'pandas>=1.0.5, <1.3.0', + 'scikit-learn', 'statsmodels'], + include_package_data=True, + classifiers=[ + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: Implementation :: CPython'], + platforms=['mac', 'linux'] + ) + + setup(**metadata) + + +if __name__ == '__main__': + setup_package()