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

Documentation updates #107

Merged
merged 32 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d4c768b
update workflows and make acc-models-lhc available for documentation …
fsoubelet Jul 8, 2023
bd91fec
would need acc-models-lhc in the examples folder
fsoubelet Jul 9, 2023
ef0eddc
remove this from commit, will come from the workflow run itself
fsoubelet Jul 9, 2023
c1d3a39
little bragging
fsoubelet Jul 9, 2023
5f0de46
set language
fsoubelet Jul 9, 2023
064903e
use acc-models-lhc
fsoubelet Jul 9, 2023
b6e5589
adapt used functions
fsoubelet Jul 9, 2023
403a48c
use acc-models-lhc and do some tweaks
fsoubelet Jul 9, 2023
ee7cb81
make acc-models-lhc admonition important
fsoubelet Jul 9, 2023
4079184
tweaks
fsoubelet Jul 9, 2023
c8f127d
use injection optics too
fsoubelet Jul 9, 2023
767a3fc
use acc-models-lhc and do some tweaks
fsoubelet Jul 9, 2023
be77fc8
fix opticsfile path
fsoubelet Jul 9, 2023
34db9ed
proplerly link the function for lhc setup
fsoubelet Jul 9, 2023
9c937ff
can't use accmodels here, adapted and tweaked nonetheless
fsoubelet Jul 9, 2023
7ac1c8f
dont care about this one
fsoubelet Jul 9, 2023
02f1e6b
require joblib for the documentation
fsoubelet Jul 10, 2023
506e0f8
rework the rws documentation page
fsoubelet Jul 10, 2023
64679dc
remove strange promts
fsoubelet Jul 15, 2023
f186b13
rework LHC setups example
fsoubelet Jul 15, 2023
73ea381
fix sphinx complaints about code blocks, removed prompt symbols
fsoubelet Jul 15, 2023
7e9e459
rework phase space example
fsoubelet Jul 16, 2023
0418ed4
screw this file
fsoubelet Jul 16, 2023
d764f53
make sphinx happy
fsoubelet Jul 16, 2023
b911bb9
rework phase sbs example
fsoubelet Jul 16, 2023
a93f832
rework phase fitting example
fsoubelet Jul 16, 2023
faa2856
use accmodels for free tracking example
fsoubelet Jul 16, 2023
7fcf077
also adapt the used functions ref
fsoubelet Jul 16, 2023
cf3c778
fix sphinx complaints about code blocks, removed prompt symbols
fsoubelet Jul 16, 2023
60e97da
a few more fixes
fsoubelet Jul 16, 2023
0bc58fe
fix duplicate release tag
fsoubelet Jul 16, 2023
405d607
add and reference myself hehe
fsoubelet Jul 16, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix: # only lowest supported python on ubuntu-latest
os: [ubuntu-latest]
python-version: [3.9]
python-version: [3.11]

steps:
- uses: actions/checkout@v3
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
python-version: [3.11]

steps:
- uses: actions/checkout@v3
Expand All @@ -32,6 +32,12 @@ jobs:
- name: Install optipng, dvipng and cm-super
run: sudo apt-get install -y optipng dvipng cm-super

- name: Get acc-models-lhc
run: git clone -b 2022 https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1

- name: Move acc-models-lhc to examples folder
run: mv acc-models-lhc examples/

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -42,18 +48,10 @@ jobs:
- name: Install package with doc dependencies
run: python -m pip install ".[docs]"

# Sometimes the minrpc client will close while documentation builds and I don't know why
# Forcing several successive builds here and hoping it works out (sphinx-gallery
# checks for the existence of already built examples to avoid re-running them, so
# once the gallery is built successive builds will just re-generate the html, very quickly)
- name: Build documentation
continue-on-error: true
run: make docs

# - name: Build documentation (2/n)
# continue-on-error: true
# run: make docs

# Upload artifacts if in PR so reviewers can have a quick look without building documentation from the branch locally
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand All @@ -63,10 +61,9 @@ jobs:
path: doc_build
retention-days: 7

# Upload the doc to github pages branch and publish if from a push to master
- name: Upload documentation to gh-pages
if: success() && github.ref == 'refs/heads/master' # only for pushes to master
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: doc_build
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Now default
# BRANCH: gh-pages # now default
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix: # only lowest supported python on ubuntu-latest
os: [ubuntu-latest]
python-version: [3.9]
python-version: [3.11]


steps:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __call__(self, *args, **kwargs):
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
14 changes: 7 additions & 7 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Please include the following items in a bug report:

.. code-block:: python

>>> import pyhdtoolkit
>>> print(pyhdtoolkit.version.version_info())
PyhDToolkit version: 0.21.0
Install path: /Users/felixsoubelet/Repositories/Work/PyhDToolkit/pyhdtoolkit
Python version: 3.10.6
Python implementation: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:41:54) [Clang 13.0.1 ]
Platform: macOS-12.5.1-x86_64-i386-64bit
import pyhdtoolkit
print(pyhdtoolkit.version.version_info())
# PyhDToolkit version: 0.21.0
# Install path: /Users/felixsoubelet/Repositories/Work/PyhDToolkit/pyhdtoolkit
# Python version: 3.10.6
# Python implementation: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:41:54) [Clang 13.0.1 ]
# Platform: macOS-12.5.1-x86_64-i386-64bit

