Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ environment.yml
settings.ini
setup.py
pyproject.toml
nixtlats/nixtla_client.py
nixtlats/utils.py
nixtlats/_modidx.py
nixtlats/__init__.py
nixtlats/distributed/
nixtlats/date_features.py
nixtla/nixtla_client.py
nixtla/utils.py
nixtla/_modidx.py
nixtla/__init__.py
nixtla/distributed/
nixtla/date_features.py
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:

- name: Check import
run: |
python -c "from nixtlats import TimeGPT;"
python -c "from nixtlats import NixtlaClient;"
python -c "from nixtla import TimeGPT;"
python -c "from nixtla import NixtlaClient;"

run-tests:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/models-performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
cache-environment: true

- name: Install pip requirements
run: pip install ./
run: pip install '.[plotting]'

- name: Run evaluation
run: python -m action_files.models_performance.main
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Upload Python Packages

on:
release:
types: [published]

permissions:
contents: read
push:
tags: ['v*']

jobs:
deploy:

runs-on: ubuntu-latest

permissions:
id-token: write
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m pip install --upgrade pip && pip install build

- name: Build nixtla package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish nixtla package
uses: pypa/gh-action-pypi-publish@release/v1

- name: Build nixtlats package
run: >
rm -rf build dist &&
mv nixtla nixtlats &&
sed -i 's/name="nixtla"/name="nixtlats"/g' setup.py &&
find nixtlats -type f -name '*.py' -exec sed -i 's/from nixtla/from nixtlats/g' {} + &&
echo -e 'import warnings\nwarnings.warn("This package is deprecated, please install nixtla instead.", category=FutureWarning)' >> nixtlats/__init__.py &&
python -m build

- name: Publish nixtlats package
uses: pypa/gh-action-pypi-publish@release/v1
42 changes: 42 additions & 0 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Upload Python Packages to TestPyPI

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: python -m pip install --upgrade pip && pip install build

- name: Build nixtla package
run: python -m build

- name: Publish nixtla package
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Build nixtlats package
run: >
rm -rf build dist &&
mv nixtla nixtlats &&
sed -i 's/name="nixtla"/name="nixtlats"/g' setup.py &&
find nixtlats -type f -name '*.py' -exec sed -i 's/from nixtla/from nixtlats/g' {} + &&
echo -e 'import warnings\nwarnings.warn("This package is deprecated, please install nixtla instead.", category=FutureWarning)' >> nixtlats/__init__.py &&
python -m build

