-
Notifications
You must be signed in to change notification settings - Fork 0
License
scipy-lectures/lectures.scientific-python.org
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
<!DOCTYPE html> <html lang="en" data-content_root="./"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Contributing — Scientific Python Lectures</title> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" /> <link rel="stylesheet" type="text/css" href="_static/nature.css?v=c29d3f28" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/build/base-min.css" /> <link rel="stylesheet" type="text/css" href="_static/sg_gallery.css?v=d2d258e8" /> <link rel="stylesheet" type="text/css" href="_static/sg_gallery-binder.css?v=f4aeca0c" /> <link rel="stylesheet" type="text/css" href="_static/sg_gallery-dataframe.css?v=2082cf3c" /> <link rel="stylesheet" type="text/css" href="_static/sg_gallery-rendered-html.css?v=1277b6f3" /> <script src="_static/documentation_options.js?v=f7c095fe"></script> <script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/clipboard.min.js?v=a7894cd8"></script> <script src="_static/copybutton.js?v=0729d509"></script> <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script> <script src="_static/scroll_highlight_toc.js?v=cbac5d29"></script> <link rel="icon" href="_static/favicon.ico"/> <link rel="author" title="About these documents" href="about.html" /> <link rel="search" title="Search" href="search.html" /> <script defer data-domain="lectures.scientific-python.org" src="https://views.scientific-python.org/js/script.js"></script> </head><body> <!-- Use the header to add javascript --> <script type="text/javascript"> // Function to toggle tip div function toggle_tip_div(obj) { $(obj).find("p.summary").remove(); var content = $(obj).text(); var html = $(obj).html(); if ($(obj).hasClass("collapsed")) { // Expand $(obj).html('<p class="summary"><img src="_static/minus.png"></p>' + html); } else { // Collapse if(content.length > 50) { content = content.substr(0, 47); } $(obj).html('<p class="summary"><img src="_static/plus.png">' + content + '...</p>' + html); } $(obj).toggleClass("collapsed"); } $(document).ready(function () { $(".tip").each(function() { $(this).find("p.admonition-title").remove(); }); // Collapse all tips and add plus sign $(".tip").each(function() { toggle_tip_div($(this)); }); $(".tip") .click(function(event){ // Change state of the global button $('div.related li.transparent').removeClass('transparent'); toggle_tip_div($(this)); if (event.target.tagName.toLowerCase() != "a") { return true; //Makes links clickable } }); }); </script> <div class="related" role="navigation" aria-label="Related"> <h3>Navigation</h3> <ul> <li class="nav-item nav-item-0"><a href="index.html">Scientific Python Lectures</a> »</li> <li class="nav-item nav-item-this"><a href="">Contributing</a></li> <!-- Insert a tip toggle in the navigation bar --> <li class="left"> <!-- On click, expand all tips --> <!-- <a> <img src="_static/plus.png" alt="Expand tips" style="padding: 1ex;"/> <span class="hiddenlink">Collapse document to compact view</span> </a> --> </li> <li class="right edit_on_github"><a href="https://github.com/scipy-lectures/scientific-python-lectures/edit/main/CONTRIBUTING.rst">Edit <span class="tooltip"> Improve this page:<br/>Edit it on Github. </span> </a> </li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="contributing"> <h1>Contributing<a class="headerlink" href="#contributing" title="Link to this heading">¶</a></h1> <p>The Scientific Python Lectures are a community-based effort and require constant maintenance and improvements. New contributions such as wording improvements or inclusion of new topics are welcome.</p> <p>To propose bugfixes or straightforward improvements to the lectures, see the contribution guide below.</p> <p>For new topics, read the objectives first and <a class="reference external" href="https://github.com/scipy-lectures/scientific-python-lectures/issues">open an issue on the GitHub project</a> to discuss it with the editors.</p> <section id="objectives-and-design-choices-for-the-lectures"> <h2>Objectives and design choices for the lectures<a class="headerlink" href="#objectives-and-design-choices-for-the-lectures" title="Link to this heading">¶</a></h2> <p>Contributors should keep the following objectives and design choices of the Scientific Python Lectures in mind.</p> <p>Objectives:</p> <ul class="simple"> <li><p>Provide a self-contained introduction to Python and its primary computational packages, the ”Scientific Python stack“.</p></li> <li><p>Provide tutorials for a selection of widely-used and stable computational libraries. Currently, we cover pandas, statmodels, seaborn, scikit-image, scikit-learn, and sympy.</p></li> <li><p>Automated testing is applied to the code examples as much as possible.</p></li> </ul> <p>Design choices:</p> <ul class="simple"> <li><p>Each chapter should provide a useful basis for a 1‒2 h tutorial.</p></li> <li><p>The code should be readable.</p></li> <li><p>An idiomatic style should be followed, e.g. <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">numpy</span> <span class="pre">as</span> <span class="pre">np</span></code>, preference for array operations, PEP8 coding conventions.</p></li> </ul> </section> <section id="contributing-guide"> <h2>Contributing guide<a class="headerlink" href="#contributing-guide" title="Link to this heading">¶</a></h2> <p>The directory <code class="docutils literal notranslate"><span class="pre">guide</span></code> contains instructions on how to contribute:</p> <aside class="topic"> <p class="topic-title"><strong>Example chapter</strong></p> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="guide/index.html">How to contribute</a><ul> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#id1">How to contribute ?</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#using-github">Using GitHub</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#keeping-it-concise-collapsing-paragraphs">Keeping it concise: collapsing paragraphs</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#figures-and-code-examples">Figures and code examples</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#using-markup">Using Markup</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#linking-to-package-documentations">Linking to package documentations</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#chapter-section-subsection-paragraph">Chapter, section, subsection, paragraph</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#admonitions">Admonitions</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#clearing-floats">Clearing floats</a></li> <li class="toctree-l2"><a class="reference internal" href="guide/index.html#references">References</a></li> </ul> </li> </ul> </div> </aside> </section> <section id="building-instructions"> <h2>Building instructions<a class="headerlink" href="#building-instructions" title="Link to this heading">¶</a></h2> <p>To generate the html output for on-screen display, Type:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">html</span> <div class="newline"></div></pre></div> </div> <p>the generated html files can be found in <code class="docutils literal notranslate"><span class="pre">build/html</span></code></p> <p>The first build takes a long time, but information is cached and subsequent builds will be faster.</p> <p>To generate the pdf file for printing:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">pdf</span> <div class="newline"></div></pre></div> </div> <p>The pdf builder is a bit difficult and you might have some TeX errors. Tweaking the layout in the <code class="docutils literal notranslate"><span class="pre">*.rst</span></code> files is usually enough to work around these problems.</p> <section id="requirements"> <h3>Requirements<a class="headerlink" href="#requirements" title="Link to this heading">¶</a></h3> <p>Build requirements are listed in the <a class="reference download internal" download="" href="_downloads/b4ef698db8ca845e5845c4618278f29a/requirements.txt"><code class="xref download docutils literal notranslate"><span class="pre">requirements</span> <span class="pre">file</span></code></a>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">numpy</span><span class="o">==</span><span class="mf">2.2.5</span> <div class="newline"></div><span class="n">scipy</span><span class="o">==</span><span class="mf">1.15.2</span> <div class="newline"></div><span class="n">matplotlib</span><span class="o">==</span><span class="mf">3.10.1</span> <div class="newline"></div><span class="n">pandas</span><span class="o">==</span><span class="mf">2.2.3</span> <div class="newline"></div><span class="n">patsy</span><span class="o">==</span><span class="mf">1.0.1</span> <div class="newline"></div><span class="n">pyarrow</span><span class="o">==</span><span class="mf">20.0.0</span> <div class="newline"></div><span class="n">scikit</span><span class="o">-</span><span class="n">learn</span><span class="o">==</span><span class="mf">1.6.1</span> <div class="newline"></div><span class="n">scikit</span><span class="o">-</span><span class="n">image</span><span class="o">==</span><span class="mf">0.25.2</span> <div class="newline"></div><span class="n">sympy</span><span class="o">==</span><span class="mf">1.14.0</span> <div class="newline"></div><span class="n">statsmodels</span><span class="o">==</span><span class="mf">0.14.4</span> <div class="newline"></div><span class="n">seaborn</span><span class="o">==</span><span class="mf">0.13.2</span> <div class="newline"></div><span class="n">pytest</span><span class="o">>=</span><span class="mf">8.3</span> <div class="newline"></div><span class="n">sphinx</span><span class="o">>=</span><span class="mf">8.2</span> <div class="newline"></div><span class="n">sphinx</span><span class="o">-</span><span class="n">gallery</span><span class="o">>=</span><span class="mf">0.19</span> <div class="newline"></div><span class="n">sphinx</span><span class="o">-</span><span class="n">copybutton</span> <div class="newline"></div><span class="n">coverage</span><span class="o">>=</span><span class="mf">7.6</span> <div class="newline"></div><span class="n">Pillow</span> <div class="newline"></div><span class="n">pooch</span> <div class="newline"></div><span class="n">ipython</span> <div class="newline"></div><span class="n">pickleshare</span> <div class="newline"></div><span class="n">pre</span><span class="o">-</span><span class="n">commit</span><span class="o">==</span><span class="mf">4.2.0</span> <div class="newline"></div><span class="n">requests</span> <div class="newline"></div><span class="n">sphinxcontrib</span><span class="o">-</span><span class="n">jquery</span> <div class="newline"></div></pre></div> </div> <p>Ensure that you have a <a class="reference external" href="https://docs.python.org/3/library/venv.html">virtual environment</a> or conda environment set up, then install requirements with:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">requirements</span><span class="o">.</span><span class="n">txt</span> <div class="newline"></div></pre></div> </div> <p>Note that you will also need the following system packages:</p> <blockquote> <div><ul class="simple"> <li><p>Python C development headers (the <cite>python3-dev</cite> package on Debian, e.g.),</p></li> <li><p>a C compiler like gcc,</p></li> <li><p><a class="reference external" href="https://www.gnu.org/software/make/">GNU Make</a>,</p></li> <li><p>a full LaTeX distribution such as <a class="reference external" href="https://www.tug.org/texlive/">TeX Live</a> (<code class="docutils literal notranslate"><span class="pre">texlive-latex-base</span></code>, <code class="docutils literal notranslate"><span class="pre">texlive-latex-extra</span></code>, <code class="docutils literal notranslate"><span class="pre">texlive-fonts-extra</span></code>, and <code class="docutils literal notranslate"><span class="pre">latexmk</span></code> on Debian/Ubuntu),</p></li> <li><p><a class="reference external" href="http://savannah.nongnu.org/projects/dvipng/">dvipng</a>,</p></li> <li><p><a class="reference external" href="https://personal.psu.edu/~jcc8/software/latexmk/">latexmk</a>,</p></li> <li><p><a class="reference external" href="https://git-scm.com/">git</a>.</p></li> </ul> </div></blockquote> </section> <section id="updating-the-cover"> <h3>Updating the cover<a class="headerlink" href="#updating-the-cover" title="Link to this heading">¶</a></h3> <p>Use inkscape to modify the cover in <code class="docutils literal notranslate"><span class="pre">images/</span></code>, then export to PDF:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">inkscape</span> <span class="o">--</span><span class="n">export</span><span class="o">-</span><span class="n">filename</span><span class="o">=</span><span class="n">cover</span><span class="o">-</span><span class="mf">2025.</span><span class="n">pdf</span> <span class="n">cover</span><span class="o">-</span><span class="mf">2025.</span><span class="n">svg</span> <div class="newline"></div></pre></div> </div> <p>Ensure that the <code class="docutils literal notranslate"><span class="pre">images/cover.pdf</span></code> symlink points to the correct file.</p> <p><div style="clear: both"></div></p> </section> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="Main"> <div class="sphinxsidebarwrapper"> <div> <h3><a href="index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Contributing</a><ul> <li><a class="reference internal" href="#objectives-and-design-choices-for-the-lectures">Objectives and design choices for the lectures</a></li> <li><a class="reference internal" href="#contributing-guide">Contributing guide</a></li> <li><a class="reference internal" href="#building-instructions">Building instructions</a><ul> <li><a class="reference internal" href="#requirements">Requirements</a></li> <li><a class="reference internal" href="#updating-the-cover">Updating the cover</a></li> </ul> </li> </ul> </li> </ul> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/CONTRIBUTING.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <search id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </search> <script>document.getElementById('searchbox').style.display = "block"</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="Related"> <h3>Navigation</h3> <ul> <li class="nav-item nav-item-0"><a href="index.html">Scientific Python Lectures</a> »</li> <li class="nav-item nav-item-this"><a href="">Contributing</a></li> <!-- Insert a tip toggle in the navigation bar --> <li class="left"> <!-- On click, expand all tips --> <!-- <a> <img src="_static/plus.png" alt="Expand tips" style="padding: 1ex;"/> <span class="hiddenlink">Collapse document to compact view</span> </a> --> </li> <li class="right edit_on_github"><a href="https://github.com/scipy-lectures/scientific-python-lectures/edit/main/CONTRIBUTING.rst">Edit <span class="tooltip"> Improve this page:<br/>Edit it on Github. </span> </a> </li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2025. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3. </div> </body> </html>