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

Fix and update documentation #120

Merged
merged 12 commits into from
May 8, 2023
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ numpy
numba
scipy
matplotlib
aptools>=0.1.23
openpmd-api~=0.14.0
aptools~=0.2.0
openpmd-api
openpmd-viewer>=1.2.0
pydata-sphinx-theme
sphinx-panels
sphinx-design
sphinx-gallery
numpydoc
3 changes: 2 additions & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
API reference
=============

🚧🚧 Page under construction 🚧🚧
This section contains the detailed documentation of the main classes and
methods needed to perform simulations with Wake-T.

.. toctree::
:maxdepth: 3
Expand Down
5 changes: 1 addition & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
# 'sphinx.ext.intersphinx',
'sphinx_panels',
'sphinx_design',
'sphinx_gallery.gen_gallery',
'numpydoc'
]
Expand Down Expand Up @@ -85,9 +85,6 @@
]
}

# Prevent panels extension from modifying page style.
panels_add_bootstrap_css = False

# Do not show type hints.
autodoc_typehints = 'none'

Expand Down
4 changes: 0 additions & 4 deletions docs/source/development.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/examples/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Examples
========

🚧🚧 Page under construction 🚧🚧
Example scripts ready to run basic simulations.

.. toctree::
:maxdepth: 2
Expand Down
46 changes: 46 additions & 0 deletions docs/source/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Getting started
===============

Installation
------------
Wake-T is available on PyPI and can be simply installed with

.. code::

pip install Wake-T

for more detailed instructions, including guides for installing Wake-T in HPC
clusters, check the :ref:`installation_ref` section.


.. toctree::
:maxdepth: 2
:hidden:

installation


Citing Wake-T
-------------
If your usage of Wake-T leads to a scientific publication, please consider
citing the original `publication <https://dx.doi.org/10.1088/1742-6596/1350/1/012056>`_:

A Ferran Pousa, R Assmann, A Martinez de la Ossa, Wake-T: a fast particle tracking code for plasma-based accelerators, *J. Phys.: Conf. Ser.* **1350** 012056 (2019)

Bibtex:

.. code::