Enhancement Proposals
---------------------
Expand Down
20 changes: 10 additions & 10 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ Any jupyter notebook or Python files in the mounted directory can then be used o

One can use the library by simply importing it:

.. prompt:: python >>>
.. prompt:: python

import pyhdtoolkit

This will include only the core components of ``PyhDToolkit``.
The different sub-packages must be imported separately, depending on your needs:

.. prompt:: python >>>
.. prompt:: python

import pyhdtoolkit.cpymadtools
import pyhdtoolkit.maths
Expand All @@ -78,14 +78,14 @@ All the public apis in the `~pyhdtoolkit.cpymadtools` work in the same fashion:
`~cpymad.madx.Madx` instance, and then any `args` and `kwargs` relevant to the functionality at hand.
Let's say one has initiated their ``MAD-X`` simulation through `~cpymad.madx.Madx` as follows:

.. prompt:: python >>>
.. prompt:: python

from cpymad.madx import Madx
madx = Madx()

Then using the `~pyhdtoolkit.cpymadtools` apis goes as:

.. prompt:: python >>>
.. prompt:: python

from pyhdtoolkit.cpymadtools import super_cool_function # pretend it exists ;)
super_cool_function(madx, *args, **kwargs)
Expand All @@ -111,7 +111,7 @@ Using the `~pyhdtoolkit.plotting` apis goes as:

.. tabbed:: Standalone

.. prompt:: python >>>
.. prompt:: python

from pyhdtoolkit.plotting.tune import plot_tune_diagram # for instance
plot_tune_diagram(max_order=6, differentiate_orders=True) # and enjoy the result!
Expand All @@ -120,15 +120,15 @@ Using the `~pyhdtoolkit.plotting` apis goes as:

Let's say one has initiated their ``MAD-X`` simulation through `~cpymad.madx.Madx` as follows:

.. prompt:: python >>>
.. prompt:: python

from cpymad.madx import Madx
madx = Madx()
# do some simulation with this instance

Then using the api goes as:

.. prompt:: python >>>
.. prompt:: python

from pyhdtoolkit.plotting.aperture import plot_aperture # for instance
plot_aperture(madx, *args, **kwargs) # and enjoy the result!
Expand All @@ -145,14 +145,14 @@ functions, or perform many convenient :ref:`operations <utils-operations>` on mi

For instance, one can safely run an input at the commandline with:

.. prompt:: python >>>
.. prompt:: python

from pyhdtoolkit.utils.cmdline import CommandLine
CommandLine.run("sleep 5")

Alternatively one can easily parallelise an I/O-intensive function through multithreading with:

.. prompt:: python >>>
.. prompt:: python

from pyhdtoolkit.utils.executors import MultiThreader
Threader = MultiThreader()
Expand All @@ -165,7 +165,7 @@ Alternatively one can easily parallelise an I/O-intensive function through multi
.. tip::
A useful tidbit is the following which sets up the logging level for functions in the package:

.. prompt:: python >>>
.. prompt:: python

from pyhdtoolkit.utils import logging
logging.config_logger(level="trace") # the lowest level used, will give ALL logging
Expand Down
11 changes: 11 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,15 @@ @article{Carlier:AccuracyFeasibilityMeasurement2017
journaltitle = {Physical Review Accelerators and Beams},
title = {Accuracy and Feasibility of the β * Measurement for {{LHC}} and {{High Luminosity LHC}} Using k Modulation},
year = {2017}
}

@article{PRAB:Soubelet:Rigid_Waist_Shift_Method_Local_Coupling_Correction_LHC_IR,
author = {F. Soubelet and T. Persson and R. Tomás and O. Apsimon and C.P. Welsch},
doi = {10.1103/PhysRevAccelBeams.26.051001},
journal = {{Phys. Rev. ST Accel. Beams}},
month = May,
publisher = {{American Physical Society}},
title = {{Rigid Waist Shift: A New Method for Local Coupling Corrections in the LHC Interaction Regions}},
volume = {26},
year = 2023
}
2 changes: 1 addition & 1 deletion docs/releases/v1.3.2.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _release_1.3.1:
.. _release_1.3.2:

1.3.2
-----
Expand Down
6 changes: 3 additions & 3 deletions examples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ submodules, or plots made from results of convenient functions available in `~py

Update the ``rcParams`` at runtime with:

.. prompt:: python >>>
.. prompt:: python

from matplotlib import pyplot as plt
from pyhdtoolkit.plotting.styles.thesis import MEDIUM
Expand All @@ -36,7 +36,7 @@ submodules, or plots made from results of convenient functions available in `~py

Or, for a temporary update of the ``rcParams``:

.. prompt:: python >>>
.. prompt:: python

from matplotlib import pyplot as plt
from pyhdtoolkit.plotting.styles.thesis import MEDIUM
Expand All @@ -48,7 +48,7 @@ submodules, or plots made from results of convenient functions available in `~py

Do a one-time install of the styles as **.mplstyle** files to use in `~matplotlib`:

.. prompt:: python >>>
.. prompt:: python

from matplotlib import pyplot as plt
from pyhdtoolkit.plotting.styles import install_mpl_styles
Expand Down
Loading
Loading