"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/_docs/contributing.md" between
prophet-0.7.tar.gz and prophet-1.0.tar.gz

About: Prophet is a tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

contributing.md  (prophet-0.7):contributing.md  (prophet-1.0)
skipping to change at line 14 skipping to change at line 14
title: "Getting Help and Contributing" title: "Getting Help and Contributing"
permalink: /docs/contributing.html permalink: /docs/contributing.html
--- ---
Prophet has a non-fixed release cycle but we will be making bugfixes in response to user feedback and adding features. Please let us know if you encounter a bug by [filing an issue](https://github.com/facebook/prophet/issues). Github issues is also the right place to ask questions about using Prophet. Prophet has a non-fixed release cycle but we will be making bugfixes in response to user feedback and adding features. Please let us know if you encounter a bug by [filing an issue](https://github.com/facebook/prophet/issues). Github issues is also the right place to ask questions about using Prophet.
We appreciate all contributions. If you are planning to contribute back bug-fixe s, please do so without any further discussion. We appreciate all contributions. If you are planning to contribute back bug-fixe s, please do so without any further discussion.
If you plan to contribute new features or extensions to the core, please first o pen an issue and discuss the feature with us. Sending a pull request is fine too , but it will likely be merged more quickly if any design decisions are settled on beforehand in an issue. If you plan to contribute new features or extensions to the core, please first o pen an issue and discuss the feature with us. Sending a pull request is fine too , but it will likely be merged more quickly if any design decisions are settled on beforehand in an issue.
The R and Python versions are kept feature identical, but new features can be im plemented for each method in separate commits. We try to keep the R and Python versions feature identical, but new features can be implemented for each method in separate commits.
The following sections will describe how you can submit a pull request for addin g enhancements, documentation changes or bug fixes to the codebase. The following sections will describe how you can submit a pull request for addin g enhancements, documentation changes or bug fixes to the codebase.
## 1. Forking the Prophet Repo ## 1. Forking the Prophet Repo
You will need your own fork to work on the code. Go to the fbprophet project You will need your own fork to work on the code. Go to the [prophet project
page https://github.com/facebook/prophet and hit the ``Fork`` button. You will page](https://github.com/facebook/prophet) and hit the ``Fork`` button. You will
want to clone your fork to your machine:: want to clone your fork to your machine:
``` ```
$ git clone https://github.com/your-user-name/prophet.git $ git clone https://github.com/your-user-name/prophet.git
$ cd prophet $ cd prophet
$ git remote add upstream https://github.com/facebook/prophet.git $ git remote add upstream https://github.com/facebook/prophet.git
``` ```
This creates the directory `prophet` and connects your repository to This creates the directory `prophet` and connects your repository to
the upstream (main project) fbprophet repository. the upstream (main project) prophet repository.
## 2. Creating an environment with dependencies ## 2. Creating an environment with dependencies
Before starting any development, you'll need to create an isolated prophet Before starting any development, you'll need to create an isolated prophet
development environment. This should contain the required dependencies. development environment. This should contain the required dependencies.
### Python ### Python
- Install either Anaconda (https://www.anaconda.com/download/) or miniconda (htt ps://conda.io/miniconda.html) - Install either Anaconda [anaconda](https://www.anaconda.com/download/) or [min iconda](https://conda.io/miniconda.html)
- Make sure your conda is up to date (``conda update conda``) - Make sure your conda is up to date (``conda update conda``)
- ``cd`` to the *prophet* source directory that you have cloned - ``cd`` to the *prophet* source directory that you have cloned
```bash ```bash
$ cd python $ cd python
# with Anaconda # with Anaconda
$ conda create -n prophet $ conda create -n prophet
$ conda activate prophet $ conda activate prophet
$ pip install -r requirements.txt $ pip install -r requirements.txt
# with venv # with venv
$ python3 -m venv prophet $ python3 -m venv prophet
$ source prophet/bin/activate $ source prophet/bin/activate
$ pip install -r requirements.txt $ pip install -r requirements.txt
``` ```
### R ### R
Dependencies can be managed through ``Packrat`` (https://rstudio.github.io/packr at/) or ``renv`` (https://rstudio.github.io/renv/articles/renv.html). Dependencies can be managed through [``Packrat``](https://rstudio.github.io/pack rat/) or [``renv``](https://rstudio.github.io/renv/articles/renv.html).
For ``renv``, you must first initialise a new project local environment. For ``renv``, you must first initialise a new project local environment.
```R ```R
> setwd("path/to/prophet/R") # set R subdirectory as working directory > setwd("path/to/prophet/R") # set R subdirectory as working directory
> install.packages('renv') > install.packages('renv')
> renv::init() > renv::init()
``` ```
This should also install the dependencies listed in the DESCRIPTION automaticall y. Any new R packages can be installed as they are needed in the project. This should also install the dependencies listed in the DESCRIPTION automaticall y. Any new R packages can be installed as they are needed in the project.
skipping to change at line 92 skipping to change at line 92
## 3. Building a development version of Prophet ## 3. Building a development version of Prophet
The next step is to build and install the development version of prophet in the environment you have just created. The next step is to build and install the development version of prophet in the environment you have just created.
### Python ### Python
```bash ```bash
$ python setup.py develop $ python setup.py develop
``` ```
You should be able to import *fbprophet* from your locally built version: You should be able to import *prophet* from your locally built version:
```bash ```bash
$ python # start an interpreter $ python # start an interpreter
>>> import fbprophet >>> import prophet
>>> fbprophet.__version__ >>> prophet.__version__
'0.6.1.dev0' # whatever the current github version is '1.0' # whatever the current github version is
'0.10.0+dev46.g015daca'
``` ```
This will create the new environment, and not touch any of your existing environ ments, This will create the new environment, and not touch any of your existing environ ments,
nor any existing Python installation. nor any existing Python installation.
```bash ```bash
# to view your environments: # to view your environments:
$ conda info -e $ conda info -e
# to return to your root environment:: # to return to your root environment::
$ conda deactivate $ conda deactivate
``` ```
See the full conda docs here http://conda.pydata.org/docs. See the full conda docs [here](http://conda.pydata.org/docs).
### R ### R
From the terminal, ``cd`` to ``R`` subdirectory and run: From the terminal, ``cd`` to ``R`` subdirectory and run:
```bash ```bash
$ R CMD INSTALL . $ R CMD INSTALL .
``` ```
This will build and install the local version of the prophet package. Then from the R console you can load the package: ``library(prophet)``. This will build and install the local version of the prophet package. Then from the R console you can load the package: ``library(prophet)``.
skipping to change at line 135 skipping to change at line 134
You want your master branch to reflect only production-ready code, so create a You want your master branch to reflect only production-ready code, so create a
feature branch for making your changes. For example: feature branch for making your changes. For example:
```bash ```bash
$ git checkout -b new-feature $ git checkout -b new-feature
``` ```
This changes your working directory to the new-feature branch. Keep any This changes your working directory to the new-feature branch. Keep any
changes in this branch specific to one bug or feature so it is clear changes in this branch specific to one bug or feature so it is clear
what the branch brings to *fbprophet*. You can have many "new-features" what the branch brings to *prophet*. You can have many "new-features"
and switch in between them using the ``git checkout`` command. and switch in between them using the ``git checkout`` command.
To update this branch, you need to retrieve the changes from the master branch: To update this branch, you need to retrieve the changes from the master branch:
```bash ```bash
$ git fetch upstream $ git fetch upstream
$ git rebase upstream/master $ git rebase upstream/master
``` ```
This will replay your commits on top of the latest *fbprophet* git master. If t his This will replay your commits on top of the latest *prophet* git master. If thi s
leads to merge conflicts, you must resolve these before submitting your pull leads to merge conflicts, you must resolve these before submitting your pull
request. If you have uncommitted changes, you will need to ``git stash`` them request. If you have uncommitted changes, you will need to ``git stash`` them
prior to updating. This will effectively store your changes and they can be prior to updating. This will effectively store your changes and they can be
reapplied after updating. reapplied after updating.
## 5. Testing with Continuous Integration ## 5. Testing with Continuous Integration
Adding tests is one of the most common requests after code is pushed to prophet. Adding tests is one of the most common requests after code is pushed to prophet.
Therefore, it is worth getting in the habit of writing tests ahead of time so t Therefore, it is worth getting in the habit of writing tests ahead of time so t
his is never an issue. Once your pull request is submitted, the Travis CI (conti his is never an issue. Once your pull request is submitted, the Github Actions C
nuous integration) service automatically triggers Python and R builds for Prophe I (continuous integration) service automatically triggers Python and R builds fo
t and runs the tests. A pull-request will be considered for merging when you hav r Prophet and runs the tests. A pull-request will be considered for merging when
e an all ‘green’ build. If any tests are failing, then you will get a red ‘X’, w you have an all ‘green’ build. If any tests are failing, then you will get a re
here you can click through to see the individual failed tests. d ‘X’, where you can click through to see the individual failed tests.
All contributors are strongly recommended to embrace Test Driven Development (TD
D). First one must write an (initially failing) automated test case that defines
a desired improvement or new function, then produce the minimum amount of code
to pass that test. So, before actually writing any code, you should write your t
ests.
### Python ### Python
Prophet uses the ``unittest`` package for running tests in Python and ``testthat `` package for testing in R. All tests should go into the tests subdirectory in either the Python or R folders. Prophet uses the ``unittest`` package for running tests in Python and ``testthat `` package for testing in R. All tests should go into the tests subdirectory in either the Python or R folders.
The entire test suite can be run by typing: The entire test suite can be run by typing:
```bash ```bash
$ python setup.py tests $ python setup.py tests
``` ```
skipping to change at line 258 skipping to change at line 255
If you added the upstream repository as described above you will see something l ike: If you added the upstream repository as described above you will see something l ike:
```bash ```bash
origin git@github.com:yourname/prophet.git (fetch) origin git@github.com:yourname/prophet.git (fetch)
origin git@github.com:yourname/prophet.git (push) origin git@github.com:yourname/prophet.git (push)
upstream https://github.com/facebook/prophet.git (fetch) upstream https://github.com/facebook/prophet.git (fetch)
upstream https://github.com/facebook/prophet.git (push) upstream https://github.com/facebook/prophet.git (push)
``` ```
Now your code is on GitHub, but it is not yet a part of the fbprophet project. F or that to happen, a pull request needs to be submitted on GitHub. Now your code is on GitHub, but it is not yet a part of the prophet project. For that to happen, a pull request needs to be submitted on GitHub.
## 9. Review your code ## 9. Review your code
When you’re ready to ask for a code review, file a pull request. Before you do, once again make sure that you have followed all the guidelines outlined in this document regarding code style, tests, performance tests, and documentation. You should also double check your branch changes against the branch it was based on: When you’re ready to ask for a code review, file a pull request. Before you do, once again make sure that you have followed all the guidelines outlined in this document regarding code style, tests, performance tests, and documentation. You should also double check your branch changes against the branch it was based on:
1. Navigate to your repository on GitHub – https://github.com/your-user-name/pro phet 1. Navigate to your repository on GitHub – https://github.com/your-user-name/pro phet
2. Click on Branches 2. Click on Branches
3. Click on the Compare button for your feature branch 3. Click on the Compare button for your feature branch
4. Select the base and compare branches, if necessary. This will be master and n ew-feature, respectively. 4. Select the base and compare branches, if necessary. This will be master and n ew-feature, respectively.
 End of changes. 12 change blocks. 
29 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)