Skip to content

Commit 69e52be

Browse files
committed
Anaconda installation
Plus, improvements on the argcomplete instructions.
1 parent 7c0199c commit 69e52be

File tree

4 files changed

+128
-21
lines changed

4 files changed

+128
-21
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,43 @@ It can either scan an existing earthquake catalog to search for similar events,
2020
or perform template matching on a continuous waveform stream.
2121

2222
Catalogs and waveforms can be read from local files or downloaded using
23-
standard [FDSN web services](https://www.fdsn.org/webservices/).
23+
standard [FDSN web services].
2424

25-
Requake is written in Python and uses [ObsPy](https://obspy.org) as backend.
25+
Requake is written in Python and uses [ObsPy] as backend.
2626

2727
## Installation
2828

2929
### Installing the latest release
3030

31-
#### Using pip and PyPI (preferred method)
31+
#### Using Anaconda
3232

33-
The latest release of Requake is available on the
34-
[Python Package Index](https://pypi.org/project/requake/).
33+
The following command will automatically create an [Anaconda] environment
34+
named `requake`, install the required packages and install the latest
35+
version of SourceSpec via `pip`:
36+
37+
conda env create --file https://raw.githubusercontent.com/SeismicSource/requake/main/requake_conda_env.yml
38+
39+
If you want a different name for your environment, use:
40+
41+
conda env create -n YOUR_ENV_NAME --file https://raw.githubusercontent.com/SeismicSource/requake/main/requake_conda_env.yml
42+
43+
Activate the environment with:
44+
45+
conda activate requake
46+
47+
(or `conda activate YOUR_ENV_NAME`)
48+
49+
To keep Requake updated run the following command from within the environment:
50+
51+
pip install --upgrade requake
52+
53+
Or, to switch to a development snapshot, run:
54+
55+
pip install git+https://github.com/SeismicSource/requake.git
56+
57+
#### Using pip and PyPI
58+
59+
The latest release of Requake is available on the [Python Package Index].
3560

3661
You can install it easily through `pip`:
3762

@@ -41,8 +66,7 @@ You can install it easily through `pip`:
4166

4267
If you need a recent feature that is not in the latest release (see the
4368
`unreleased` section in [CHANGELOG][changelog-link]), you want to use the more
44-
recent development snapshot from the
45-
[Requake GitHub repository](https://github.com/SeismicSource/requake).
69+
recent development snapshot from the [Requake GitHub repository].
4670

4771
#### Using pip
4872

@@ -114,9 +138,14 @@ Certain commands (e.g., `plot_pair`) require further arguments (use, e.g.,
114138
`requake plot_pair -h` to get help).
115139

116140
Requake supports command line tab completion for commands and arguments, thanks
117-
to [argcomplete](https://kislyuk.github.io/argcomplete/).
118-
To enable command line tab completion, add the following line to your `.bashrc`
119-
or `.zshrc`:
141+
to [argcomplete].
142+
To enable command line tab completion run:
143+
144+
activate-global-python-argcomplete
145+
146+
(This is a one-time command that needs to be run only once).
147+
148+
Or, alternatively, add the following line to your `.bashrc` or `.zshrc`:
120149

121150
eval "$(register-python-argcomplete requake)"
122151

@@ -182,6 +211,14 @@ You can also cite the following abstract presented at the
182211
[changelog-link]: https://github.com/SeismicSource/requake/blob/main/CHANGELOG.md
183212
[DOI-badge]: https://zenodo.org/badge/DOI/10.5281/zenodo.10832204.svg
184213
[DOI-link]: https://doi.org/10.5281/zenodo.10832204
214+
[Requake GitHub repository]: https://github.com/SeismicSource/requake
215+
216+
<!-- External links -->
217+
[FDSN web services]: https://www.fdsn.org/webservices/
218+
[ObsPy]: https://obspy.org
219+
[Anaconda]: https://www.anaconda.com/download
220+
[Python Package Index]: https://pypi.org/project/requake/
221+
[argcomplete]: https://kislyuk.github.io/argcomplete/
185222

186223
<!-- References -->
187224
[doi: 10.5281/ZENODO.10832204]: https://doi.org/10.5281/ZENODO.10832204

docs/installation.rst

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,56 @@ Installation
44
Installing the latest release
55
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66

7-
Using pip and PyPI (preferred method)
8-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7+
Using Anaconda
8+
~~~~~~~~~~~~~~
9+
10+
The following command will automatically create an `Anaconda`_ environment
11+
named ``requake``, install the required packages and install the latest
12+
version of SourceSpec via `pip`:
13+
14+
.. code-block:: text
15+
16+
conda env create --file https://raw.githubusercontent.com/SeismicSource/requake/main/requake_conda_env.yml
17+
18+
19+
If you want a different name for your environment, use:
20+
21+
.. code-block:: text
22+
23+
conda env create -n YOUR_ENV_NAME --file https://raw.githubusercontent.com/SeismicSource/requake/main/requake_conda_env.yml
24+
25+
26+
Activate the environment with:
27+
28+
.. code-block:: text
29+
30+
conda activate requake
31+
932
10-
The latest release of Requake is available on the
11-
`Python Package Index <https://pypi.org/project/requake/>`_.
33+
(or ``conda activate YOUR_ENV_NAME``)
34+
35+
To keep Requake updated run the following command from within the environment:
36+
37+
.. code-block:: text
38+
39+
pip install --upgrade requake
40+
41+
42+
Or, to switch to a development snapshot, run:
43+
44+
.. code-block:: text
45+
46+
pip install git+https://github.com/SeismicSource/requake.git
47+
48+
49+
Using pip and PyPI
50+
~~~~~~~~~~~~~~~~~~
51+
52+
The latest release of Requake is available on the `Python Package Index`_.
1253

1354
You can install it easily through ``pip``\ :
1455

15-
.. code-block::
56+
.. code-block:: text
1657
1758
pip install requake
1859
@@ -22,8 +63,7 @@ Installing a development snapshot
2263

2364
If you need a recent feature that is not in the latest release (see the
2465
``unreleased`` section in the :ref:`changelog`), you want to use the more
25-
recent development snapshot from the
26-
`Requake GitHub repository <https://github.com/SeismicSource/requake>`_.
66+
recent development snapshot from the `Requake GitHub repository`_.
2767

2868
Using pip
2969
~~~~~~~~~
@@ -70,4 +110,10 @@ mode" by running:
70110
71111
You can keep your local Requake repository updated by running ``git pull``
72112
from times to times. Thanks to ``pip``\ 's "editable mode", you don't need to
73-
reinstall Requake after each update.
113+
reinstall Requake after each update.
114+
115+
116+
.. Links:
117+
.. _Anaconda: https://www.anaconda.com/download
118+
.. _Python Package Index: https://pypi.org/project/requake/
119+
.. _Requake GitHub repository: https://github.com/SeismicSource/requake

docs/running.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,20 @@ Certain commands (e.g., ``plot_pair``\ ) require further arguments
4444

4545
Requake supports command line tab completion for commands and arguments, thanks
4646
to `argcomplete <https://kislyuk.github.io/argcomplete/>`_.
47-
To enable command line tab completion, add the following line to your
48-
``.bashrc`` or ``.zshrc``:
47+
To enable command line tab completion run:
4948

5049
.. code-block::
5150
52-
eval "$(register-python-argcomplete requake)"
51+
activate-global-python-argcomplete
52+
53+
54+
(This is a one-time command that needs to be run only once).
55+
56+
Or, alternatively, add the following line to your ``.bashrc`` or ``.zshrc``:
57+
58+
.. code-block::
59+
60+
eval "$(register-python-argcomplete requake)"
5361
5462
5563
Typical workflow

requake_conda_env.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: requake
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python>=3.7
6+
- conda
7+
- scipy>=1.5.0
8+
- obspy>=1.2.0
9+
- cartopy
10+
- argcomplete
11+
- tqdm
12+
- tabulate
13+
- pygments
14+
- pip
15+
- pip:
16+
- requake

0 commit comments

Comments
 (0)