mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-10 11:50:32 +08:00
DOC: documenting the documentation
This commit is contained in:
+33
-63
@@ -30,7 +30,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="top" title="Catalyst 0.3 documentation" href="index.html"/>
|
||||
<link rel="top" title="Catalyst 0.3 documentation" href="index.html"/>
|
||||
<link rel="prev" title="Videos" href="videos.html"/>
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
@@ -69,7 +70,7 @@
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="install.html">Install</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-pip">Installing with <code class="docutils literal"><span class="pre">pip</span></code></a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#gnu-linux">GNU/Linux</a></li>
|
||||
@@ -110,6 +111,14 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="videos.html#installation-windows">Installation: Windows</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="">Development Guidelines</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#creating-a-development-environment">Creating a Development Environment</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#git-branching-structure">Git Branching Structure</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#contributing-to-the-docs">Contributing to the Docs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#commit-messages">Commit messages</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#formatting-docstrings">Formatting Docstrings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -149,12 +158,12 @@
|
||||
|
||||
<div class="section" id="development-guidelines">
|
||||
<h1>Development Guidelines<a class="headerlink" href="#development-guidelines" title="Permalink to this headline">¶</a></h1>
|
||||
<p>This page is intended for developers of Zipline, people who want to contribute to the Zipline codebase or documentation, or people who want to install from source and make local changes to their copy of Zipline.</p>
|
||||
<p>All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We <a class="reference external" href="https://github.com/quantopian/zipline/issues">track issues</a> on <a class="reference external" href="https://github.com/">GitHub</a> and also have a <a class="reference external" href="https://groups.google.com/forum/#!forum/zipline">mailing list</a> where you can ask questions.</p>
|
||||
<p>This page is intended for developers of Catalyst, people who want to contribute to the Catalyst codebase or documentation, or people who want to install from source and make local changes to their copy of Catalyst.</p>
|
||||
<p>All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We <a class="reference external" href="https://github.com/enigmampc/catalyst/issues">track issues</a> on <a class="reference external" href="https://github.com/enigmampc/catalyst">GitHub</a> and also have a <a class="reference external" href="https://discord.gg/SJK32GY">discord group</a> where you can ask questions.</p>
|
||||
<div class="section" id="creating-a-development-environment">
|
||||
<h2>Creating a Development Environment<a class="headerlink" href="#creating-a-development-environment" title="Permalink to this headline">¶</a></h2>
|
||||
<p>First, you’ll need to clone Zipline by running:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>git clone git@github.com:your-github-username/zipline.git
|
||||
<p>First, you’ll need to clone Catalyst by running:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>git clone git@github.com:enigmampc/catalyst.git
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then check out to a new branch where you can make your changes:</p>
|
||||
@@ -163,7 +172,7 @@
|
||||
</div>
|
||||
<p>If you don’t already have them, you’ll need some C library dependencies. You can follow the <a class="reference external" href="install.html">install guide</a> to get the appropriate dependencies.</p>
|
||||
<p>The following section assumes you already have virtualenvwrapper and pip installed on your system. Suggested installation of Python library dependencies used for development:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>mkvirtualenv zipline
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>mkvirtualenv catalyst
|
||||
<span class="nv">$ </span>./etc/ordered_pip.sh ./etc/requirements.txt
|
||||
<span class="nv">$ </span>pip install -r ./etc/requirements_dev.txt
|
||||
<span class="nv">$ </span>pip install -r ./etc/requirements_blaze.txt
|
||||
@@ -173,68 +182,22 @@
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python setup.py build_ext --inplace
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To finish, make sure <a class="reference external" href="#style-guide-running-tests">tests</a> pass.</p>
|
||||
<p>If you get an error running nosetests after setting up a fresh virtualenv, please try running</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="c"># where zipline is the name of your virtualenv</span>
|
||||
<span class="nv">$ </span>deactivate zipline
|
||||
<span class="nv">$ </span>workon zipline
|
||||
</pre></div>
|
||||
<p>..If you want to work with zipline using a <a href="#id1"><span class="problematic" id="id2">`Docker`__</span></a> container, you’ll need to build the <code class="docutils literal"><span class="pre">Dockerfile</span></code> in the Zipline root directory, and then build <code class="docutils literal"><span class="pre">Dockerfile-dev</span></code>. Instructions for building both containers can be found in <code class="docutils literal"><span class="pre">Dockerfile</span></code> and <code class="docutils literal"><span class="pre">Dockerfile-dev</span></code>, respectively.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="development-with-docker">
|
||||
<h2>Development with Docker<a class="headerlink" href="#development-with-docker" title="Permalink to this headline">¶</a></h2>
|
||||
<p>If you want to work with zipline using a <a class="reference external" href="https://docs.docker.com/get-started/">Docker</a> container, you’ll need to build the <code class="docutils literal"><span class="pre">Dockerfile</span></code> in the Zipline root directory, and then build <code class="docutils literal"><span class="pre">Dockerfile-dev</span></code>. Instructions for building both containers can be found in <code class="docutils literal"><span class="pre">Dockerfile</span></code> and <code class="docutils literal"><span class="pre">Dockerfile-dev</span></code>, respectively.</p>
|
||||
</div>
|
||||
<div class="section" id="style-guide-running-tests">
|
||||
<h2>Style Guide & Running Tests<a class="headerlink" href="#style-guide-running-tests" title="Permalink to this headline">¶</a></h2>
|
||||
<p>We use <a class="reference external" href="http://flake8.pycqa.org/en/latest/">flake8</a> for checking style requirements and <a class="reference external" href="http://nose.readthedocs.io/en/latest/">nosetests</a> to run Zipline tests. Our <a class="reference external" href="https://en.wikipedia.org/wiki/Continuous_integration">continuous integration</a> tools will run these commands.</p>
|
||||
<p>Before submitting patches or pull requests, please ensure that your changes pass when running:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>flake8 zipline tests
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>In order to run tests locally, you’ll need <a class="reference external" href="https://mrjbq7.github.io/ta-lib/install.html">TA-lib</a>, which you can install on Linux by running:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
|
||||
<span class="nv">$ </span>tar -xvzf ta-lib-0.4.0-src.tar.gz
|
||||
<span class="nv">$ </span><span class="nb">cd </span>ta-lib/
|
||||
<span class="nv">$ </span>./configure --prefix<span class="o">=</span>/usr
|
||||
<span class="nv">$ </span>make
|
||||
<span class="nv">$ </span>sudo make install
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>And for <code class="docutils literal"><span class="pre">TA-lib</span></code> on OS X you can just run:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>brew install ta-lib
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then run <code class="docutils literal"><span class="pre">pip</span> <span class="pre">install</span></code> TA-lib:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>pip install -r ./etc/requirements_talib.txt
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>You should now be free to run tests:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>nosetests
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="continuous-integration">
|
||||
<h2>Continuous Integration<a class="headerlink" href="#continuous-integration" title="Permalink to this headline">¶</a></h2>
|
||||
<p>We use <a class="reference external" href="https://travis-ci.org/quantopian/zipline">Travis CI</a> for Linux-64 bit builds and <a class="reference external" href="https://ci.appveyor.com/project/quantopian/zipline">AppVeyor</a> for Windows-64 bit builds.</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">We do not currently have CI for OSX-64 bit builds. 32-bit builds may work but are not included in our integration tests.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="packaging">
|
||||
<h2>Packaging<a class="headerlink" href="#packaging" title="Permalink to this headline">¶</a></h2>
|
||||
<p>To learn about how we build Zipline conda packages, you can read <a class="reference external" href="release-process.html#uploading-conda-packages">this</a> section in our release process notes.</p>
|
||||
<div class="section" id="git-branching-structure">
|
||||
<h2>Git Branching Structure<a class="headerlink" href="#git-branching-structure" title="Permalink to this headline">¶</a></h2>
|
||||
<p>If you want to contribute to the codebase of Catalyst, familiarize yourself with our branching structure, a fairly standardized one for that matter, that follows what is documented in the following article: <a class="reference external" href="http://nvie.com/posts/a-successful-git-branching-model/">A successful Git branching model</a>. To contribute, create your local branch and submit a Pull Request (PR) to the <strong>develop</strong> branch.</p>
|
||||
<img alt="https://camo.githubusercontent.com/9bde6fb64a9542a572e0e2017cbb58d9d2c440ac/687474703a2f2f6e7669652e636f6d2f696d672f6769742d6d6f64656c4032782e706e67" src="https://camo.githubusercontent.com/9bde6fb64a9542a572e0e2017cbb58d9d2c440ac/687474703a2f2f6e7669652e636f6d2f696d672f6769742d6d6f64656c4032782e706e67" />
|
||||
</div>
|
||||
<div class="section" id="contributing-to-the-docs">
|
||||
<h2>Contributing to the Docs<a class="headerlink" href="#contributing-to-the-docs" title="Permalink to this headline">¶</a></h2>
|
||||
<p>If you’d like to contribute to the documentation on zipline.io, you can navigate to <code class="docutils literal"><span class="pre">docs/source/</span></code> where each <a class="reference external" href="https://en.wikipedia.org/wiki/ReStructuredText">reStructuredText</a> (<code class="docutils literal"><span class="pre">.rst</span></code>) file is a separate section there. To add a section, create a new file called <code class="docutils literal"><span class="pre">some-descriptive-name.rst</span></code> and add <code class="docutils literal"><span class="pre">some-descriptive-name</span></code> to <code class="docutils literal"><span class="pre">appendix.rst</span></code>. To edit a section, simply open up one of the existing files, make your changes, and save them.</p>
|
||||
<p>We use <a class="reference external" href="http://www.sphinx-doc.org/en/stable/">Sphinx</a> to generate documentation for Zipline, which you will need to install by running:</p>
|
||||
<p>If you’d like to contribute to the documentation on enigmampc.github.io, you can navigate to <code class="docutils literal"><span class="pre">docs/source/</span></code> where each <a class="reference external" href="https://en.wikipedia.org/wiki/ReStructuredText">reStructuredText</a> file is a separate section there. To add a section, create a new file called <code class="docutils literal"><span class="pre">some-descriptive-name.rst</span></code> and add <code class="docutils literal"><span class="pre">some-descriptive-name</span></code> to <code class="docutils literal"><span class="pre">index.rst</span></code>. To edit a section, simply open up one of the existing files, make your changes, and save them.</p>
|
||||
<p>We use <a class="reference external" href="http://www.sphinx-doc.org/en/stable/">Sphinx</a> to generate documentation for Catalyst, which you will need to install by running:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>pip install -r ./etc/requirements_docs.txt
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To build and view the docs locally, run:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="c"># assuming you're in the Zipline root directory</span>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="c"># assuming you're in the Catalyst root directory</span>
|
||||
<span class="nv">$ </span><span class="nb">cd </span>docs
|
||||
<span class="nv">$ </span>make html
|
||||
<span class="nv">$ </span><span class="o">{</span>BROWSER<span class="o">}</span> build/html/index.html
|
||||
@@ -244,7 +207,7 @@
|
||||
<div class="section" id="commit-messages">
|
||||
<h2>Commit messages<a class="headerlink" href="#commit-messages" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Standard prefixes to start a commit message:</p>
|
||||
<div class="highlight-text"><div class="highlight"><pre>BLD: change related to building Zipline
|
||||
<div class="highlight-text"><div class="highlight"><pre>BLD: change related to building Catalyst
|
||||
BUG: bug fix
|
||||
DEP: deprecate something, or remove a deprecated object
|
||||
DEV: development tool or utility
|
||||
@@ -254,7 +217,7 @@ MAINT: maintenance commit (refactoring, typos, etc)
|
||||
REV: revert an earlier commit
|
||||
STY: style fix (whitespace, PEP8, flake8, etc)
|
||||
TST: addition or modification of tests
|
||||
REL: related to releasing Zipline
|
||||
REL: related to releasing Catalyst
|
||||
PERF: performance enhancements
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -286,6 +249,13 @@ the algorithm has little cash on hand.
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
|
||||
<a href="videos.html" class="btn btn-neutral" title="Videos" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user