- name: Publish nixtlats package
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ nbs/.last_checked
.env
*/summary.md
*/*.png
longhorizon
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ The repo comes with an `environment.yml` file which contains the libraries neede
Once you have `conda` go to the top level directory of the repository and run the following lines (we recommend to use `python=3.10` for development):

```
conda create -n nixtlats python=3.10
conda activate nixtlats
conda create -n nixtla python=3.10
conda activate nixtla
conda env update -f environment.yml
```

#### Install the library
Once you have your environment setup, activate it using `conda activate nixtlats` and then install the library in editable mode using `pip install -e ".[dev]"`
Once you have your environment setup, activate it using `conda activate nixtla` and then install the library in editable mode using `pip install -e ".[dev]"`

#### Set Up TimeGPT token
This library uses `python-dotenv` for development. To set up your TimeGPT token, add the following lines to your `.env` file:
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<div align="center">
<img src="https://raw.githubusercontent.com/Nixtla/neuralforecast/main/nbs/imgs_indx/logo_mid.png">
<h1 align="center">NixtlaTS</h1>
<h1 align="center">Nixtla</h1>
<h3 align="center">Forecast using TimeGPT</h3>

[![CI](https://github.com/Nixtla/nixtla/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/Nixtla/nixtla/actions/workflows/ci.yaml)
[![Python](https://img.shields.io/pypi/pyversions/nixtlats)](https://pypi.org/project/nixtlats/)
[![PyPi](https://img.shields.io/pypi/v/nixtlats?color=blue)](https://pypi.org/project/nixtlats/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/Nixtla/nixtlats/blob/main/LICENSE)
[![Python](https://img.shields.io/pypi/pyversions/nixtla)](https://pypi.org/project/nixtla/)
[![PyPi](https://img.shields.io/pypi/v/nixtla?color=blue)](https://pypi.org/project/nixtla/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/Nixtla/nixtla/blob/main/LICENSE)
[![docs](https://img.shields.io/website-up-down-green-red/http/nixtla.github.io/nixtla.svg?label=docs)](https://nixtla.github.io/nixtla/)
[![Downloads](https://pepy.tech/badge/nixtlats)](https://pepy.tech/project/nixtlats)
[![Downloads](https://pepy.tech/badge/nixtla)](https://pepy.tech/project/nixtla)

**NixtlaTS** offers a collection of classes and methods to interact with the API of TimeGPT.
**Nixtla** offers a collection of classes and methods to interact with the API of TimeGPT.
</div>

# 🕰️ TimeGPT: Revolutionizing Time-Series Analysis
Expand All @@ -25,16 +25,16 @@ In seconds, TimeGPT can discern complex patterns and predict future data points,

In addition to its core capabilities, TimeGPT supports fine-tuning, enhancing its specialization for specific prediction tasks. 🎯 This feature is like training a machine learning model on a targeted data subset to improve its task-specific performance, making TimeGPT an even more versatile tool for your predictive needs.

## 🔄 `NixtlaTS`: Your Gateway to TimeGPT
## 🔄 `Nixtla`: Your Gateway to TimeGPT

With `NixtlaTS`, you can easily interact with TimeGPT through simple API calls, making the power of TimeGPT readily accessible in your projects.
With `Nixtla`, you can easily interact with TimeGPT through simple API calls, making the power of TimeGPT readily accessible in your projects.

## 💻 Installation

Get `NixtlaTS` up and running with a simple pip command:
Get `Nixtla` up and running with a simple pip command:

```python
pip install nixtlats>=0.1.0
pip install nixtla>=0.1.0
```

## 🎈 Quick Start
Expand All @@ -44,7 +44,7 @@ Get started with TimeGPT now:
```python
df = pd.read_csv('https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv')

from nixtlats import NixtlaClient
from nixtla import NixtlaClient
nixtla = NixtlaClient(
# defaults to os.environ.get("NIXTLA_API_KEY")
api_key = 'my_api_key_provided_by_nixtla'
Expand Down
10 changes: 6 additions & 4 deletions action_files/models_performance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from utilsforecast.evaluation import evaluate
from utilsforecast.losses import mae, mape, mse

from nixtlats import NixtlaClient
from nixtla import NixtlaClient


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -144,9 +144,11 @@ def evaluate_timegpt(self, model: str) -> Tuple[pd.DataFrame, pd.DataFrame]:
timegpt = NixtlaClient()
fcst_df = timegpt.forecast(
df=self.df_train,
X_df=self.df_test.drop(columns=self.target_col)
if self.df.shape[1] > 3
else None,
X_df=(
self.df_test.drop(columns=self.target_col)
if self.df.shape[1] > 3
else None
),
h=self.h,
freq=self.freq,
level=self.level,
Expand Down
5 changes: 2 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: nixtlats
name: nixtla
channels:
- conda-forge
dependencies:
- dask
- dask<=2024.2.1
- jupyterlab
- pandas<2.2
- plotly
- prophet
- pyspark>=3.3
- pip:
- black
Expand Down
2 changes: 1 addition & 1 deletion experiments/azure-automl-forecasting/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ azure-identity
azureml-core
fire
mltable
nixtlats
nixtla
pandas
python-dotenv
rich
Expand Down
2 changes: 1 addition & 1 deletion experiments/azure-automl-forecasting/src/nixtla_timegpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import fire
from dotenv import load_dotenv
from nixtlats import TimeGPT
from nixtla import TimeGPT

from src.utils.data_handler import ExperimentDataset, ForecastDataset

Expand Down
2 changes: 1 addition & 1 deletion experiments/prophet/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- python=3.10
- pip:
- fire
- nixtlats
- nixtla
- python-dotenv
- statsforecast
- utilsforecast
Expand Down
2 changes: 1 addition & 1 deletion experiments/prophet/src/timegpt_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import fire
from dotenv import load_dotenv
from nixtlats import TimeGPT
from nixtla import TimeGPT

from src.tools import ExperimentHandler

Expand Down
4 changes: 2 additions & 2 deletions nbs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ website:
href: https://join.slack.com/t/nixtlaworkspace/shared_invite/zt-135dssye9-fWTzMpv2WBthq8NK0Yvu6A
right:
- icon: github
href: "https://github.com/nixtla/nixtlats"
href: "https://github.com/nixtla/nixtla"
- icon: twitter
href: https://twitter.com/nixtlainc
aria-label: Nixtla Twitter

sidebar:
style: floating
body-footer: |
Give us a ⭐ on [Github](https://github.com/nixtla/nixtlats)
Give us a ⭐ on [Github](https://github.com/nixtla/nixtla)

metadata-files: [nbdev.yml, sidebar.yml]
2 changes: 1 addition & 1 deletion nbs/date_features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
" except ModuleNotFoundError:\n",
" raise Exception(\n",
" 'You have to install additional libraries to use holidays, '\n",
" 'please install them using `pip install \"nixtlats[date_extras]\"`'\n",
" 'please install them using `pip install \"nixtla[date_extras]\"`'\n",
" )\n",
" return _get_holidays_df(dates, self.countries, country_holidays, list_supported_countries())\n",
" \n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/distributed.nixtla_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
" return fcst_df\n",
" \n",
" def _instantiate_nixtla_client(self):\n",
" from nixtlats.nixtla_client import _NixtlaClient\n",
" from nixtla.nixtla_client import _NixtlaClient\n",
" nixtla_client = _NixtlaClient(\n",
" api_key=self.api_key, \n",
" base_url=self.base_url,\n",
Expand Down
4 changes: 2 additions & 2 deletions nbs/docs/getting-started/1_getting_started_short.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"outputs": [],
"source": [
"#| hide\n",
"from nixtlats.utils import colab_badge"
"from nixtla.utils import colab_badge"
]
},
{
Expand Down Expand Up @@ -94,7 +94,7 @@
"metadata": {},
"outputs": [],
"source": [
"from nixtlats import NixtlaClient"
"from nixtla import NixtlaClient"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"metadata": {},
"outputs": [],
"source": [
"from nixtlats import NixtlaClient \n",
"from nixtla import NixtlaClient \n",
"nixtla_client = NixtlaClient(api_key ='your API key here')"
]
},
Expand Down Expand Up @@ -75,7 +75,7 @@
"metadata": {},
"outputs": [],
"source": [
"from nixtlats import NixtlaClient\n",
"from nixtla import NixtlaClient\n",
"nixtla_client = NixtlaClient()"
]
},
Expand Down Expand Up @@ -137,7 +137,7 @@
"from dotenv import load_dotenv\n",
"load_dotenv()\n",
"\n",
"from nixtlats import NixtlaClient\n",
"from nixtla import NixtlaClient\n",
"nixtla_client = NixtlaClient()"
]
},
Expand Down
Loading