@article{FerranPousa_2019,
doi = {10.1088/1742-6596/1350/1/012056},
url = {https://dx.doi.org/10.1088/1742-6596/1350/1/012056},
year = {2019},
month = {nov},
publisher = {IOP Publishing},
volume = {1350},
number = {1},
pages = {012056},
author = {Ferran Pousa, A and Assmann, R and Martinez de la Ossa, A},
title = {Wake-{T}: a fast particle tracking code for plasma-based accelerators},
journal = {Journal of Physics: Conference Series}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _installation_ref:

Installation
============
Wake-T is tested on Python 3.7 and above, so make sure to have an up-to-date version
Expand Down Expand Up @@ -32,8 +34,8 @@ using ``pip``::

Latest (development) version from GitHub
----------------------------------------
.. image:: https://travis-ci.org/AngelFP/Wake-T.svg?branch=dev
:target: https://travis-ci.org/AngelFP/Wake-T
.. image:: https://github.com/AngelFP/Wake-T/actions/workflows/test-package.yml/badge.svg
:target: https://github.com/AngelFP/Wake-T/actions

The latest release on PyPI might not be fully up to date with the newest additions
to the code. If you want to stay at the bleeding edge of new features and bug fixes
Expand Down
105 changes: 44 additions & 61 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Wake-T |release| documentation
==============================

.. |travis| image:: https://travis-ci.org/AngelFP/Wake-T.svg?branch=dev
:target: https://travis-ci.org/AngelFP/Wake-T
.. |tests| image:: https://github.com/AngelFP/Wake-T/actions/workflows/test-package.yml/badge.svg
:target: https://github.com/AngelFP/Wake-T/actions

.. |PyPI| image:: https://img.shields.io/pypi/v/Wake-T.svg?logo=python&logoColor=white
:target: https://pypi.org/project/Wake-T/
Expand All @@ -18,93 +18,76 @@ Wake-T |release| documentation
.. |license| image:: https://img.shields.io/github/license/AngelFP/Wake-T
:target: https://github.com/AngelFP/Wake-T/blob/master/LICENSE

|travis| |codefactor| |PyPI| |license|
|tests| |codefactor| |PyPI| |license|

.. panels::
:card: + intro-card text-center
:column: col-lg-6 col-md-6 col-sm-6 col-xs-12 p-2 d-flex
.. grid:: 2
:gutter: 2

---
.. grid-item-card:: Getting started
:text-align: center

**User guide**
^^^^^^^^^^^^^^
Get the code up and running.

Instructions for getting the code up and running and basic information of
the key concepts behind Wake-T.
+++

+++
.. button-ref:: getting_started/index
:expand:
:color: primary
:click-parent:

.. link-button:: user_guide/index
:type: ref
:text: To the user guide
:classes: btn-outline-primary btn-block stretched-link
To the guide

---
.. grid-item-card:: Tutorials
:text-align: center

Step-by-step tutorials covering the functionality of Wake-T.

**Tutorials**
^^^^^^^^^^^^
+++

Step-by-step tutorials covering the functionality of Wake-T.
.. button-ref:: tutorials/index
:expand:
:color: primary
:click-parent:

+++
To the tutorials

.. link-button:: tutorials/index
:type: ref
:text: To the tutorials
:classes: btn-outline-primary btn-block stretched-link
.. grid-item-card:: Examples
:text-align: center

---
Explore quick examples showcasing how to use the code.

**Examples**
^^^^^^^^^^^^
+++

Explore quick examples showcasing how to use the code.
.. button-ref:: examples/index
:expand:
:color: primary
:click-parent:

+++
To the examples

.. link-button:: examples/index
:type: ref
:text: To the examples
:classes: btn-outline-primary btn-block stretched-link
.. grid-item-card:: API reference
:text-align: center

Detailed documentation of the Wake-T API.

---
+++

**API reference**
^^^^^^^^^^^^^^^^^
.. button-ref:: api/index
:expand:
:color: primary
:click-parent:

Detailed documentation of the Wake-T API.

+++

.. link-button:: api/index
:type: ref
:text: To the reference guide
:classes: btn-outline-primary btn-block stretched-link

---

**Development**
^^^^^^^^^^^^^^^

Guidelines for contributing to Wake-T.

+++

.. link-button:: development
:type: ref
:text: To the development guide
:classes: btn-outline-primary btn-block stretched-link
To the reference guide


.. toctree::
:hidden:
:maxdepth: 4

user_guide/index
getting_started/index
tutorials/index
examples/index
api/index
development



9 changes: 0 additions & 9 deletions docs/source/user_guide/index.rst

This file was deleted.

7 changes: 1 addition & 6 deletions tutorials/01_single_plasma_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,8 @@ def density_profile(z):
# To finalize the tutorial, we will visualize the output data using the
# openpmd-viewer.
#
# .. warning::
# When using the ``openpmd-viewer``, make sure to set ``backend='h5py'`` in
# the ``OpenPMDTimeSeries`` and ``LpaDiagnostics``. Otherwise, the
# ``'openpmd-api'`` backend, which currently does not work with Wake-T data,
# will be selected.

from openpmd_viewer.addons import LpaDiagnostics

diags = LpaDiagnostics('tutorial_01_diags/hdf5', backend='h5py')
diags = LpaDiagnostics('tutorial_01_diags/hdf5')
diags.get_field('rho', iteration=3, plot=True, vmin=-1e5)
2 changes: 1 addition & 1 deletion wake_t/fields/numerical_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def update(
Parameters
----------
bunches : list
List of ``ParticleBunch``es that can be used to recompute/update
List of ``ParticleBunch`` that can be used to recompute/update
the fields.
"""
if not self.initialized:
Expand Down