You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dep/doc: add tab completion via argcomplete (#1065)
+ add `argcomplete` to the dependency for tab completion capability. This package is light (only depends on pure Python), and available on pip and conda-forge (as noarch package).
- requirements.txt: add argcomplete
- setup.py: move argcomplete from optional to required
+ docs/installation.md: add "tab complete sub-commands" as another sub-section in Post-Installation Setup.
Docker allows one to run MintPy in a dedicated container, which is essentially an efficient virtual machine, and to be independent of platform OS. First, install <ahref="https://docs.docker.com/install">docker</a> if you have not already done so. Then run the following to pull the latest stable released constainer image version from <ahref="https://github.com/insarlab/MintPy/pkgs/container/mintpy">MintPy GitHub Container Registry</a> to your local machine:
24
+
Docker allows one to run MintPy in a dedicated container, which is essentially an efficient virtual machine, and to be independent of the platform OS. First, install <ahref="https://docs.docker.com/install">docker</a> if you have not already done so. Then run the following to pull the latest stable released container image version from <ahref="https://github.com/insarlab/MintPy/pkgs/container/mintpy">MintPy GitHub Container Registry</a> to your local machine:
25
25
26
26
```bash
27
27
docker pull ghcr.io/insarlab/mintpy:latest
28
28
```
29
29
30
-
<p>Check <ahref="./docker.md">docker.md</a> for more details on Docker container image usage, e.g. pulling development version and running in shell or Jupyter server.</p>
30
+
<p>Check <ahref="./docker.md">docker.md</a> for more details on Docker container image usage, e.g. pulling the development version and running in a shell or Jupyter server.</p>
31
31
</details>
32
32
33
33
<details>
34
34
<p><summary>via apt (Linux Debian)</summary></p>
35
35
36
-
MintPy is available in the main archive of the <ahref="https://tracker.debian.org/pkg/mintpy">Debian</a> GNU/Linux OS. It can be installed by using your favourite package manager or running the following command:
36
+
MintPy is available in the main archive of the <ahref="https://tracker.debian.org/pkg/mintpy">Debian</a> GNU/Linux OS. It can be installed by using your favorite package manager or running the following command:
37
37
38
38
```bash
39
39
apt install mintpy
40
40
```
41
41
42
-
The same procedure, in priciple, can be used in <ahref="https://ubuntu.com">Ubuntu</a> and all the other <ahref="https://wiki.debian.org/Derivatives/Census">Debian derivatives</a>. Check the <ahref="https://salsa.debian.org/debian-gis-team/mintpy/-/blob/master/debian/README.Debian">Debian GIS Project</a> page for more detailed usage.
42
+
The same procedure, in principle, can be used in <ahref="https://ubuntu.com">Ubuntu</a> and all the other <ahref="https://wiki.debian.org/Derivatives/Census">Debian derivatives</a>. Check the <ahref="https://salsa.debian.org/debian-gis-team/mintpy/-/blob/master/debian/README.Debian">Debian GIS Project</a> page for more detailed usage.
Install <ahref="https://docs.conda.io/en/latest/miniconda.html">miniconda</a> if you have not already done so. You may need to close and restart the shell for changes to take effect.
70
70
71
71
```bash
72
-
# use wget or curl to download in command line or click from the web browser
72
+
# use wget or curl to download in the command line or click from the web browser
73
73
# for macOS, use Miniconda3-latest-MacOSX-x86_64.sh instead.
We recommend installing mintpy in the "editable" mode. This mode installs the package without copying files to your interpreter directory (e.g. the <code>site-packages</code> directory), thus, one could "edit" the source code and have changes take effect immediately without having to rebuild and reinstall.
108
+
We recommend installing MintPy in the "editable" mode. This mode installs the package without copying files to your interpreter directory (e.g. the <code>site-packages</code> directory), thus, one could "edit" the source code and have changes take effect immediately without having to rebuild and reinstall.
# Finished adapting your PATH environment variable for use with MacPorts.
164
164
```
165
165
166
-
Update the port tree with the following command. If your network prevent the use of rsync or svn via http of port tree, try <ahref="https://trac.macports.org/wiki/howto/PortTreeTarball">Portfile Sync via a Snapshot Tarball</a>.
166
+
Update the port tree with the following command. If your network prevents the use of rsync or svn via HTTP of the port tree, try <ahref="https://trac.macports.org/wiki/howto/PortTreeTarball">Portfile Sync via a Snapshot Tarball</a>.
167
167
168
168
```
169
169
sudo port selfupdate
170
170
```
171
171
172
-
Install the dependencies by running:
172
+
Install the dependencies by running the following:
173
173
174
174
```bash
175
175
# install dependencies with macports
@@ -205,7 +205,7 @@ Same as the <a href="#21-install-on-linux">instruction for Linux</a>, except for
205
205
206
206
Set up an account for ERA5 to download weather re-analysis datasets for tropospheric delay correction as described in <ahref="https://github.com/insarlab/pyaps#2-account-setup-for-era5">insarlab/PyAPS</a>.
207
207
208
-
<code>WEATHER_DIR</code>: Optionally, if you defined an environment variable named <code>WEATHER_DIR</code> to contain the path to a directory, MintPy will download the GAM files into the indicated directory. Also, MintPy will look for the GAM files in the directory before downloading a new one to prevent downloading multiple copies if you work with different dataset that cover the same date/time.
208
+
<code>WEATHER_DIR</code>: Optionally, if you defined an environment variable named <code>WEATHER_DIR</code> to contain the path to a directory, MintPy will download the GAM files into the indicated directory. Also, MintPy will look for the GAM files in the directory before downloading a new one to prevent downloading multiple copies if you work with different datasets that cover the same date/time.
209
209
210
210
#### b. Dask for parallel processing ####
211
211
@@ -214,7 +214,7 @@ We recommend setting the <code>temporary-directory</code> in your <a href="https
214
214
```yaml
215
215
temporary-directory: /tmp # Directory for local disk like /tmp, /scratch, or /local
216
216
217
-
# If you are sharing the same machine with others, use the following instead to avoid permission issues with others.
217
+
# If you share the same machine with others, use the following instead to avoid permission issues.
@@ -227,3 +227,50 @@ export VRT_SHARED_SOURCE=0 # do not share dataset while using GDAL V
227
227
export HDF5_DISABLE_VERSION_CHECK=2 # supress the HDF5 version warning message (0 for abort; 1/2 for printout/suppress warning message)
228
228
export HDF5_USE_FILE_LOCKING=FALSE # request that HDF5 file locks should NOT be used
229
229
```
230
+
231
+
#### d. Tab complete sub-commands ####
232
+
233
+
We recommend activating the <ahref="https://kislyuk.github.io/argcomplete/">tab completion</a> as below if you:
234
+
1. Use bash or zsh shells
235
+
2. On Linux or macOS
236
+
3. Run MintPy in sub-commands style, e.g. <code>mintpy view</code> instead of <code>view.py</code>
237
+
238
+
```bash
239
+
activate-global-python-argcomplete --user
240
+
```
241
+
242
+
On macOS, there is a <ahref="https://kislyuk.github.io/argcomplete/#global-completion">bash version compatibility</a> issue, which can be fixed as below. If you use the default zsh shell, no fix is needed.
243
+
244
+
<p>
245
+
<details>
246
+
<p><summary>Click to expand for more details</summary></p>
247
+
248
+
macOS ships with an older version of the bash shell, but <code>argcomplete</code> requires the newer version, which can be installed as below.
249
+
250
+
```bash
251
+
# check the current bash version: argcomplete requires bash>=4.2
252
+
echo$BASH_VERSION
253
+
254
+
# install via mamba
255
+
mamba install bash
256
+
257
+
# add the path to /etc/shells file
258
+
echo"${CONDA_PREFIX}/bin/bash"| sudo tee -a /etc/shells
259
+
260
+
# change your shell via chsh
261
+
chsh -s "${CONDA_PREFIX}/bin/bash"
262
+
263
+
# check the current bash version
264
+
echo$BASH_VERSION
265
+
```
266
+
267
+
Then run <code>activate-global-python-argcomplete --user</code> again. You may need to add the following to your <code>~/.bash_profile</code> file.
0 commit comments