Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
245063c
init sphinx
Dec 16, 2025
12c9437
sphinx-apidoc first pass
Dec 16, 2025
c007859
autosummary working. Mostly.
Dec 16, 2025
76d5949
Doxygen + breathe + exhale
Dec 18, 2025
6084ddb
Should be api not _api
Dec 18, 2025
91da601
Remove duplicates in C++ docs
Jan 8, 2026
9aa4295
Write a new workflow to automatically build and publish docs to GH Pages
Jan 12, 2026
cfa0083
Don't build docs on PR
Jan 12, 2026
c66b290
Add markdown support and 'copy' button on codeblocks
Jan 13, 2026
59ce106
formatting
Jan 13, 2026
40c83cc
remove comments
Jan 13, 2026
bce103f
split into two jobs so that build and deploy can be re-run independen…
Jan 13, 2026
5f422a4
Extend deploy job timeout to 1 hour
Jan 13, 2026
0d6552e
Move doc building to a resuable workflow
Jan 13, 2026
cdc67ff
this needs quotes ..?
Jan 13, 2026
433c3ff
Revert "this needs quotes ..?"
Jan 13, 2026
0b356fb
Adjust workflow to deploy to pyorbit-collaboration/pyorbit-collaborat…
Jan 13, 2026
9003bf6
Split cpp and python autoapi into separate dirs, introduce automodapi…
Jan 15, 2026
9684043
Adjustments to the __init__.py of orbit modules to make the docs comp…
Jan 15, 2026
baa5b3c
missing deps, move env file to doc/
Jan 15, 2026
20d4b73
Restructure for cleaner website
Jan 15, 2026
ea639f5
Automatically document based on typehints, if available
Jan 15, 2026
b10a6fc
fix mesonbuild.md warning
Jan 16, 2026
8f4ecba
Some example docstrings and correcting warnings related to formatting.
Jan 16, 2026
be59d32
needs a space here
Jan 16, 2026
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
17 changes: 10 additions & 7 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:

- name: Print Versions
run: |
.github/workflows/pip-versions.sh
.github/workflows/pip-versions.sh


centos-stream:
runs-on: ubuntu-latest
Expand All @@ -60,8 +60,8 @@ jobs:

- name: Print Versions
run: |
.github/workflows/pip-versions.sh
.github/workflows/pip-versions.sh



ubuntu:
Expand All @@ -88,7 +88,7 @@ jobs:

- name: Print Versions
run: |
.github/workflows/pip-versions.sh
.github/workflows/pip-versions.sh


conda:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:

- name: Print Versions
run: |
.github/workflows/conda-versions.sh
.github/workflows/conda-versions.sh

mpich:
runs-on: ubuntu-latest
Expand All @@ -145,4 +145,7 @@ jobs:

- name: Print Versions
run: |
.github/workflows/pip-versions.sh
.github/workflows/pip-versions.sh

build-docs:
uses: ./.github/workflows/docs-build.yml
42 changes: 42 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
workflow_call:
inputs:
upload-artifact:
required: false
type: boolean
default: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: po3
channels: conda-forge,defaults
auto-update-conda: true
environment-file: ./doc/environment.yml

- name: Install PyORBIT3
shell: bash -l {0}
run: |
# @woodtp -- MPI isn't required to build docs and enabling it causes Sphinx to segfault.
conda activate po3
pip install --config-settings=setup-args="-DUSE_MPI='none'" .

- name: Build Documentation
shell: bash -l {0}
run: |
conda activate po3
cd doc
make dirhtml

- name: Upload artifact
if: ${{ inputs.upload-artifact }}
uses: actions/upload-pages-artifact@v3
with:
path: './doc/build/dirhtml'
57 changes: 30 additions & 27 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Documentation to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
Expand All @@ -22,29 +18,36 @@ concurrency:
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
build:
uses: ./.github/workflows/docs-build.yml
with:
upload-artifact: true

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: po3
environment-file: docs-environment.yml
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "doc/"
# - name: Setup Pages
# uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './doc/build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Download Artifact
uses: actions/download-artifact@v5
with:
name: github-pages
- name: Extract artifact.tar in place
run: |
TARFILE=$(find . -type f -name "*.tar*" | head -n1)
if [ -z "$TARFILE" ]; then
echo "No tar archive found in workspace"
ls -la
exit 1
fi
mkdir -p ./site
tar -xvf "$TARFILE" -C ./site

