- Ensure the bug was not already reported by searching on GitHub under Issues.
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
- Be sure to add the complete error messages.
- Ensure that it hasn't been yet implemented in the
main
branch of the repository and that there's not an Issue requesting it yet. - Open a new issue and make sure to describe it clearly, mention how it improves the project and why its useful.
Bug fixes and features are added through pull requests (PRs).
- Keep each PR focused. While it's more convenient, do not combine several unrelated fixes together. Create as many branches as needing to keep each PR focused.
- Ensure that your PR includes a test that fails without your patch, and passes with it.
- Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
- Do not mix style changes/fixes with "functional" changes. It's very difficult to review such PRs and it most likely get rejected.
- Do not add/remove vertical whitespace. Preserve the original style of the file you edit as much as you can.
- Do not turn an already submitted PR into your development playground. If after you submitted PR, you discovered that more work is needed - close the PR, do the required work and then submit a new PR. Otherwise each of your commits requires attention from maintainers of the project.
- If, however, you submitted a PR and received a request for changes, you should proceed with commits inside that PR, so that the maintainer can see the incremental fixes and won't need to review the whole PR again. In the exception case where you realize it'll take many many commits to complete the requests, then it's probably best to close the PR, do the work and then submit it again. Use common sense where you'd choose one way over another.
- HTTPS:
git clone https://github.com/Nixtla/nixtla.git
- SSH:
git clone [email protected]:Nixtla/nixtla.git
- GitHub CLI:
gh repo clone Nixtla/nixtla
Create a virtual environment to install the library's dependencies. We recommend astral's uv. Once you've created the virtual environment you should activate it and then install the library in editable mode along with its development dependencies.
pip install uv
uv venv --python 3.10
source .venv/bin/activate
uv pip install -Ue .[dev]
# If you plan to contribute to documentation, you will also need to install the
# distributed dependencies in addition to the dev dependencies
uv pip install -Ue .[dev,distributed]
This library uses python-dotenv
for development. To set up your Nixtla API key, add the following lines to your .env
file:
NIXTLA_API_KEY=<your token>
- NOTE: You can get your Nixtla API key by logging into Nixtla Dashboard where you can get few API calls for free. If you need more API calls for development purpose, please write to
[email protected]
.
Before doing any changes to the code, please install the git hooks that run automatic scripts during each commit and merge to strip the notebooks of superfluous metadata (and avoid merge conflicts).
nbdev_install_hooks
pre-commit install
You can preview changes in your local browser before pushing by using the nbdev_preview
.
The library is built using the notebooks contained in the nbs
folder. If you want to make any changes to the library you have to find the relevant notebook, make your changes and then call:
nbdev_export
If you're working on the local interface you can just use nbdev_test --n_workers 1 --do_print --timing
.
Since the notebooks output cells can vary from run to run (even if they produce the same outputs) the notebooks are cleaned before committing them. Please make sure to run nbdev_clean
before committing your changes.
Docs are automatically created from the notebooks in the nbs
folder.
- Find the relevant notebook.
- Make your changes.
- Do not rename the document.
- Do not change the first header (title). The first header is used in Readme.com to create the filename. For example, a first header of
TimeGPT Subscription Plans and Pricing
in foldergetting-started
will result in the following online link to the document:https://docs.nixtla.io/docs/getting-started-timegpt_subscription_plans_and_pricing
.
- Run all cells.
- Run
nbdev_preview
. - Clean the notebook metadata using
nbdev_clean --fname nbs/docs/[path_to_notebook.ipynb]
. - Add, commit and push the changes.
- Open a PR.
- Follow the steps under 'Publishing documentation'
- Copy an existing jupyter notebook in a folder where you want to create a new document. This should be a subfolder of
nbs/docs
. - Rename the document using the following format:
[document_number]_document_title_in_lower_case.ipynb
(for example:01_quickstart.ipynb
), incrementing the document number from the current highest number within the folder and retaining the leading zero. - The first header (title) is ideally the same as the notebook name (without the document number). This is because in Readme.com the first header (title) is used to create the filename. For example, a first header of
TimeGPT Subscription Plans and Pricing
of a document in foldergetting-started
will result in the following online link to the document:https://docs.nixtla.io/docs/getting-started-timegpt_subscription_plans_and_pricing
. Thus, it is advised to keep the document name and header the same. - Work on your new document. Pay attention to:
- The Google Colab link;
- How images should be linked;
- How the
IN_COLAB
variable is used to distinguish when the notebook is used locally vs in Google Colab.
- Add the document to
nbs/mint.json
under the correct group with the following namedocument_title_in_lower_case.html
. - Follow steps 3 - 8 under
Modifying an existing doc
.
When the PR is approved, the documentation will not be visible directly. It will be visible:
- When we make a release
- When you manually trigger the workflows required to publish. The workflows you need to manually trigger under Actions, in order, are:
- The
build-docs
workflow on branchmain
. Use theRun workflow
button on the right and choose themain
branch. - The
Deploy to readme dot com
workflow on branchmain
. Use theRun workflow
button on the right and choose themain
branch.
- After both workflows have completed (should take max. 10 minutes), check the docs to see if your changes have been reflected.
- The
It could be that on our Readme.com docs, the newly created document is not in the correct (sub)folder.
- Go to the
Log In
(top right corner), log in with your Nixtla account. - Go to the Admin Dashboard (top right, under user-name)
- On the left, go to
Guides
. You now see an overview of the documentation and the structure. - Simply drag and drop the document that is in the incorrect (sub)folder to the correct (sub)folder. The document will from hereon remain in the correct (sub)folder, even if you update its contents.
Make sure to check that our Mintlify docs also work as expected, and your change is reflected there too. Mintlify is commonly somewhat slower syncing the docs, so it could a bit more time to reflect the change.
- Don't rename documents! The filename is used statically in various files to properly index the file in the correct (sub)folder. If you rename, you're effectively creating a new document. Follow the correct procedure for creating a new document (above), and check every other document (yes, every single one) in our documentation whether there's a link now breaking to the doc you renamed.
- Check the changes / new document online in both Readme.com and Mintlify.
- Screwed up? You can hide a document in Readme.com in the Admin console, under
Guides
. Make sure to unhide it again after you've fixed your misstakes.