"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/_docs/contributing.md" between
prophet-1.0.tar.gz and prophet-1.1.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-1.0):contributing.md  (prophet-1.1)
skipping to change at line 125 skipping to change at line 125
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)``.
## 4. Creating a branch ## 4. Creating a branch
You want your master branch to reflect only production-ready code, so create a You want your main 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 *prophet*. 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 main branch:
```bash ```bash
$ git fetch upstream $ git fetch upstream
$ git rebase upstream/master $ git rebase upstream/main
``` ```
This will replay your commits on top of the latest *prophet* git master. If thi s This will replay your commits on top of the latest *prophet* git `main`. 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. 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 Github Actions C I (continuous integration) service automatically triggers Python and R builds fo r Prophet and runs the tests. A pull-request will be considered for merging when you have an all ‘green’ build. If any tests are failing, then you will get a re d ‘X’, where you can click through to see the individual failed tests. 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 his is never an issue. Once your pull request is submitted, the Github Actions C I (continuous integration) service automatically triggers Python and R builds fo r Prophet and runs the tests. A pull-request will be considered for merging when you have an all ‘green’ build. If any tests are failing, then you will get a re d ‘X’, where you can click through to see the individual failed tests.
### 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 test
``` ```
### R ### R
The entire test suite can be run from the R console by installing ``devtools``: The entire test suite can be run from the R console by installing ``devtools``:
```R ```R
> install.packages('devtools') > install.packages('devtools')
> devtools::test() > devtools::test()
``` ```
skipping to change at line 186 skipping to change at line 186
or for just running a single test script like ``test_diagnostics.R`` from the R console: or for just running a single test script like ``test_diagnostics.R`` from the R console:
```R ```R
> library(testthat) > library(testthat)
> source('test_diagnostics.R') > source('test_diagnostics.R')
``` ```
## 6. Generating documentation ## 6. Generating documentation
Most of the `doc` pages are generated from [Jupyter notebooks](http://jupyter.or g/) in the [notebooks](https://github.com/facebook/prophet/tree/master/notebooks ) directory at the base of the source tree. Please make changes there and then rebuild the docs: Most of the `doc` pages are generated from [Jupyter notebooks](http://jupyter.or g/) in the [notebooks](https://github.com/facebook/prophet/tree/main/notebooks) directory at the base of the source tree. Please make changes there and then re build the docs:
```bash ```bash
$ cd docs $ cd docs
$ make notebooks $ make notebooks
``` ```
Make sure you have installed [rpy2](https://rpy2.bitbucket.io/) so that the R co de can be run as well. Make sure you have installed [rpy2](https://rpy2.bitbucket.io/) so that the R co de can be run as well.
In R, the documentation for the source code must also generated if new parameter s are added or a new function is created. This is documented with ``roxygen``. In R, the documentation for the source code must also generated if new parameter s are added or a new function is created. This is documented with ``roxygen``.
skipping to change at line 264 skipping to change at line 264
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. 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 `main` and n ew-feature, respectively.
## 10. Making a pull request ## 10. Making a pull request
If everything looks good, you are ready to make a pull request. A pull request i s how code from a local repository becomes available to the GitHub community and can be reviewed and eventually merged into the master version. This pull reques t and its associated changes will eventually be committed to the master branch a nd available in the next release. To submit a pull request: If everything looks good, you are ready to make a pull request. A pull request i s how code from a local repository becomes available to the GitHub community and can be reviewed and eventually merged into the `main` version. This pull reques t and its associated changes will eventually be committed to the `main` branch a nd available in the next release. To submit a pull request:
1. Navigate to your repository on GitHub 1. Navigate to your repository on GitHub
2. Click on the Pull Request button 2. Click on the Pull Request button
3. You can then click on Commits and Files Changed to make sure everything looks okay one last time 3. You can then click on Commits and Files Changed to make sure everything looks okay one last time
4. Write a description of your changes in the Preview Discussion tab 4. Write a description of your changes in the Preview Discussion tab
5. Click Send Pull Request. 5. Click Send Pull Request.
This request then goes to the repository maintainers, and they will review the c ode. If you need to make more changes, you can make them in your branch, add the m to a new commit, push them to GitHub, and the pull request will be automatical ly updated. Pushing them to GitHub again is done by: This request then goes to the repository maintainers, and they will review the c ode. If you need to make more changes, you can make them in your branch, add the m to a new commit, push them to GitHub, and the pull request will be automatical ly updated. Pushing them to GitHub again is done by:
```bash ```bash
$ git push origin new-feature $ git push origin new-feature
``` ```
This will automatically update your pull request with the latest code and restar t the Continuous Integration tests. This will automatically update your pull request with the latest code and restar t the Continuous Integration tests.
## 11. Delete your merged branch ## 11. Delete your merged branch
Once your feature branch is merged into ``upstream master``, you can delete your remote branch via the ``Delete branch`` option in the PR and the local copy by running: Once your feature branch is merged into ``upstream main``, you can delete your r emote branch via the ``Delete branch`` option in the PR and the local copy by ru nning:
```bash ```bash
$ git branch -d new-feature $ git branch -d new-feature
``` ```
## 12. PR checklist ## 12. PR checklist
* Write docstrings for any functions that are included. * Write docstrings for any functions that are included.
* Test that the documentation builds correctly. See “Generating documentation”. * Test that the documentation builds correctly. See “Generating documentation”.
* Test your code. * Test your code.
 End of changes. 9 change blocks. 
9 lines changed or deleted 9 lines changed or added

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