Skip to content

Commit

Permalink
Sphinx: Fix Errors/Warnings
Browse files Browse the repository at this point in the history
Fix a few Sphinx errors/warnings that I saw when building locally.
  • Loading branch information
ax3l committed Jan 7, 2025
1 parent f11ce11 commit 87df743
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/source/usage/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ This module provides elements for the accelerator lattice.
:param ds: Segment length in m.
:param k: focusing strength in m^(-2) (if unit = 0)
= (azimuthal magnetic field gradient in T/m) / (rigidity in T-m)
OR azimuthal magnetic field gradient in T/m (if unit = 1)
OR azimuthal magnetic field gradient in T/m (if unit = 1)
:param unit: specification of units for plasma lens focusing strength
:param dx: horizontal translation error in m
:param dy: vertical translation error in m
Expand Down Expand Up @@ -901,7 +901,7 @@ This module provides elements for the accelerator lattice.
:param ds: Segment length in m.
:param bscale: Scaling factor for on-axis magnetic field Bz in inverse meters (if unit = 0)
= (magnetic field Bz in T) / (rigidity in T-m)
OR Magnetic field Bz in T (SI units, if unit = 1)
OR Magnetic field Bz in T (SI units, if unit = 1)
:param cos_coefficients: array of ``float`` cosine coefficients in Fourier expansion of on-axis magnetic field Bz
(optional); default is a thin-shell model from `DOI:10.1016/J.NIMA.2022.166706 <https://doi.org/10.1016/j.nima.2022.166706>`__
:param sin_coefficients: array of ``float`` sine coefficients in Fourier expansion of on-axis magnetic field Bz
Expand Down
30 changes: 22 additions & 8 deletions examples/cfchannel/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,42 @@ The initial distribution used is a 6D waterbag.
The beam second moments should remain nearly unchanged, except for some small emittance growth due to nonlinear space charge.
This is tested using the second moments of the distribution.

In this test, the initial and final values of :math:`\sigma_x`, :math:`\sigma_y`, :math:`\sigma_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`
In this test, the initial and final values of :math:`\sigma_x`, :math:`\sigma_y`, :math:`\sigma_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values.


Run
---

This example can be run as a Python script (``python3 run_cfchannel_10nC.py``) or as an app with an input file (``impactx input_cfchannel_10nC.in``).
This example can be run as a Python script (``python3 run_cfchannel_10nC_fft.py``) or as an app with an input file (``impactx input_cfchannel_10nC_fft.in``).
Each can also be prefixed with an `MPI executor <https://www.mpi-forum.org>`__, such as ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system.

We also provide the same example with the multi-grid (MLMG) Poisson solver.

.. tab-set::

.. tab-item:: Python Script
.. tab-item:: Python Script (FFT)

.. literalinclude:: run_cfchannel_10nC_fft.py
:language: python3
:caption: You can copy this file from ``examples/cfchannel/run_cfchannel_10nC_fft.py``.

.. tab-item:: Python Script (MLMG)

.. literalinclude:: run_cfchannel_10nC.py
.. literalinclude:: run_cfchannel_10nC_mlmg.py
:language: python3
:caption: You can copy this file from ``examples/cfchannel/run_cfchannel_10nC.py``.
:caption: You can copy this file from ``examples/cfchannel/run_cfchannel_10nC_mlmg.py``.

.. tab-item:: App Input File (FFT)

.. literalinclude:: input_cfchannel_10nC_fft.in
:language: ini
:caption: You can copy this file from ``examples/cfchannel/input_cfchannel_10nC_fft.in``.

.. tab-item:: App Input File
.. tab-item:: App Input File (MLMG)

.. literalinclude:: input_cfchannel_10nC.in
.. literalinclude:: input_cfchannel_10nC_mlmg.in
:language: ini
:caption: You can copy this file from ``examples/cfchannel/input_cfchannel_10nC.in``.
:caption: You can copy this file from ``examples/cfchannel/input_cfchannel_10nC_mlmg.in``.


Analyze
Expand Down
30 changes: 22 additions & 8 deletions examples/expanding_beam/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,38 @@ Run

This example can be run **either** as:

* **Python** script: ``python3 run_expanding.py`` or
* ImpactX **executable** using an input file: ``impactx input_expanding.in``
* **Python** script: ``python3 run_expanding_fft.py`` or
* ImpactX **executable** using an input file: ``impactx input_expanding_fft.in``

For `MPI-parallel <https://www.mpi-forum.org>`__ runs, prefix these lines with ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system.

We also provide the same example with the multi-grid (MLMG) Poisson solver.

.. tab-set::

.. tab-item:: Python: Script
.. tab-item:: Python: Script (FFT)

.. literalinclude:: run_expanding_fft.py
:language: python3
:caption: You can copy this file from ``examples/expanding/run_expanding_fft.py``.

.. tab-item:: Python: Script (MLMG)

.. literalinclude:: run_expanding.py
.. literalinclude:: run_expanding_mlmg.py
:language: python3
:caption: You can copy this file from ``examples/expanding/run_expanding.py``.
:caption: You can copy this file from ``examples/expanding/run_expanding_mlmg.py``.

.. tab-item:: Executable: Input File (FFT)

.. literalinclude:: input_expanding_fft.in
:language: ini
:caption: You can copy this file from ``examples/expanding/input_expanding_fft.in``.

.. tab-item:: Executable: Input File
.. tab-item:: Executable: Input File (MLMG)

.. literalinclude:: input_expanding.in
.. literalinclude:: input_expanding_mlmg.in
:language: ini
:caption: You can copy this file from ``examples/expanding/input_expanding.in``.
:caption: You can copy this file from ``examples/expanding/input_expanding_mlmg.in``.


Analyze
Expand Down

0 comments on commit 87df743

Please sign in to comment.