diff --git a/docs/requirements.txt b/docs/requirements.txt index 0b45a69c..07b21be9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst index 4c0346d5..9b172f52 100644 --- a/docs/source/api/index.rst +++ b/docs/source/api/index.rst @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index 2d88db4b..da7a742e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -39,7 +39,7 @@ 'sphinx.ext.autosummary', 'sphinx.ext.coverage', # 'sphinx.ext.intersphinx', - 'sphinx_panels', + 'sphinx_design', 'sphinx_gallery.gen_gallery', 'numpydoc' ] @@ -85,9 +85,6 @@ ] } -# Prevent panels extension from modifying page style. -panels_add_bootstrap_css = False - # Do not show type hints. autodoc_typehints = 'none' diff --git a/docs/source/development.rst b/docs/source/development.rst deleted file mode 100644 index 80607ba4..00000000 --- a/docs/source/development.rst +++ /dev/null @@ -1,4 +0,0 @@ -Development -=========== - -🚧🚧 Page under construction 🚧🚧 diff --git a/docs/source/examples/index.rst b/docs/source/examples/index.rst index b22c803a..2ea39b68 100644 --- a/docs/source/examples/index.rst +++ b/docs/source/examples/index.rst @@ -1,7 +1,7 @@ Examples ======== -🚧🚧 Page under construction 🚧🚧 +Example scripts ready to run basic simulations. .. toctree:: :maxdepth: 2 diff --git a/docs/source/getting_started/index.rst b/docs/source/getting_started/index.rst new file mode 100644 index 00000000..ea54c16e --- /dev/null +++ b/docs/source/getting_started/index.rst @@ -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 `_: + + 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} + } diff --git a/docs/source/user_guide/installation.rst b/docs/source/getting_started/installation.rst similarity index 94% rename from docs/source/user_guide/installation.rst rename to docs/source/getting_started/installation.rst index 88b95894..cd2aa0e8 100644 --- a/docs/source/user_guide/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -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 @@ -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 diff --git a/docs/source/user_guide/installation_juwels.rst b/docs/source/getting_started/installation_juwels.rst similarity index 100% rename from docs/source/user_guide/installation_juwels.rst rename to docs/source/getting_started/installation_juwels.rst diff --git a/docs/source/user_guide/installation_maxwell.rst b/docs/source/getting_started/installation_maxwell.rst similarity index 100% rename from docs/source/user_guide/installation_maxwell.rst rename to docs/source/getting_started/installation_maxwell.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index a1c51699..59f258cb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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/ @@ -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 diff --git a/docs/source/user_guide/index.rst b/docs/source/user_guide/index.rst deleted file mode 100644 index a6ef9a25..00000000 --- a/docs/source/user_guide/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -User guide -========== - -🚧🚧 Page under construction 🚧🚧 - -.. toctree:: - :maxdepth: 2 - - installation \ No newline at end of file diff --git a/tutorials/01_single_plasma_simulation.py b/tutorials/01_single_plasma_simulation.py index 9ec514ed..25f256d6 100644 --- a/tutorials/01_single_plasma_simulation.py +++ b/tutorials/01_single_plasma_simulation.py @@ -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) diff --git a/wake_t/fields/numerical_field.py b/wake_t/fields/numerical_field.py index 0abf8b8a..6fe68f91 100644 --- a/wake_t/fields/numerical_field.py +++ b/wake_t/fields/numerical_field.py @@ -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: