Skip to content

Commit f14c49a

Browse files
author
github-actions-bot
committed
Update docs [skip ci]
0 parents  commit f14c49a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7719
-0
lines changed

.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: ba2586901e2fdc843ceba61cf00da0a2
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.nojekyll

Whitespace-only changes.

_modules/index.html

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
2+
3+
<!DOCTYPE html>
4+
<html class="writer-html5" lang="en" data-content_root="../">
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Overview: module code &mdash; py_template 0.0.1 documentation</title>
9+
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
10+
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />
11+
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=fd3f3429" />
12+
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
13+
14+
15+
<!--[if lt IE 9]>
16+
<script src="../_static/js/html5shiv.min.js"></script>
17+
<![endif]-->
18+
19+
<script src="../_static/jquery.js?v=5d32c60e"></script>
20+
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
21+
<script src="../_static/documentation_options.js?v=d45e8c67"></script>
22+
<script src="../_static/doctools.js?v=9a2dae69"></script>
23+
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
24+
<script src="../_static/js/theme.js"></script>
25+
<link rel="index" title="Index" href="../genindex.html" />
26+
<link rel="search" title="Search" href="../search.html" />
27+
</head>
28+
29+
<body class="wy-body-for-nav">
30+
<div class="wy-grid-for-nav">
31+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
32+
<div class="wy-side-scroll">
33+
<div class="wy-side-nav-search" >
34+
35+
36+
37+
<a href="../index.html" class="icon icon-home">
38+
py_template
39+
</a>
40+
<div role="search">
41+
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
42+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
43+
<input type="hidden" name="check_keywords" value="yes" />
44+
<input type="hidden" name="area" value="default" />
45+
</form>
46+
</div>
47+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
48+
<p class="caption" role="heading"><span class="caption-text">Tutorials</span></p>
49+
<ul>
50+
<li class="toctree-l1"><a class="reference internal" href="../getting_started.html"> Getting started guide</a></li>
51+
</ul>
52+
<p class="caption" role="heading"><span class="caption-text">Reference</span></p>
53+
<ul>
54+
<li class="toctree-l1"><a class="reference internal" href="../py_API.html"> API</a></li>
55+
<li class="toctree-l1"><a class="reference internal" href="../genindex.html"> Index</a></li>
56+
<li class="toctree-l1"><a class="reference external" href="https://github.com/CCA-Software-Group/py_template"> GitHub repo</a></li>
57+
</ul>
58+
59+
</div>
60+
</div>
61+
</nav>
62+
63+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
64+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
65+
<a href="../index.html">py_template</a>
66+
</nav>
67+
68+
<div class="wy-nav-content">
69+
<div class="rst-content">
70+
<div role="navigation" aria-label="Page navigation">
71+
<ul class="wy-breadcrumbs">
72+
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
73+
<li class="breadcrumb-item active">Overview: module code</li>
74+
<li class="wy-breadcrumbs-aside">
75+
</li>
76+
</ul>
77+
<hr/>
78+
</div>
79+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
80+
<div itemprop="articleBody">
81+
82+
<h1>All modules for which code is available</h1>
83+
<ul><li><a href="py_template/example_module.html">py_template.example_module</a></li>
84+
</ul>
85+
86+
</div>
87+
</div>
88+
<footer>
89+
90+
<hr/>
91+
92+
<div role="contentinfo">
93+
<p>&#169; Copyright 2024, Jeff Jennings.</p>
94+
</div>
95+
96+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
97+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
98+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
99+
100+
101+
</footer>
102+
</div>
103+
</div>
104+
</section>
105+
</div>
106+
<script>
107+
jQuery(function () {
108+
SphinxRtdTheme.Navigation.enable(true);
109+
});
110+
</script>
111+
112+
</body>
113+
</html>
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
2+
3+
<!DOCTYPE html>
4+
<html class="writer-html5" lang="en" data-content_root="../../">
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>py_template.example_module &mdash; py_template 0.0.1 documentation</title>
9+
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=80d5e7a1" />
10+
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
11+
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=fd3f3429" />
12+
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
13+
14+
15+
<!--[if lt IE 9]>
16+
<script src="../../_static/js/html5shiv.min.js"></script>
17+
<![endif]-->
18+
19+
<script src="../../_static/jquery.js?v=5d32c60e"></script>
20+
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
21+
<script src="../../_static/documentation_options.js?v=d45e8c67"></script>
22+
<script src="../../_static/doctools.js?v=9a2dae69"></script>
23+
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
24+
<script src="../../_static/js/theme.js"></script>
25+
<link rel="index" title="Index" href="../../genindex.html" />
26+
<link rel="search" title="Search" href="../../search.html" />
27+
</head>
28+
29+
<body class="wy-body-for-nav">
30+
<div class="wy-grid-for-nav">
31+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
32+
<div class="wy-side-scroll">
33+
<div class="wy-side-nav-search" >
34+
35+
36+
37+
<a href="../../index.html" class="icon icon-home">
38+
py_template
39+
</a>
40+
<div role="search">
41+
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
42+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
43+
<input type="hidden" name="check_keywords" value="yes" />
44+
<input type="hidden" name="area" value="default" />
45+
</form>
46+
</div>
47+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
48+
<p class="caption" role="heading"><span class="caption-text">Tutorials</span></p>
49+
<ul>
50+
<li class="toctree-l1"><a class="reference internal" href="../../getting_started.html"> Getting started guide</a></li>
51+
</ul>
52+
<p class="caption" role="heading"><span class="caption-text">Reference</span></p>
53+
<ul>
54+
<li class="toctree-l1"><a class="reference internal" href="../../py_API.html"> API</a></li>
55+
<li class="toctree-l1"><a class="reference internal" href="../../genindex.html"> Index</a></li>
56+
<li class="toctree-l1"><a class="reference external" href="https://github.com/CCA-Software-Group/py_template"> GitHub repo</a></li>
57+
</ul>
58+
59+
</div>
60+
</div>
61+
</nav>
62+
63+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
64+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
65+
<a href="../../index.html">py_template</a>
66+
</nav>
67+
68+
<div class="wy-nav-content">
69+
<div class="rst-content">
70+
<div role="navigation" aria-label="Page navigation">
71+
<ul class="wy-breadcrumbs">
72+
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
73+
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
74+
<li class="breadcrumb-item active">py_template.example_module</li>
75+
<li class="wy-breadcrumbs-aside">
76+
</li>
77+
</ul>
78+
<hr/>
79+
</div>
80+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
81+
<div itemprop="articleBody">
82+
83+
<h1>Source code for py_template.example_module</h1><div class="highlight"><pre>
84+
<div class="viewcode-block" id="fibonacci">
85+
<a class="viewcode-back" href="../../py_API.html#py_template.example_module.fibonacci">[docs]</a>
86+
<span></span><span class="k">def</span> <span class="nf">fibonacci</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">list</span><span class="p">[</span><span class="nb">int</span><span class="p">]:</span>
87+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
88+
<span class="sd"> Example function.</span>
89+
90+
<span class="sd"> Parameters</span>
91+
<span class="sd"> ----------</span>
92+
<span class="sd"> n : int</span>
93+
<span class="sd"> Integer term up to which the sequence is calculated</span>
94+
95+
<span class="sd"> Returns</span>
96+
<span class="sd"> -------</span>
97+
<span class="sd"> fib_seq : list[int]</span>
98+
<span class="sd"> The Fibonacci sequence up to term `n`</span>
99+
<span class="sd"> &quot;&quot;&quot;</span>
100+
<span class="n">fib_seq</span> <span class="o">=</span> <span class="p">[]</span>
101+
102+
<span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span>
103+
104+
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
105+
<span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">b</span><span class="p">,</span> <span class="n">a</span> <span class="o">+</span> <span class="n">b</span>
106+
<span class="n">fib_seq</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
107+
108+
<span class="k">return</span> <span class="n">fib_seq</span></div>
109+
110+
111+
112+
<div class="viewcode-block" id="SoftwareGroup">
113+
<a class="viewcode-back" href="../../py_API.html#py_template.example_module.SoftwareGroup">[docs]</a>
114+
<span class="k">class</span> <span class="nc">SoftwareGroup</span><span class="p">:</span>
115+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
116+
<span class="sd"> Example class.</span>
117+
118+
<span class="sd"> Parameters</span>
119+
<span class="sd"> ----------</span>
120+
<span class="sd"> people : str</span>
121+
<span class="sd"> Group members</span>
122+
<span class="sd"> purpose : str</span>
123+
<span class="sd"> Group objectives</span>
124+
<span class="sd"> &quot;&quot;&quot;</span>
125+
126+
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">people</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">purpose</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
127+
<span class="bp">self</span><span class="o">.</span><span class="n">people</span> <span class="o">=</span> <span class="n">people</span>
128+
<span class="bp">self</span><span class="o">.</span><span class="n">purpose</span> <span class="o">=</span> <span class="n">purpose</span>
129+
<span class="bp">self</span><span class="o">.</span><span class="n">meeting_format</span> <span class="o">=</span> <span class="s2">&quot;hack session + office hour + periodic tutorial&quot;</span>
130+
131+
<span class="k">def</span> <span class="nf">long_term_goals</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
132+
<span class="n">research_goal</span> <span class="o">=</span> <span class="s2">&quot;develop open-source research software for astronomy&quot;</span>
133+
<span class="n">community_goal</span> <span class="o">=</span> <span class="s2">&quot;improve diversity in astro software positions&quot;</span>
134+
<span class="n">education_goal</span> <span class="o">=</span> <span class="s2">&quot;organize and run astro software workshops&quot;</span>
135+
<span class="n">cca_goal</span> <span class="o">=</span> <span class="s2">&quot;improve software knowledge and practices at CCA&quot;</span>
136+
<span class="k">return</span> <span class="s2">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span>
137+
<span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">purpose</span><span class="p">,</span> <span class="n">research_goal</span><span class="p">,</span> <span class="n">community_goal</span><span class="p">,</span> <span class="n">education_goal</span><span class="p">,</span> <span class="n">cca_goal</span><span class="p">]</span>
138+
<span class="p">)</span></div>
139+
140+
</pre></div>
141+
142+
</div>
143+
</div>
144+
<footer>
145+
146+
<hr/>
147+
148+
<div role="contentinfo">
149+
<p>&#169; Copyright 2024, Jeff Jennings.</p>
150+
</div>
151+
152+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
153+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
154+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
155+
156+
157+
</footer>
158+
</div>
159+
</div>
160+
</section>
161+
</div>
162+
<script>
163+
jQuery(function () {
164+
SphinxRtdTheme.Navigation.enable(true);
165+
});
166+
</script>
167+
168+
</body>
169+
</html>

