Skip to content

Commit

Permalink
Backports for v0.10.6 (#2273)
Browse files Browse the repository at this point in the history
* Use brand colors in docs. (#2257)

* Docs: Reformatting table, badge colors. (#2258)

* Improve len() for ParquetFile. (#2261)

* Move max_idle_transform usage to GluonEstimator. (#2262)

* Fix ignore hidden files when generating datasets (#2263)

* Fix: set max idle transforms in PyTorch estimators (#2266)

* Fix `QuantileForecast.plot()` to use `DateTimeIndex` (#2269)

* Docs: update contribution guidelines and dev setup  (#2270)

* Update project_urls. (#2274)

Co-authored-by: Jasper <[email protected]>
Co-authored-by: Kashif Rasul <[email protected]>
Co-authored-by: Abdul Fatir <[email protected]>
  • Loading branch information
4 people authored Sep 6, 2022
1 parent 9998bc6 commit c0463d4
Show file tree
Hide file tree
Showing 46 changed files with 311 additions and 550 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions and Discussions
url: https://github.com/awslabs/gluon-ts/discussions
url: https://github.com/awslabs/gluonts/discussions
about: Use GitHub Discussions to ask and answer questions, exchange ideas, and share learning.
2 changes: 1 addition & 1 deletion .github/workflows/test_release_unix_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Clone and install dependencies
run: |
git clone https://github.com/awslabs/gluon-ts --branch $(curl https://api.github.com/repos/awslabs/gluon-ts/releases/latest | grep tag_name | cut -d : -f 2,3 | tr -d \"\ | tr -d \,\ )
git clone https://github.com/awslabs/gluonts --branch $(curl https://api.github.com/repos/awslabs/gluonts/releases/latest | grep tag_name | cut -d : -f 2,3 | tr -d \"\ | tr -d \,\ )
cd gluon-ts
python -m pip install pip==20.2
pip install mxnet~=1.8.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_release_win32_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Clone and install dependencies
run: |
$tmp=(Invoke-WebRequest -Uri https://api.github.com/repos/awslabs/gluon-ts/releases/latest).Content | ConvertFrom-Json | Select-Object tag_name
$tmp=(Invoke-WebRequest -Uri https://api.github.com/repos/awslabs/gluonts/releases/latest).Content | ConvertFrom-Json | Select-Object tag_name
$tmp=$tmp.psobject.properties.value.trim()
git clone https://github.com/awslabs/gluon-ts --branch $tmp
git clone https://github.com/awslabs/gluonts --branch $tmp
cd gluon-ts
python -m pip install -U pip
pip install mxnet~=1.7.0
Expand Down
67 changes: 15 additions & 52 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,27 @@ documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Questions and discussion topics

Questions and discussion topics can be proposed using [discussions](https://github.com/awslabs/gluon-ts/discussions).

Questions and discussion topics can be proposed using [discussions](https://github.com/awslabs/gluonts/discussions).

## Reporting Bugs/Feature Requests

We welcome you to use the GitHub [issue tracker](https://github.com/awslabs/gluon-ts/issues/new/choose) to report bugs or suggest features.
We welcome you to use the GitHub [issue tracker](https://github.com/awslabs/gluonts/issues/new/choose) to report bugs or suggest features.

When filing an issue, please check [existing open](https://github.com/awslabs/gluon-ts/issues), or [recently closed](https://github.com/awslabs/gluon-ts/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
When filing an issue, please check [existing open](https://github.com/awslabs/gluonts/issues), or [recently closed](https://github.com/awslabs/gluonts/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment


## Contributing via Pull Requests

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *dev* branch.
1. You are working against the latest source on the `dev` branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

Expand All @@ -44,64 +42,29 @@ To send us a pull request, please:
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).

## Development setup

## Development setup and coding style

For development you need the requirements listed in all `requirements...txt` files.

We use [black](https://github.com/python/black) and mypy for style and
type checking. Any code changes that you contribute should pass these checks.

The easiest way to get set up for development is to run the following script:

```bash
# first fork the repo on github

# then clone your fork
git clone https://github.com/<your-github-username>/gluon-ts.git

# enter the cloned repo
cd gluon-ts

# run development setup
./dev_setup.sh

# install GluonTS from current source with shell dependencies
pip install -e ".[shell]"
```
Note that windows and other versions of linux (not mac versions) will require
something slightly different to initiate the `dev_setup.sh` script.

This will install all the requirements and also install a git hook that runs
all code checks when you commit. This also separates your workflow so that
pull-requests go through your forked repo and then into upstream if approved.

You may wish to familiarize yourself with forked repositories on github, for
more see:
https://help.github.com/en/articles/working-with-forks

To avoid conflicts with existing python installations you may want to setup
a virtual environment. For more on virtual environments in python see:
https://docs.python.org/3/tutorial/venv.html
for python virtual environments and
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
for conda virtual environments.
Please refer to the [documentation](https://ts.gluon.ai/dev/community/devsetup.html) on how to set up your development environment.

## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/gluon-ts/labels/help%20wanted) issues is a great place to start.

Looking at the existing issues is a great way to find something to contribute on: issues labeled with
['good first issue'](https://github.com/awslabs/gluonts/labels/good%20first%20issue) or
['help wanted'](https://github.com/awslabs/gluonts/labels/help%20wanted)
are a great place to start.

## Code of Conduct

This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.

If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.

## Licensing

See the [LICENSE](https://github.com/awslabs/gluon-ts/blob/dev/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
See the [LICENSE](https://github.com/awslabs/gluonts/blob/dev/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# GluonTS - Probabilistic Time Series Modeling in Python

[![PyPI](https://img.shields.io/pypi/v/gluonts.svg?style=flat-square)](https://pypi.org/project/gluonts/)
[![GitHub](https://img.shields.io/github/license/awslabs/gluon-ts.svg?style=flat-square)](./LICENSE)
[![Static](https://img.shields.io/static/v1?label=docs&message=stable&color=blue&style=flat-square)](https://ts.gluon.ai/)
[![Static](https://img.shields.io/static/v1?label=docs&message=dev&color=blue&style=flat-square)](https://ts.gluon.ai/dev/)
[![PyPI Downloads](https://pepy.tech/badge/gluonts)](https://pypi.org/project/gluonts/)
[![PyPI](https://img.shields.io/pypi/v/gluonts.svg?style=flat-square&color=b75347)](https://pypi.org/project/gluonts/)
[![GitHub](https://img.shields.io/github/license/awslabs/gluonts.svg?style=flat-square&color=df7e66)](./LICENSE)
[![Static](https://img.shields.io/static/v1?label=docs&message=stable&color=edc775&style=flat-square)](https://ts.gluon.ai/)
[![Static](https://img.shields.io/static/v1?label=docs&message=dev&color=edc775&style=flat-square)](https://ts.gluon.ai/dev/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/gluonts?style=flat-square&color=94b594)](https://pypi.org/project/gluonts/)

GluonTS is a Python package for probabilistic time series modeling, focusing on deep learning based models.

Expand Down Expand Up @@ -69,7 +69,7 @@ centered around the median.
## Contributing

If you wish to contribute to the project, please refer to our
[contribution guidelines](https://github.com/awslabs/gluon-ts/tree/dev/CONTRIBUTING.md).
[contribution guidelines](https://github.com/awslabs/gluonts/tree/dev/CONTRIBUTING.md).

## Citing

Expand Down Expand Up @@ -115,7 +115,7 @@ in addition to any model-specific references that are relevant for your work:

* [JMLR MLOSS Paper](http://www.jmlr.org/papers/v21/19-820.html)
* [ArXiv Paper](https://arxiv.org/abs/1906.05264)
* [Collected Papers from the group behind GluonTS](https://github.com/awslabs/gluon-ts/tree/dev/REFERENCES.md): a bibliography.
* [Collected Papers from the group behind GluonTS](https://github.com/awslabs/gluonts/tree/dev/REFERENCES.md): a bibliography.

### Tutorials and Workshops

Expand Down
190 changes: 1 addition & 189 deletions docs/community/contribute.rst
Original file line number Diff line number Diff line change
@@ -1,189 +1 @@
Contribute
==========

GluonTS community welcomes contributions from anyone! Latest documentation can be found `here <https://ts.gluon.ai/dev/index.html>`__.

There are lots of opportunities for you to become our `contributors <https://github.com/awslabs/gluon-ts/blob/dev/contributor.rst>`__:

- Ask or answer questions on `GitHub issues <https://github.com/awslabs/gluon-ts/issues>`__.
- Propose ideas, or review proposed design ideas on `GitHub issues <https://github.com/awslabs/gluon-ts/issues>`__.
- Improve the `documentation <https://ts.gluon.ai/dev/index.html>`__.
- Contribute bug reports `GitHub issues <https://github.com/awslabs/gluon-ts/issues>`__.
- Write new `tutorials <https://github.com/awslabs/gluon-ts/tree/dev/docs/tutorials>`__.
- Most importantly, if you have an idea of how to contribute, then do it!

For a list of open starter tasks, check `good first issues <https://github.com/awslabs/gluon-ts/labels/good%20first%20issue>`__.

- `Make changes <#make-changes>`__

- `Contribute tutorials <#contribute-tutorials>`__

- `Contribute new Models <#contribute-new-model>`__

- `Git Workflow Howtos <#git-workflow-howtos>`__

- `How to submit pull request <#how-to-submit-pull-request>`__
- `How to resolve conflict with
dev <#how-to-resolve-conflict-with-dev>`__
- `How to combine multiple commits into
one <#how-to-combine-multiple-commits-into-one>`__
- `What is the consequence of force
push <#what-is-the-consequence-of-force-push>`__


Make changes
------------

Our package uses continuous integration and code coverage tools for verifying pull requests. Before
submitting, contributor should perform the following checks:

- `Lint (code style) check <https://github.com/awslabs/gluon-ts/blob/dev/ci/jenkins/build_steps.groovy>`__.
- `Py3 <https://github.com/awslabs/gluon-ts/blob/dev/ci/jenkins/Jenkinsfile_py3_cpu_unittest>`__ tests.


Contribute tutorials
--------------------

Our :doc:`tutorials <../tutorials/index>` are intended for people who
are interested in time series and want to get better familiarized on different parts in time series. In order for
people to easily understand the content, the code needs to be clean and readable, accompanied by
explanation with good writing.

See `existing tutorials <https://github.com/awslabs/gluon-ts/tree/dev/docs/tutorials>`__.

To make the review process easy, we adopt `notedown <https://github.com/aaren/notedown>`_ as the
tutorial format. Notedown notebooks are regular markdown files with code blocks that can be
converted into `Jupyter notebooks <http://jupyter.org/>`_.

We suggest you start the example with `Jupyter notebook <http://jupyter.org/>`_. When the content is ready, please:

- Clear the output cells in the jupyter notebook,
- `Install notedown <https://github.com/aaren/notedown>`_.
- Run `notedown input.ipynb --to markdown > output.md`
- Submit the `.md` file for review.

Notebook Guidelines:

- Less is better. Only show the code that needs people's attention.
- Have a block upfront about the key takeaway of the notebook.
- Explain the motivation of the notebook to guide readers. Add figures if they help.
- Try to have < 10 lines of code per block, < 100 lines of code per notebook.
- Hide uninteresting complex functions in .py and import them.
- Hide uninteresting model parameters. We can make some of them default parameters in model definition. Maybe out of 30 we just show 5 interesting ones and pass those to model constructor.
- Only import module instead of classes and functions (i.e. from gluonts import model and use model.get_model, instead of from gluonts.model import get_model)
- Make tutorials more engaging, interactive, prepare practice questions for people to try it out. For example, for embedding evaluation, we can ask questions to the audience like what's the most similar word to xxx.
- Make sure the notebook can be zoomed in and still render well. This helps accommodate different viewing devices.
- For low level APIs such as BeamSearch and Scorer, explain the API with examples so ppl know how to play with it / hack it.


Contribute Docs
---------------

Documentation is at least as important as code. Good documentation delivers the correct message clearly and concisely.
If you see any issue in the existing documentation, a patch to fix is most welcome! To locate the
code responsible for the doc, you may use "Edit on Github" in the top right corner, or the
"[source]" links after each API. Also, `git grep` works nicely for searching for a specific string.

Git Workflow Howtos
-------------------

How to submit pull request
~~~~~~~~~~~~~~~~~~~~~~~~~~

- Before submit, please rebase your code on the most recent version of
dev, you can do it by

.. code:: bash
git remote add upstream https://github.com/awslabs/gluon-ts
git fetch upstream
git rebase upstream/dev
- If you have multiple small commits, it might be good to merge them
together(use git rebase then squash) into more meaningful groups.
- Send the pull request!

- Fix the problems reported by automatic checks
- If you are contributing a new module or new function, add a test.

How to resolve conflict with dev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- First rebase to most recent dev

.. code:: bash
# The first two steps can be skipped after you do it once.
git remote add upstream https://github.com/awslabs/gluon-ts
git fetch upstream
git rebase upstream/dev
- The git may show some conflicts it cannot merge, say
``conflicted.py``.

- Manually modify the file to resolve the conflict.
- After you resolved the conflict, mark it as resolved by

.. code:: bash
git add conflicted.py
- Then you can continue rebase by

.. code:: bash
git rebase --continue
- Finally push to your fork, you may need to force push here.

.. code:: bash
git push --force
How to combine multiple commits into one
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sometimes we want to combine multiple commits, especially when later
commits are only fixes to previous ones, to create a PR with set of
meaningful commits. You can do it by following steps. - Before doing so,
configure the default editor of git if you haven't done so before.

.. code:: bash
git config core.editor the-editor-you-like
- Assume we want to merge last 3 commits, type the following commands

.. code:: bash
git rebase -i HEAD~3
- It will pop up an text editor. Set the first commit as ``pick``, and
change later ones to ``squash``.
- After you saved the file, it will pop up another text editor to ask
you modify the combined commit message.
- Push the changes to your fork, you need to force push.

.. code:: bash
git push --force
Reset to the most recent dev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can always use git reset to reset your version to the most recent
dev. Note that all your ***local changes will get lost***. So only do
it when you do not have local changes or when your pull request just get
merged.

.. code:: bash
git reset --hard [hash tag of dev]
git push --force
What is the consequence of force push
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The previous two tips requires force push, this is because we altered
the path of the commits. It is fine to force push to your own fork, as
long as the commits changed are only yours.
.. mdinclude:: ../../CONTRIBUTING.md
Loading

0 comments on commit c0463d4

Please sign in to comment.