Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the API #216

Merged
merged 18 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/pages.yml → .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ on:
required: true
default: false

defaults:
run:
shell: bash -l {0}

jobs:

pages:
docs:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -51,8 +55,20 @@ jobs:
run: pip install --no-deps -e . -vv

- name: Sphinx
id: deployment
run: make -C docs html

- name: Diagnostic
run: ls -lAFgh docs/build/html
# ${{ steps.deployment.outputs.artifact }}

- name: Upload Docs ZIP file as artifact
uses: actions/upload-artifact@v4
with:
name: gemviz-docs
path: docs/build/html
# ${{ steps.deployment.outputs.artifact }}

- name: Publish (push gh-pages branch) only on demand
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.event.inputs.deploy }}
Expand Down
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,14 @@ This project is still in development.
We have [plans for production
release](https://github.com/orgs/BCDA-APS/projects/6).
Until the production release, you should run `gemviz`
as would a developer by following these instructions:
as would a developer by following the [installation](file:///home/prjemian/Documents/projects/BCDA-APS/gemviz/docs/build/html/install.html) instructions.

1. Navigate to a directory where you have similar software projects
2. `git clone https://github.com/BCDA-APS/gemviz`
- only need to do this once, assumes you have `git` command
3. `cd gemviz`
4. `conda env create --force -n gemviz -f ./env.yml`
- only need to do this once, assumes you have `conda` command
5. `conda activate gemviz`
6. `pip install -e .`
7. `gemviz &`

The [gemviz package is now available on PyPI](https://pypi.org/project/gemviz/) which means
a development version can be installed via `pip`:
The gemviz package is now available on [PyPI](https://pypi.org/project/gemviz/)
and [conda-forge](https://anaconda.org/conda-forge/gemviz). A Development
version for either can be installed with one of these commands:

```bash
conda install conda-forge::gemviz
pip install gemviz
```

Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
coverage
coveralls
pydata-sphinx-theme
pytz
setuptools-scm
sphinx
sphinx-design
sphinx-tabs
tzdata
Binary file added docs/source/_static/gemviz_gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
====================================
Source Code Documentation
====================================

.. toctree::
:glob:
:caption: Contents:

api/*
testing
7 changes: 7 additions & 0 deletions docs/source/api/aboutdialog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
About Dialog
====================================

.. automodule:: gemviz.aboutdialog
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/app.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
Application starting point.
====================================

.. automodule:: gemviz.app
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/bluesky_runs_catalog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
BRC_MVC
====================================

.. automodule:: gemviz.bluesky_runs_catalog
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/bluesky_runs_catalog_run_viz.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
bluesky_runs_catalog_run_viz
====================================

.. automodule:: gemviz.bluesky_runs_catalog_run_viz
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/bluesky_runs_catalog_search.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
bluesky_runs_catalog_search
====================================

.. automodule:: gemviz.bluesky_runs_catalog_search
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/bluesky_runs_catalog_table_model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
bluesky_runs_catalog_table_model
====================================

.. automodule:: gemviz.bluesky_runs_catalog_table_model
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/bluesky_runs_catalog_table_view.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
bluesky_runs_catalog_table_view
====================================

.. automodule:: gemviz.bluesky_runs_catalog_table_view
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/chartview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
Chartview
====================================

.. automodule:: gemviz.chartview
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/date_time_range_slider.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
DateTimeRangeSlider
====================================

.. automodule:: gemviz.date_time_range_slider
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/licensedialog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
License Dialog
====================================

.. automodule:: gemviz.licensedialog
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/mainwindow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
Main Window of GUI
====================================

.. automodule:: gemviz.mainwindow
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/range_slider.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
Range Slider
====================================

.. automodule:: gemviz.range_slider
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/select_fields_tablemodel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
select_fields_tablemodel
====================================

.. automodule:: gemviz.select_fields_tablemodel
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/select_fields_tableview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
select_fields_tableview
====================================

.. automodule:: gemviz.select_fields_tableview
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/select_stream_fields.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
select_stream_fields
====================================

.. automodule:: gemviz.select_stream_fields
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/tapi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
============================================
TAPI: Tiled Application Programmer Interface
============================================

.. automodule:: gemviz.tapi
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/tiledserverdialog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
tiledserverdialog
====================================

.. automodule:: gemviz.tiledserverdialog
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/user_settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
User Settings
====================================

.. automodule:: gemviz.user_settings
:members:
:private-members:
7 changes: 7 additions & 0 deletions docs/source/api/utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
====================================
Utility Functions
====================================

.. automodule:: gemviz.utils
:members:
:private-members:
9 changes: 9 additions & 0 deletions docs/source/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _changes:

..
CHANGES
=======

title provided in CHANGES.rst file

.. include:: ../../CHANGES.rst
63 changes: 57 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,54 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

import pathlib
import sys
import tomllib
from importlib.metadata import version

sys.path.insert(0, str(pathlib.Path().absolute().parent.parent))
import gemviz # noqa

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "gemviz"
copyright = "2023, Fanny Rodolakis, Pete Jemian, Ollivier Gassant"
author = "Fanny Rodolakis, Pete Jemian, Ollivier Gassant"
release = "0"
root_path = pathlib.Path(__file__).parent.parent.parent

with open(root_path / "pyproject.toml", "rb") as fp:
toml = tomllib.load(fp)
metadata = toml["project"]

gh_org = "BCDA-APS"
project = metadata["name"]
copyright = toml["tool"]["copyright"]["copyright"]
author = "Ollivier Gassant, Fanny Rodolakis, Pete Jemian"
description = metadata["description"]
rst_prolog = f".. |author| replace:: {author}"
github_url = f"https://github.com/{gh_org}/{project}"

# -- Special handling for version numbers ------------------------------------
# https://github.com/pypa/setuptools_scm#usage-from-sphinx

release = version(project)
version = ".".join(release.split(".")[:2])

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []
extensions = """
sphinx.ext.autodoc
sphinx.ext.autosummary
sphinx.ext.coverage
sphinx.ext.githubpages
sphinx.ext.inheritance_diagram
sphinx.ext.mathjax
sphinx.ext.todo
sphinx.ext.viewcode
sphinx_design
""".split()
extensions.append("sphinx_tabs.tabs") # this must be last

templates_path = ["_templates"]
exclude_patterns = []
Expand All @@ -23,5 +59,20 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
html_theme = "pydata_sphinx_theme"
html_title = f"{project} {version}"

# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports
autodoc_mock_imports = """
h5py
httpx
matplotlib
numpy
PyQt5
pyRestTable
spec2nexus
tiled
xarray
yaml
""".split()
Loading