Skip to content

Commit ce77d6b

Browse files
authored
Merge pull request #838 from nicolasaunai/doc
update documentation
2 parents f9116eb + 8ffd2f7 commit ce77d6b

23 files changed

+685
-482
lines changed

doc/source/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# -- Project information -----------------------------------------------------
2222

2323
project = "PHARE"
24-
copyright = "2018-2023, Nicolas Aunai, Roch Smets, Philip Deegan"
24+
copyright = "2018-2024, Nicolas Aunai, Roch Smets, Philip Deegan"
2525
author = "Nicolas Aunai, Roch Smets, Philip Deegan"
2626

2727
# The short X.Y version
@@ -43,22 +43,20 @@
4343
"sphinx.ext.autodoc",
4444
"sphinx.ext.mathjax",
4545
"sphinx.ext.githubpages",
46-
"sphinx.ext.autodoc",
4746
"sphinx.ext.viewcode",
4847
"sphinx.ext.doctest",
4948
"sphinx.ext.intersphinx",
5049
"sphinx.ext.autosectionlabel",
5150
"sphinx_gallery.load_style",
5251
"sphinx_codeautolink",
53-
"sphinxcontrib.apidoc",
5452
"nbsphinx",
55-
"numpydoc",
5653
]
57-
apidoc_module_dir = "../../pyphare"
58-
apidoc_output_dir = "development"
59-
apidoc_separate_modules = True
60-
apidoc_module_first = True
6154

55+
autodoc_default_options = {
56+
"members": True,
57+
"private-members": False,
58+
"special-members": False,
59+
}
6260

6361
autosectionlabel_prefix_document = True
6462
codeautolink_custom_blocks = {
@@ -104,7 +102,8 @@
104102
exclude_patterns = []
105103

106104
# The name of the Pygments (syntax highlighting) style to use.
107-
pygments_style = None
105+
# pygments_style = None
106+
pygments_style = "sphinx"
108107

109108

110109
# -- Options for HTML output -------------------------------------------------

doc/source/development/tests.rst

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

doc/source/index.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Using Adaptive Mesh Refinement, provided by the library SAMRAI, PHARE aims at
2020
filling the gap between sub-ion scales and large "MHD" scales by increasing
2121
the mesh resolution wherever the solution needs it.
2222

23+
Warning: This documentation is a work in progress. It is not complete and may contain errors.
2324

2425

2526
.. raw:: html
@@ -76,9 +77,9 @@ the mesh resolution wherever the solution needs it.
7677
:maxdepth: 1
7778
:hidden:
7879

80+
usage/simulation_inputs
7981
usage/run_from_python
8082
usage/run_from_exe
81-
usage/simulation_inputs
8283
usage/examples
8384

8485

@@ -98,14 +99,6 @@ the mesh resolution wherever the solution needs it.
9899

99100

100101

101-
.. Development
102-
.. -----------
103-
.. toctree::
104-
:caption: DEVELOPMENT
105-
:maxdepth: 1
106-
:hidden:
107-
108-
development/tests
109102

110103
.. Indices and tables
111104
.. ------------------

doc/source/modules.rst

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

doc/source/pharesee/get_data.rst

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,100 @@
33
Data analysis
44
=============
55

6+
pharesee
7+
--------
8+
9+
The data produced by phare is readable with the `pharesee` python package from
10+
the `pyphare`. Make your `PYTHONPATH` includes the directory where `pyphare` is located.
11+
12+
.. code-block:: bash
13+
14+
export PYTHONPATH=$PYTHONPATH:/path/to/PHARE/pyphare
15+
16+
17+
Then import the `pharesee` package should work:
18+
19+
.. code-block:: python
20+
21+
import pyphare.pharesee as pharesee
22+
23+
24+
25+
Reading the data
26+
----------------
27+
28+
We will imagine a situation where you have run a simulation
29+
for which `ElectromagDianostics` have been activated and you want to get the magnetic field. Assuming the data is in:
30+
31+
.. code-block:: bash
32+
33+
/data/scratch/phare_jobs/run001/
34+
35+
36+
The first step to get the data is to create a `Run` object, that basically represents
37+
your simulation and will let you interact with its data.
38+
39+
.. code-block:: python
40+
41+
from pyphare.pharesee.run import Run
42+
43+
path = "/data/scratch/phare_jobs/run001/"
44+
run = Run(path)
45+
46+
47+
Getting data is then done by calling methods of that `run` instance you just created.
48+
Every data getters takes the same form:
49+
50+
.. code-block:: python
51+
52+
run.GetXXX(time)
53+
54+
where `XXX` is the name of a physical quantity available from `pharesee`,
55+
and `time` is the time at which you want to get the data.
56+
57+
For example, to get the magnetic field at time 0.0:
58+
59+
.. code-block:: python
60+
61+
B = run.GetB(0.0)
662
7-
Getting Data
8-
============
963
1064
1165
1266
Python Patch Hierarchy
13-
======================
67+
----------------------
68+
69+
Generalities
70+
^^^^^^^^^^^^
71+
72+
The data read from a run most often takes the form of a `PatchHierarchy` instance.
73+
This python object represents the hierarchy of levels of patches where the data lies.
74+
75+
.. code-block:: python
76+
77+
B = run.GetB(0.0) # B is a PatchHierarchy
78+
79+
80+
See section :ref:
81+
82+
83+
Advanced usage
84+
^^^^^^^^^^^^^
1485

1586

1687

1788
Using the finest field available
18-
================================
89+
--------------------------------
90+
91+
1992

2093

94+
The Run methods
95+
---------------
2196

97+
.. autoclass:: pyphare.pharesee.run.Run
98+
:members:
99+
:undoc-members:
100+
:show-inheritance:
22101

23102

doc/source/pyphare.core.rst

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

doc/source/pyphare.cpp.rst

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

doc/source/pyphare.data.rst

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

doc/source/pyphare.pharein.rst

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

0 commit comments

Comments
 (0)