forked from IMAP-Science-Operations-Center/imap_processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into all-contributors/add-bourque
- Loading branch information
Showing
17 changed files
with
952 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Documentation Build" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | ||
cancel-in-progress: true | ||
on: | ||
- pull_request | ||
- release | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[doc] | ||
- name: Build documentation | ||
run: | | ||
make -C docs html | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: DocumentationHTML | ||
path: docs/build/html/ | ||
|
||
# Publish built docs to gh-pages branch | ||
- name: Commit documentation changes | ||
# push docs only when a GitHub Release is made | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
run: | | ||
git clone https://github.com/IMAP-Science-Operations-Center/imap_processing.git --branch gh-pages --single-branch gh-pages | ||
cp -r docs/build/html/* gh-pages/ | ||
cd gh-pages | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update documentation" -a || true | ||
# The above command will fail if no changes were present, so we ignore that. | ||
- name: Publish docs | ||
# push docs only when a GitHub Release is made | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: gh-pages | ||
directory: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Documentation | ||
|
||
## Building documentation | ||
|
||
1. Install the documentation dependencies | ||
2. Build the html documents under the `docs` directory | ||
|
||
Using poetry: | ||
|
||
```bash | ||
# Install the optional documentation dependencies | ||
poetry install --extras "doc" | ||
# Make the html documentation | ||
cd docs/source | ||
poetry run sphinx-build . build | ||
# View the documentation | ||
open build/html/index.html | ||
``` | ||
|
||
Using pip: | ||
|
||
```bash | ||
# Install the optional documentation dependencies | ||
pip install .[doc] | ||
# Make the html documentation | ||
make -C docs html | ||
# View the documentation | ||
open docs/build/html/index.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
""" | ||
Configuration file for the Sphinx documentation builder. | ||
This file only contains a selection of the most common options. For a full | ||
list see the documentation: | ||
https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
""" | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
import sys | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use resolve() to make it absolute, like shown here. | ||
# | ||
from pathlib import Path | ||
|
||
import imap_processing | ||
|
||
sys.path.insert(0, Path("../../imap_processing").resolve()) | ||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = "imap_processing" | ||
copyright = "2023, Regents of the University of Colorado" | ||
author = "IMAP Science Operations Center" | ||
|
||
# The full version, including alpha/beta/rc tags | ||
release = imap_processing.__version__ | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.githubpages", # Helpful for publishing to gh-pages | ||
"sphinx.ext.napoleon", | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = [] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "pydata_sphinx_theme" | ||
|
||
html_logo = "_static/imap-mark-hor-multicolor-dark.png" | ||
|
||
html_theme_options = { | ||
"github_url": "https://github.com/IMAP-Science-Operations-Center/imap_processing", | ||
} | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ["_static"] | ||
|
||
# Autosummary | ||
autosummary_generate = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.. _development: | ||
|
||
Development | ||
=========== | ||
|
||
To contribute to imap_processing, you can fork the GitHub repository, | ||
add your code, and make a pull request. If you are adding additional functionality, | ||
you should also include a test with your enhancement. | ||
|
||
imap_processing is designed to be run in a containerized environment, so | ||
the dependencies will be locked in after a release and the data products will | ||
be versioned appropriately to correspond with the code that produced them. | ||
|
||
A typical development workflow might look like the following: | ||
|
||
.. code:: bash | ||
# Install the development dependencies | ||
pip install .[dev] | ||
# Install the pre-commit hooks | ||
pre-commit install | ||
# Update the code on a feature branch | ||
git checkout -b my-cool-feature | ||
# Run the tests | ||
pytest | ||
# Commit the changes and push to your remote repository | ||
git add my-file | ||
git commit | ||
git push -u origin my-cool-feature | ||
# Go to GitHub and open a pull request! |
Oops, something went wrong.