Skip to content

Commit b0449bf

Browse files
authored
Merge pull request #37 from DiamondLightSource/switch-docs-to-sphinx
Switch docs to sphinx
2 parents 948d6ca + acec366 commit b0449bf

Some content is hidden

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

41 files changed

+835
-631
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ component_type: library
99
description: Accelerator Toolbox Interface for Pytac
1010
distribution_name: atip
1111
docker: false
12-
docs_type: README
12+
docs_type: sphinx
1313
git_platform: github.com
1414
github_org: DiamondLightSource
1515
package_name: atip

.github/workflows/_docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
workflow_call:
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Avoid git conflicts when tag and branch pushed at same time
10+
if: github.ref_type == 'tag'
11+
run: sleep 60
12+
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
# Need this to get version number from last tag
17+
fetch-depth: 0
18+
19+
- name: Install system packages
20+
run: sudo apt-get install graphviz
21+
22+
- name: Install python packages
23+
uses: ./.github/actions/install_requirements
24+
25+
- name: Build docs
26+
run: tox -e docs
27+
28+
- name: Remove environment.pickle
29+
run: rm build/html/.doctrees/environment.pickle
30+
31+
- name: Upload built docs artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: docs
35+
path: build
36+
37+
- name: Sanitize ref name for docs version
38+
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV
39+
40+
- name: Move to versioned directory
41+
run: mv build/html .github/pages/$DOCS_VERSION
42+
43+
- name: Write switcher.json
44+
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
45+
46+
- name: Publish Docs to gh-pages
47+
if: github.ref_type == 'tag' || github.ref_name == 'main'
48+
# We pin to the SHA, not the tag, for security reasons.
49+
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
50+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_dir: .github/pages
54+
keep_files: true

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
secrets:
3535
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3636

37+
docs:
38+
needs: check
39+
if: needs.check.outputs.branch-pr == ''
40+
uses: ./.github/workflows/_docs.yml
41+
3742
dist:
3843
needs: check
3944
if: needs.check.outputs.branch-pr == ''
@@ -48,7 +53,7 @@ jobs:
4853

4954
release:
5055
if: github.ref_type == 'tag'
51-
needs: [dist]
56+
needs: [dist, docs]
5257
uses: ./.github/workflows/_release.yml
5358
permissions:
5459
contents: write

.github/workflows/periodic.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Periodic
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Run weekly to check URL links still resolve
7+
- cron: "0 8 * * WED"
8+
9+
jobs:
10+
linkcheck:
11+
uses: ./.github/workflows/_tox.yml
12+
with:
13+
tox: docs build -- -b linkcheck

INSTALL.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ Initial Setup and Installation
2020
$ cd <source-directory>
2121
$ git clone https://github.com/DiamondLightSource/atip.git
2222

23-
2. Create a pipenv and install the dependencies::
23+
2. From within a python virtual environment, install the dependencies::
2424

2525
$ cd atip
26-
$ pipenv install --dev
27-
$ pipenv shell
26+
$ pip install -e ./
2827

2928
3. Run the tests to ensure everything is working correctly::
3029

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,35 @@
33
[![PyPI](https://img.shields.io/pypi/v/atip.svg)](https://pypi.org/project/atip)
44
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
55

6-
# atip
76

8-
Accelerator Toolbox Interface for Pytac
7+
# ATIP - Accelerator Toolbox Interface for Pytac
98

10-
This is where you should write a short paragraph that describes what your module does,
11-
how it does it, and why people should use it.
9+
ATIP is an addition to [Pytac](<https://github.com/DiamondLightSource/pytac>),
10+
a framework for controlling particle accelerators. ATIP adds a simulator to
11+
Pytac, which can be used and addressed in the same way as a real accelerator.
1212

13-
Source | <https://github.com/DiamondLightSource/atip>
14-
:---: | :---:
15-
PyPI | `pip install atip`
16-
Releases | <https://github.com/DiamondLightSource/atip/releases>
13+
ATIP enables the easy offline testing of high level accelerator
14+
controls applications, by either of two methods:
1715

18-
This is where you should put some images or code snippets that illustrate
19-
some relevant examples. If it is a library then you might put some
20-
introductory code here:
16+
* By replacing the real accelerator at the point where it is addressed by the
17+
software, in the Pytac lattice object;
2118

22-
```python
23-
from atip import __version__
19+
* In a standalone application as a "virtual accelerator", publishing the same
20+
control system interface as the live machine. At Diamond Light Source this
21+
has been implemented with EPICS, and run on a different port to the
22+
operational control system. So the only change required to test software is
23+
to configure this EPICS port.
2424

25-
print(f"Hello atip {__version__}")
26-
```
25+
The python implementation of
26+
[Accelerator Toolbox](<https://github.com/atcollab/at>) (pyAT) is used for the
27+
simulation.
2728

28-
Or if it is a commandline tool then you might put some example commands here:
29+
Source | <https://github.com/DiamondLightSource/atip>
30+
:---: | :---:
31+
PyPI | `pip install atip`
32+
Docker | `docker run ghcr.io/diamondlightsource/atip:latest`
33+
Documentation | <https://diamondlightsource.github.io/atip>
34+
Installation | <https://diamondlightsource.github.io/atip/tutorials/installation>
35+
Releases | <https://github.com/DiamondLightSource/atip/releases>
2936

30-
```
31-
python -m atip --version
32-
```
37+
<!-- README only content. Anything below this line won't be included in index.md -->

README.rst

Lines changed: 0 additions & 216 deletions
This file was deleted.

0 commit comments

Comments
 (0)