_sources/getting_started.rst.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Getting started
2+
===============
3+
4+
Repo file structure
5+
-------------------
6+
| The `py_template` repo has a basic file structure:
7+
| 1) `.github` has two subfolders:
8+
| * `ISSUE_TEMPLATE` has files that are templates users can select from when opening an issue in the repo on GitHub
9+
| * `workflows` implements continuous integration (CI) through GitHub 'actions' that are automatically run according to a chosen trigger. These are currently:
10+
| - `docs.yml` builds and deploys this docs site when a push is made to `main`.
11+
| - `format_lint.yml` lints and formats the code on each push using *ruff* and *black*.
12+
| - `package.yml` releases the package to PyPI on each *release* (create a release from the repo's main GitHub page). This makes the latest release version of the package *pip*-installable. For a guide on how to first reserve a name for your project on PyPI (necessary for this workflow), see the `Python packaging guide <https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/>`_.
13+
| - `tests.yml` runs tests with *pytest* on each push.
14+
| - `type_check.yml` runs type checking with *mypy* on each push. The CI continues even if the type checker finds errors.
15+
| 2) `docs` has the files used to build the docs with *Sphinx*, with the site content in `index.rst` and `py_API.rst`.
16+
| 3) `py_template` is the source code folder, with the necessary `__init__.py` and example code file, `example_module.py`.
17+
| 4) `test` has the unit tests, with example tests for the source code file in `test_example_module.py`. When you add new test files, they should start with `test_` so *pytest* recognizes them.
18+
| 5) `.gitignore` is a list of file types that are ignored when you push to the remote repo.
19+
| 6) `HISTORY.rst` is the change log that you should update as you implement the packaged version.
20+
| 7) `LICENSE.rst` has the package's license.
21+
| 8) `MANIFEST.in` has instructions for how to pre-process the package (which files to exclude) when preparing to release it to PyPI (the Python Package Index). Packages uploaded to PyPI can be installed by users with *pip*.
22+
| 9) `README.md` is the file you're reading! It has badges that use the CI to display if the unit tests are passing, what percentage of the code is covered by the tests, and if the docs build and deploy is passing.
23+
| 10) `pyproject.toml` is the configuration file for packaging the software. See the `Python docs <https://packaging.python.org/en/latest/guides/writing-pyproject-toml/>`_ for a description of its contents. See also the `example_setup_files` directory for an example minimal `pyproject.toml` and the analogous `setup.py`.
24+
25+
Making a new Python repo using `py_template`
26+
--------------------------------------------
27+
| 1) Click the 'Use this template' button at the top-right of the GitHub page.
28+
| 2) In your new repo, rename (search and replace) all instances of "py_template" with the name for your package.
29+
| 3a) If you create a public repo, to set up your docs deployment CI: from your repo page, go to 'Settings' then 'Pages', then set 'Source' as 'Deploy from a branch' and set 'Branch' as 'gh-pages'. Your docs will now deploy according to the trigger in `.github/workflows/docs.yml`
30+
| 3b) If you create a private repo, the docs build will fail because private repos can't have a public docs page. You can disable the docs build and deploy workflow in `.github/workflows/docs.yml`
31+
| 4) Update the `authors` field in `pyproject.toml`, `docs/conf.py` and `LICENSE.rst` (the template is partially based on the `OpenAstronomy packaging guide <https://github.com/OpenAstronomy/packaging-guide>`_, so please retain that aspect of the license).
32+
33+
Interacting with your new code
34+
------------------------------
35+
| After cloning your repo to your computer, from the project's root directory, you can:
36+
| 1) Install your package with all optional dependencies:
37+
| `pip install -e ".[dev]"`
38+
| 2) Run your tests:
39+
| `pytest .`
40+
| 3) Run linting and formatting to see their effects:
41+
| `black .` and `ruff check .`
42+
| 4) Run type checking using mypy:
43+
| `mypy --strict .`
44+
| 5) Build your docs locally:
45+
| `cd docs; make html`
46+
| After building the docs, view them with
47+
| `open docs/_build/html/index.html`
48+
49+
Developing your package
50+
-----------------------
51+
| 1) Add new unit tests in `test/test_*.py` for new functions and classes. Test not just whether the new code runs, but also if it gives a sensible result.
52+
| 2) Update the docs, including the main page (`docs/index.rst`), adding pages, and updating the API (`docs/py_API.rst`) when you add new functions and classes.
53+
| 3) Optionally change the CI triggers for each of the actions in `.github/workflows`.
54+
| 4) Update the changelog in `HISTORY.rst` when you're ready to release your first version of the code!

_sources/index.rst.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Documentation
2+
=============
3+
4+
Welcome to the `py_template` docs!
5+
6+
See the 'getting started' guide for steps on how to make your own Python repo using this template and considerations for building your own package.
7+
8+
The API has example entries for the function and class in `example_module.py`.
9+
10+
.. toctree::
11+
:maxdepth: 1
12+
:caption: Tutorials
13+
14+
Getting started guide <getting_started>
15+
16+
.. toctree::
17+
:maxdepth: 1
18+
:caption: Reference
19+
20+
API <py_API>
21+
Index <genindex>
22+
GitHub repo <https://github.com/CCA-Software-Group/py_template>

_sources/py_API.rst.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
example_module
2+
==============
3+
4+
.. currentmodule:: py_template.example_module
5+
6+
.. autoclass:: SoftwareGroup
7+
8+
.. autofunction:: fibonacci

0 commit comments

Comments
 (0)