2. Example Contribution#
2.1. Introduction#
If you’re a more experienced with the skscope and are looking forward to
improve your open source development skills, the next step up is to
contribute examples to skscope.
An document in example gallery is a long-form guide to shows how to use skscope to solve a sparsity-constrained optimization (SCO) problem. Typically, in this document, we will:
describes the problem and related practical background;
show readers the mathematics formulation for this problem and corresponding implementation based on
skscope;use either a synthetic dataset or a real-world dataset to validate the implementation. We may also compared with the benchmarked method to illustrate the advantages of SCO and
skscope.
The contribution can be either:
improving current examples, e.g.,
correcting typos
clarifying concepts
reasonably generalizing the current method to handle practical problems
applying it on datasets to gain new insights
or
contributing a novel example that is helpful for solving meaningful problems in practice.
2.2. General Workflow#
In most of case, the workflow is based on git. But if you are not familiar with command line and git, we suggest you install the github desktop that provide a user-friendly interaction interface for simplifying documentation contribution. The instrument of “github desktop” is here.
Fork the master repository by clicking on the “Fork” button on the top right of the page, which would create a copy to your own GitHub account;
Clone your fork of
skscopeto the local computer by Git;git clone https://github.com/YourAccount/skscope.git cd skscope
Work on the local computer for the contribution of examples.
Commit your improvements/contribution on examples:
git add changed_files git commit -m "YourContributionSummary" git push
Submit a pull request via Github and explain your contribution for documentation.
Next, we will give more details about step 3 to facilitate your contribution on examples.
2.3. Example Contribution Procedure#
Before contributing example, we presume that you have already complete the steps 1-2 described in general development procedure, and you have installed necessary packages by conducting the following command.
pip install -r docs/requirements.txt
There are four basic steps to contribute examples:
If you going to contribute a new example, please create a new
.ipynbfile in the pathdocs/source/userguide/examples. Or, if you would like to improve a current existing example, please find the corresponding.ipynbfile in the same path.Write related contents on the
.ipynbfiles your would like to contribute.Go to the
docsdirectory (e.g., viacd docs), and running the following command in the terminal:make html
This command will build web pages in your local computer. Note that, these web pages are built upon your most recent content of .ipynb files. You can preview by opening/refreshing the index.html files in docs/build/html directory.
Repeat step 2 and step 3 until you are satisfied with the documentation.
After steps 1-4, you almost completely the example contribution. To ensure it also works well on the online website, please add the dependence packages in PyPI into docs/requirements.txt.
2.4. Helpful Links#
IPython notebook files (.ipynb): an introduction