Skip to content

Commit 3526de2

Browse files
authored
Docs: python3 -m pip & Virtual Env (#2656)
* Docs: `python3 -m pip` Use `python3 -m pip`: - works independent of PATH - always uses the right Python - is the recommended way to use `pip` * Dependencies: Python incl. venv Backported from #2556. Follow-up to #2653
1 parent 7cbe85f commit 3526de2

File tree

7 files changed

+22
-14
lines changed

7 files changed

+22
-14
lines changed

Docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This explains how to generate the documentation for Warpx, and contribute to it.
88

99
Install the Python requirements for compiling the documentation:
1010
```
11-
pip install sphinx sphinx_rtd_theme
11+
python3 -m pip install sphinx sphinx_rtd_theme
1212
```
1313

1414
### Compiling the documentation

Docs/source/dataanalysis/openpmdviewer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ openPMD-viewer can be installed via ``conda`` or ``pip``:
2121
2222
.. code-block:: bash
2323
24-
pip install openPMD-viewer openPMD-api
24+
python3 -m pip install openPMD-viewer openPMD-api
2525
2626
Usage
2727
-----

Docs/source/dataanalysis/picviewer.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Required software
4343

4444
::
4545

46-
pip install git+https://github.com/yt-project/yt.git --user
46+
python3 -m pip install git+https://github.com/yt-project/yt.git --user
4747

4848
* numba
4949

@@ -53,15 +53,15 @@ Installation
5353

5454
::
5555

56-
pip install picviewer
56+
python3 -m pip install picviewer
5757

5858
You need to install yt and PySide separately.
5959

6060
You can install from the source for the latest update,
6161

6262
::
6363

64-
pip install git+https://bitbucket.org/ecp_warpx/picviewer/
64+
python3 -m pip install git+https://bitbucket.org/ecp_warpx/picviewer/
6565

6666

6767
To install manually

Docs/source/dataanalysis/yt.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ From the terminal, install the latest version of yt:
1919

2020
.. code-block:: bash
2121
22-
pip install cython
23-
python -m pip install --upgrade yt
22+
python3 -m pip install cython
23+
python3 -m pip install --upgrade yt
2424
2525
Alternatively, yt can be installed via their installation script, see `yt installation web page <https://yt-project.org/doc/installing.html>`__.
2626

Docs/source/developers/documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ First, change into ``Docs/`` and install the Python requirements:
5555
.. code-block:: sh
5656
5757
cd Docs/
58-
pip install -r requirements.txt
58+
python3 -m pip install -r requirements.txt
5959
6060
You will also need Doxygen (macOS: ``brew install doxygen``; Ubuntu: ``sudo apt install doxygen``).
6161

Docs/source/developers/testing.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ Add a test to the suite
7777
There are three steps to follow to add a new automated test (illustrated here for PML boundary conditions):
7878

7979
* An input file for your test, in folder `Example/Tests/...`. For the PML test, the input file is at ``Examples/Tests/PML/inputs_2d``. You can also re-use an existing input file (even better!) and pass specific parameters at runtime (see below).
80-
* A Python script that reads simulation output and tests correctness versus theory or calibrated results. For the PML test, see ``Examples/Tests/PML/analysis_pml_yee.py``. It typically ends with Python statement `assert( error<0.01 )`.
81-
* Add an entry to [Regression/WarpX-tests.ini](./Regression/WarpX-tests.ini), so that a WarpX simulation runs your test in the continuous integration process, and the Python script is executed to assess the correctness. For the PML test, the entry is
80+
* A Python script that reads simulation output and tests correctness versus theory or calibrated results. For the PML test, see ``Examples/Tests/PML/analysis_pml_yee.py``. It typically ends with Python statement ``assert( error<0.01 )``.
81+
* If you need a new Python package dependency for testing, add it in ``Regression/requirements.txt``
82+
* Add an entry to ``Regression/WarpX-tests.ini``, so that a WarpX simulation runs your test in the continuous integration process, and the Python script is executed to assess the correctness. For the PML test, the entry is
8283

8384
.. code-block::
8485

Docs/source/install/dependencies.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ Optional dependencies include:
2525
- see `optional I/O backends <https://github.com/openPMD/openPMD-api#dependencies>`__
2626
- `CCache <https://ccache.dev>`__: to speed up rebuilds (For CUDA support, needs version 3.7.9+ and 4.2+ is recommended)
2727
- `Ninja <https://ninja-build.org>`__: for faster parallel compiles
28+
- `Python 3.6+ <https://www.python.org>`__
29+
30+
- `mpi4py <https://mpi4py.readthedocs.io>`__
31+
- `numpy <https://numpy.org>`__
32+
- `periodictable <https://periodictable.readthedocs.io>`__
33+
- `picmistandard <https://picmi-standard.github.io>`__
34+
- see our ``requirements.txt`` file for compatible versions
2835

2936

3037
Install
@@ -67,7 +74,7 @@ If you also want to run runtime tests and added Python (``spack add python`` and
6774

6875
.. code-block:: bash
6976
70-
python -m pip install matplotlib==3.2.2 yt scipy numpy openpmd-api
77+
python3 -m pip install matplotlib==3.2.2 yt scipy numpy openpmd-api virtualenv
7178
7279
If you want to run the ``./run_test.sh`` :ref:`test script <developers-testing>`, which uses our legacy GNUmake build system, you need to set the following environment hints after ``spack env activate warpx-dev`` for dependent software:
7380

@@ -118,7 +125,7 @@ Without MPI:
118125

119126
.. code-block:: bash
120127
121-
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp openpmd-api python numpy scipy yt fftw matplotlib mamba ninja
128+
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp openpmd-api python numpy scipy yt fftw matplotlib mamba ninja pip virtualenv
122129
source activate warpx-dev
123130
124131
# compile WarpX with -DWarpX_MPI=OFF
@@ -127,7 +134,7 @@ With MPI (only Linux/macOS):
127134

128135
.. code-block:: bash
129136
130-
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp "openpmd-api=*=mpi_openmpi*" python numpy scipy yt "fftw=*=mpi_openmpi*" matplotlib mamba ninja openmpi
137+
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp "openpmd-api=*=mpi_openmpi*" python numpy scipy yt "fftw=*=mpi_openmpi*" matplotlib mamba ninja openmpi pip virtualenv
131138
source activate warpx-dev
132139
133140
For legacy ``GNUmake`` builds, after each ``source activate warpx-dev``, you also need to set:
@@ -145,7 +152,7 @@ Apt (Debian/Ubuntu)
145152
.. code-block:: bash
146153
147154
sudo apt update
148-
sudo apt install build-essential ccache cmake g++ git libfftw3-mpi-dev libfftw3-dev libhdf5-openmpi-dev libopenmpi-dev pkg-config python3 python3-matplotlib python3-numpy python3-scipy
155+
sudo apt install build-essential ccache cmake g++ git libfftw3-mpi-dev libfftw3-dev libhdf5-openmpi-dev libopenmpi-dev pkg-config python3 python3-matplotlib python3-numpy python3-pip python3-scipy python3-venv
149156
150157
# optional:
151158
# for CUDA, either install

0 commit comments

Comments
 (0)