- name: List extracted site
run: ls -R ./site

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: pyorbit-collaboration/pyorbit-collaboration.github.io
publish_dir: ./site
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ PyORBIT.egg-info
*.so
.*.swp
.eggs
.venv
_autosummary/
_api/
_cpp_api/
doc/source/reference/*.rst
doc/source/reference/*.rst.include
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ The following commands may require root access.

<details>
<summary> Click for Ubuntu-based distributions</summary>

```bash
apt-get update
apt-get install -y build-essential python3 libfftw3-dev python3-venv libpython3-dev pkg-config git
```
```
</details>

<details>
<summary> Click for Redhat-based distributions</summary>

```bash
dnf group install -y "Development Tools"
dnf install -y python3-devel fftw3-devel
Expand All @@ -47,16 +47,18 @@ The following commands may require root access.

<details>
<summary> Click for Mac</summary>

Install Homebrew, make sure that homebrew programs are in the **$PATH** (optional step in Homebrew installation)

```bash
brew install pkg-config fftw
```
</details>

#### Create Python virtual environment
Make sure that you have the correct python version installed. We require python>3.9. <br>
Create virtual environment.

```
python3 -m venv .po3
. .po3/bin/activate
Expand All @@ -70,6 +72,7 @@ The following commands may require root access.

First of all make sure you have conda installed and development packages.<br>
Development packages for Ubuntu:

```
apt update -y
apt install -y curl gpg git build-essential
Expand All @@ -87,18 +90,18 @@ pip install -U meson-python setuptools setuptools-scm

## 3. Build

If you plan to modify PyORBIT's code, install it in editable mode.
If you plan to modify PyORBIT's code, install it in editable mode.
You will NOT need to rebuild after modifications to the code. [Meson](MesonBuild.md) will rebuild as necessary on import.
```
pip install --no-build-isolation --editable .
```

Alternatively if you don't plan to modify PyORBIT's code

```
pip install .
```


## 4. Run full SNS linac example

Navigate to your **examples** directory and launch tracking of SNS linac.
Expand All @@ -116,9 +119,9 @@ pip install --config-settings=setup-args="-DUSE_MPI=none" .
Above will build PyORBIT without MPI even if MPI is present. You can change that option to `mpich`, `ompi`, `none` or `auto` (default).<br>
| MPI flavor | Installation command |
|---------------|--------------|
| No MPI | `pip install --config-settings=setup-args="-DUSE_MPI=none" .` |
| The first found MPI installation if any | `pip install --config-settings=setup-args="-DUSE_MPI=auto" .` |
| OpenMPI | `pip install --config-settings=setup-args="-DUSE_MPI=ompi" .` |
| No MPI | `pip install --config-settings=setup-args="-DUSE_MPI=none" .` |
| The first found MPI installation if any | `pip install --config-settings=setup-args="-DUSE_MPI=auto" .` |
| OpenMPI | `pip install --config-settings=setup-args="-DUSE_MPI=ompi" .` |
| MPICH | `pip install --config-settings=setup-args="-DUSE_MPI=mpich" .` |

Meson uses PKG_CONFIG to discover packages. It could be useful to help it to find your MPI installation:
Expand Down
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_doxygen
source/api
24 changes: 24 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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 clean

# 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)

clean:
rm -rf "$(SOURCEDIR)"/_doxygen "$(SOURCEDIR)"/reference/*.rst{,.include} "$(SOURCEDIR)"/_autosummary
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
23 changes: 23 additions & 0 deletions doc/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: docs
channels:
- conda-forge
dependencies:
- doxygen
- exhale
- pydata-sphinx-theme
- python=3.13
- sphinx
- sphinx-copybutton
- sphinx-autodoc-typehints
- sphinx-automodapi
- myst-parser
- breathe
- standard-imghdr
- fftw
- numpy
- scipy
- matplotlib
- meson
- pkg-config
- ninja
- graphviz
35 changes: 35 additions & 0 deletions doc/make.bat
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

%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.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
File renamed without changes.
Empty file added doc/source/_templates/.gitkeep
Empty file.
Loading