insarlab / MintPy

Miami InSAR time-series software in Python
https://mintpy.readthedocs.io
Other
575 stars 252 forks source link

dep/doc: add tab completion via `argcomplete` #1065

Closed yunjunz closed 1 year ago

yunjunz commented 1 year ago

Description of proposed changes

Reminders

falkamelung commented 1 year ago

I was surprised that you can call mintpy functions using mintpy although there is no script/file called mintpy. Some explanation of why this works could be helpful.

scottstanie commented 1 year ago

I was surprised that you can call mintpy functions using mintpy although there is no script/file called mintpy. Some explanation of why this works could be helpful.

These come from the Mintpy entry points, which is the typical way a python package can make a command line tool available when you pip install the package (without messing with any $PYTHONPATH or $PATH environment variables). https://setuptools.pypa.io/en/latest/userguide/entry_point.html#console-scripts gives a minimal example to see how that works

yunjunz commented 1 year ago

I was surprised that you can call mintpy functions using mintpy although there is no script/file called mintpy. Some explanation of why this works could be helpful.

This nice feature was introduced in version 1.5.0 by @avalentino. It's very similar to the latest GMT. I have not advertised it heavily yet, as it may be confusing to users who are used to the view.py style.