From ebaa13cbf0729ae74d116bf72d2124f0a3109d1a Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Thu, 28 Nov 2024 13:37:58 +0100 Subject: [PATCH] Update project information and workflows (#214) *Description of changes:* This PR updates project information and workflows to allow for PyPi release. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Abdul Fatir Ansari --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-to-pypi.yml | 27 +++++++++++++++++++++++++ README.md | 25 +++++++++++++++++------ pyproject.toml | 29 +++++++++++++++++++++++++-- 4 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b206df..d6dee6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: ["**"] # Run on any branch + branches: ["main"] # Run only on main branch pull_request: branches: ["**"] # Run on any branch schedule: @@ -14,7 +14,7 @@ jobs: max-parallel: 4 fail-fast: false matrix: - python-version: ["3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} @@ -35,7 +35,7 @@ jobs: max-parallel: 4 fail-fast: false matrix: - python-version: ["3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..b15306b --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,27 @@ +name: Publish Python Package to PyPi + +on: + release: + types: [published] + +jobs: + deploy-to-pypi: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install setuptools wheel build + - name: Build package + run: | + python -m build + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/README.md b/README.md index 1b9b647..7c09b8e 100644 --- a/README.md +++ b/README.md @@ -74,11 +74,22 @@ The following figure showcases the remarkable **zero-shot** performance of Chron ## 📈 Usage -To perform inference with Chronos or Chronos-Bolt models, install this package by running: +To perform inference with Chronos or Chronos-Bolt models, the easiest way is to install this package through `pip`: +```sh +pip install chronos-forecasting ``` -pip install git+https://github.com/amazon-science/chronos-forecasting.git + +If you're interested in pretraining, fine-tuning, and other research & development, clone and install the package from source: + +```sh +# Clone the repository +git clone https://github.com/amazon-science/chronos-forecasting.git + +# Install in editable mode with extra training-related dependencies +pip install --editable ".[training]" ``` + > [!TIP] > This repository is intended for research purposes and provides a minimal interface to Chronos models. The recommended way of using Chronos for production use cases is through [AutoGluon](https://auto.gluon.ai), which features effortless fine-tuning, augmenting Chronos models with exogenous information through covariate regressors, ensembling with other statistical and machine learning models, as well as seamless deployments on AWS with SageMaker 🧠. Check out the AutoGluon Chronos [tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html). @@ -196,10 +207,12 @@ If you find Chronos models useful for your research, please consider citing the ``` @article{ansari2024chronos, - author = {Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Wang, Hao and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang}, - title = {Chronos: Learning the Language of Time Series}, - journal = {arXiv preprint arXiv:2403.07815}, - year = {2024} + title={Chronos: Learning the Language of Time Series}, + author={Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan, and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang}, + journal={Transactions on Machine Learning Research}, + issn={2835-8856}, + year={2024}, + url={https://openreview.net/forum?id=gerNCVqqtR} } ``` diff --git a/pyproject.toml b/pyproject.toml index c3b916d..f24a74b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,33 @@ [project] -name = "chronos" +name = "chronos-forecasting" version = "1.3.0" -requires-python = ">=3.8" +authors = [ + { name="Abdul Fatir Ansari", email="ansarnd@amazon.com" }, + { name="Lorenzo Stella", email="stellalo@amazon.com" }, + { name="Caner Turkmen", email="atturkm@amazon.com" }, +] +description = "Chronos: Pretrained models for time series forecasting" +readme = "README.md" license = { file = "LICENSE" } +requires-python = ">=3.9" dependencies = [ "torch>=2.0,<2.6", # package was tested on 2.2 "transformers>=4.30,<4.48", "accelerate>=0.32,<1", ] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering :: Artificial Intelligence", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src/chronos"] [project.optional-dependencies] test = ["pytest~=8.0", "numpy~=1.21"] @@ -15,5 +35,10 @@ typecheck = ["mypy~=1.9"] training = ["gluonts[pro]~=0.15", "numpy~=1.21", "datasets~=2.18", "typer", "typer-config", "joblib", "scikit-learn", "tensorboard"] evaluation = ["gluonts[pro]~=0.15", "numpy~=1.21", "datasets~=2.18", "typer"] +[project.urls] +Homepage = "https://github.com/amazon-science/chronos-forecasting" +Issues = "https://github.com/amazon-science/chronos-forecasting/issues" +Paper = "https://arxiv.org/abs/2403.07815" + [tool.mypy] ignore_missing_imports = true