Skip to content

Commit

Permalink
Fix formatting issues in docs (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnbeelee authored Oct 16, 2023
1 parent 041a697 commit 0d05a56
Show file tree
Hide file tree
Showing 22 changed files with 205 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dist
tmp
_docs/
_proc/
sidebar.yml
.DS_Store
.gitattributes
.gitconfig
nbs/.last_checked
.venv
.idea
.luarc.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
4 changes: 2 additions & 2 deletions nbs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ format:
toc: true

website:
twitter-card:
twitter-card:
image: "https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg"
site: "@Nixtlainc"
open-graph:
Expand All @@ -35,7 +35,7 @@ website:
href: https://github.com/nixtla/neuralforecast
- text: "HierarchicalForecast 👑"
href: https://github.com/nixtla/hierarchicalforecast

- text: "Help"
menu:
- text: "Report an Issue"
Expand Down
21 changes: 15 additions & 6 deletions nbs/docs/contribute/issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ The form to report the bug will appear.
5. You can also add links, references, logs, screenshots, and so on.

<Info>
Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

</Info>

Thank you for your contribution! Your report aids in refining Nixtla for current and future users.
Expand All @@ -43,7 +45,9 @@ The feature request form will appear.
4. Additional references, links, logs, and screenshots are welcome!

<Info>
Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

</Info>

Thank you for your feature request! It will help us enhance Nixtla for all users.
Expand All @@ -59,7 +63,9 @@ A form for suggesting improvements will appear.
3. Any additional references, links, logs, screenshots are appreciated!

<Info>
Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

</Info>

Thank you for your valuable suggestions! Your input helps us refine Nixtla's documentation.
Expand All @@ -80,7 +86,9 @@ A form for your proposal will appear.
4. Any additional references, links, logs, screenshots, and so on, are welcome!

<Info>
Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

Please ensure that your contributions abide by the [contributing guidelines](https://github.com/nixtla/nixtla/blob/staging/CONTRIBUTING.md) and [code of conduct](https://github.com/nixtla/nixtla/blob/staging/CODE_OF_CONDUCT.md).

</Info>

Thank you for your proposal! Your suggestion helps us extend the capabilities of Nixtla.
Expand All @@ -92,6 +100,7 @@ Thank you for your proposal! Your suggestion helps us extend the capabilities of
- Please be ready to respond to our feedback or questions regarding your issue.

<Note>
This document is based on the documentation from [MindsDB](https://github.com/mindsdb/mindsdb)
</Note>

This document is based on the documentation from [MindsDB](https://github.com/mindsdb/mindsdb)

</Note>
50 changes: 25 additions & 25 deletions nbs/docs/contribute/step-by-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ You can find a detailed step by step buide with screen-shots below.
### 1. Create a fork of the mlforecast repo
The first thing you need to do is create a fork of the GitHub repository to your own account:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/af767f5b-66f1-4068-9dd2-917096285ae9">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/af767f5b-66f1-4068-9dd2-917096285ae9" />

Your fork on your account will look like this:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/912b848d-d3d1-4f79-9d5b-10dd66e1bd35">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/912b848d-d3d1-4f79-9d5b-10dd66e1bd35" />

In that repository, you can make your changes and then request to have them added to the main repo.

Expand All @@ -134,99 +134,99 @@ In this tutorial, we are using Mac (also compatible with other Linux distributio

Once the repository is created, you need to clone it to your own computer. Simply copy the repository URL from GitHub as shown below:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/1331354e-ac24-4222-82f1-71df7077f2e0">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/1331354e-ac24-4222-82f1-71df7077f2e0" />

Then open Visual Studio Code, click on "Clone Git Repository," and paste the line you just copied into the top part of the window, as shown below:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/982827d5-89a6-43d4-8bb8-85bd1758bc10">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/982827d5-89a6-43d4-8bb8-85bd1758bc10" />

Select the folder where you want to copy the repository:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/c1a169e6-df27-41fb-84ee-a441a149e3d6">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/c1a169e6-df27-41fb-84ee-a441a149e3d6" />

And choose to open the cloned repository:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/00140c15-237e-4afa-a47d-078a1afbbac0">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/00140c15-237e-4afa-a47d-078a1afbbac0" />

You will end up with something like this:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/ea4aed6f-2000-4ec8-a242-36b9dfd68d26">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/ea4aed6f-2000-4ec8-a242-36b9dfd68d26" />

### 3. Create the Conda environment

Open a terminal within Visual Studio Code, as shown in the image:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/9b3ed42f-1a68-450c-bffd-a7cee40bb781">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/9b3ed42f-1a68-450c-bffd-a7cee40bb781" />

You can use conda but we highly recommend using Mamba to speed up the creation of the Conda environment. To install it, simply use `conda install mamba -c conda-forge` in the terminal you just opened:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/08482b00-9434-46f0-9452-c3f4920eca6d">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/08482b00-9434-46f0-9452-c3f4920eca6d" />

Create an empty environment named `mlforecast` with the following command: `mamba create -n mlforecast python=3.10`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/5e9032e8-3f5b-4a1c-93e7-3d390d5f73f1">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/5e9032e8-3f5b-4a1c-93e7-3d390d5f73f1" />

Activate the newly created environment using `conda activate mlforecast`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/803ae2b7-8369-4a24-9b7c-9326d52c13ef">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/803ae2b7-8369-4a24-9b7c-9326d52c13ef" />

Install the libraries within the environment file `environment.yml` using `mamba env update -f environment.yml`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/e9672d58-b477-4963-9751-277c944a4d8a">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/e9672d58-b477-4963-9751-277c944a4d8a" />

Now install the library to make interactive changes and other additional dependencies using `pip install -e ".[dev]"`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/501c8223-862d-40a9-8f2d-ecdaceaeaedb">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/501c8223-862d-40a9-8f2d-ecdaceaeaedb" />

### 4. Make the changes you want.

In this section, we assume that we want to increase the default number of windows used to create prediction intervals from 2 to 3. The first thing we need to do is create a specific branch for that change using `git checkout -b [new_branch]` like this:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/7884f89a-ecc6-4200-8176-6a9b9f7c0aa2">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/7884f89a-ecc6-4200-8176-6a9b9f7c0aa2" />

Once created, open the notebook you want to modify. In this case, it's `nbs/utils.ipynb`, which contains the metadata for the prediction intervals. After opening it, click on the environment you want to use (top right) and select the `mlforecast` environment:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/0a0a8285-9344-471e-b699-8bc13159e3a8">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/0a0a8285-9344-471e-b699-8bc13159e3a8" />

Next, execute the notebook and make the necessary changes. In this case, we want to modify the `PredictionIntervals` class:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/0a614d14-52c9-4ba1-88e5-02e19661cae7">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/0a614d14-52c9-4ba1-88e5-02e19661cae7" />

We will change the default value of `n_window` from 2 to 3:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/af31a79d-0165-4c79-94bc-f411ec67b3ea">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/af31a79d-0165-4c79-94bc-f411ec67b3ea" />

Once you have made the change and performed any necessary validations, it's time to convert the notebook to Python modules. To do this, simply use `nbdev_export` in the terminal.

You will see that the `mlforecast/utils.py` file has been modified (the changes from `nbs/utils.ipynb` are reflected in that module). Before committing the changes, we need to clean the notebooks using the command `./action_files/clean_nbs` and verify that the linters pass using `./action_files/lint`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/cecf76a1-c025-4b6f-97c0-584394a3f56a">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/cecf76a1-c025-4b6f-97c0-584394a3f56a" />

Once you have done the above, simply add the changes using `git add nbs/utils.ipynb mlforecast/utils.py`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/107689d8-a270-4621-ac5d-9d077d9203c3">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/107689d8-a270-4621-ac5d-9d077d9203c3" />

Create a descriptive commit message for the changes using `git commit -m "[description of changes]"`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/034578e2-d63c-4d74-a96f-99f405288326">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/034578e2-d63c-4d74-a96f-99f405288326" />

Finally, push your changes using `git push`:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/49c6851c-949b-4ca7-ac38-6b17ec103437">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/49c6851c-949b-4ca7-ac38-6b17ec103437" />

### 5. Create a pull request.

In GitHub, open your repository that contains your fork of the original repo. Once inside, you will see the changes you just pushed. Click on "Compare and pull request":

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/c3d2ce0d-5fc9-4356-87d3-51b32e72524a">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/c3d2ce0d-5fc9-4356-87d3-51b32e72524a" />

Include an appropriate title for your pull request and fill in the necessary information. Once you're done, click on "Create pull request".

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/7de9c461-ad49-4fc2-b648-507662466851">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/7de9c461-ad49-4fc2-b648-507662466851" />

Finally, you will see something like this:

<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/846c0b97-46d2-492b-a58e-3e9f669c1632">
<img width="700" alt="image" src="https://github.com/Nixtla/how-to-contribute-nixtlaverse/assets/10517170/846c0b97-46d2-492b-a58e-3e9f669c1632" />

## Notes
- This file was generated using [this file](https://github.com/Nixtla/nixtla-commons/blob/main/docs/contribute/step-by-step.md). Please change that file if you want to enhance the document.
- This file was generated using [this file](https://github.com/Nixtla/nixtla-commons/blob/main/docs/contribute/step-by-step.md). Please change that file if you want to enhance the document.
2 changes: 1 addition & 1 deletion nbs/docs/how-to-guides/AmazonStatsForecast.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"637\" alt=\"image\" src=\"https://user-images.githubusercontent.com/10517170/206330119-48be0a7c-9ff6-412e-a52b-59a181c2a9d9.png\">"
"<img width=\"637\" alt=\"image\" src=\"https://user-images.githubusercontent.com/10517170/206330119-48be0a7c-9ff6-412e-a52b-59a181c2a9d9.png\" />"
]
}
],
Expand Down
4 changes: 3 additions & 1 deletion nbs/docs/how-to-guides/migrating_R.qmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Migrating from R
---
title: Migrating from R
---

## 🚧 We are working on this site.
This site is currently in development. If you are particularly interested in this section, please open a GitHub Issue, and we will prioritize it.
4 changes: 3 additions & 1 deletion nbs/docs/models/ARCH.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@
"source": [
"## Loading libraries and data <a class=\"anchor\" id=\"loading\"></a>\n",
"\n",
":::{.callout-tip} Statsforecast will be needed. To install, see [instructions](../getting-started/0_Installation.ipynb). :::\n",
":::{.callout-tip}\n",
"Statsforecast will be needed. To install, see [instructions](../getting-started/0_Installation.ipynb).\n",
":::\n",
"\n",
"Next, we import plotting libraries and configure the plotting style."
]
Expand Down
4 changes: 3 additions & 1 deletion nbs/docs/models/ARIMA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@
"source": [
"## Loading libraries and data <a class=\"anchor\" id=\"loading\"></a>\n",
"\n",
":::{.callout-tip} Statsforecast will be needed. To install, see [instructions](../getting-started/0_Installation.ipynb). :::\n",
":::{.callout-tip}\n",
"Statsforecast will be needed. To install, see [instructions](../getting-started/0_Installation.ipynb). \n",
":::\n",
"\n",
"Next, we import plotting libraries and configure the plotting style."
]
Expand Down
4 changes: 3 additions & 1 deletion nbs/docs/models/AutoCES.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@
"source": [
"## Loading libraries and data <a class=\"anchor\" id=\"loading\"></a>\n",
"\n",
":::{.callout-tip} Statsforecast will be needed. To install, see [instructions](../getting-started/0_Installation.ipynb). :::\n",
":::{.callout-tip}\n",
"Statsforecast will be needed. To install, see [instructions](../getting-started/0_Installation.ipynb).\n",
":::\n",
"\n",
"Next, we import plotting libraries and configure the plotting style."
]
Expand Down
2 changes: 1 addition & 1 deletion nbs/docs/models/AutoETS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"\n",
"$$s_{t} = \\gamma^*(1-\\alpha) (y_{t}-\\ell_{t-1}-b_{t-1})+ [1-\\gamma^*(1-\\alpha)]s_{t-m},$$\n",
"\n",
"Thus, we obtain identical forecasts using this approach by replacing $\\gamma$ in (1c) with $\\gamma^{*} (1-\\alpha) $. The modification given in (1c) was proposed by Ord et al. (1997) to make the state space formulation simpler. It is equivalent to Archibald’s (1990) variation of the Holt-Winters’ method."
"Thus, we obtain identical forecasts using this approach by replacing $\\gamma$ in (1c) with $\\gamma^{*} (1-\\alpha)$. The modification given in (1c) was proposed by Ord et al. (1997) to make the state space formulation simpler. It is equivalent to Archibald’s (1990) variation of the Holt-Winters’ method."
]
},
{
Expand Down
Loading

0 comments on commit 0d05a56

Please sign in to comment.