Commit a23d0a29 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Deprecated the 'arosics_cli.py' argument parser call and added a new entrypoint called 'arosics'.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent e44812c8
......@@ -107,9 +107,9 @@ def run_local_coreg(args):
def get_arosics_argparser():
"""Return argument parser for arosics_cli.py program."""
"""Return argument parser for arosics console command."""
parser = argparse.ArgumentParser(
prog='arosics_cli.py',
prog='arosics',
description='Perform automatic subpixel co-registration of two satellite image datasets based on an image '
'matching approach working in the frequency domain, combined with a multistage workflow for '
......@@ -257,7 +257,7 @@ def get_arosics_argparser():
'calculated at a specific (adjustable) image position. Correction performs a global shifting in '
'X- or Y direction.',
help="detect and correct global X/Y shifts (sub argument parser) - "
"use '>>> python /path/to/arosics/bin/arosics_cli.py global -h' for documentation and usage hints")
"use 'arosics global -h' for documentation and usage hints")
gloArg = parse_coreg_global.add_argument
......@@ -293,7 +293,7 @@ def get_arosics_argparser():
'calculated shifts of each point in the grid as GCPs. Thus this class can be used to correct '
'for locally varying geometric distortions of the target image.',
help="detect and correct local shifts (sub argument parser)"
"use '>>> python /path/to/arosics/bin/arosics_cli.py local -h' for documentation and usage hints")
"use 'arosics local -h' for documentation and usage hints")
locArg = parse_coreg_local.add_argument
......@@ -330,7 +330,7 @@ def get_arosics_argparser():
return parser
if __name__ == '__main__':
def main():
from socket import gethostname
from datetime import datetime as dt
from getpass import getuser
......@@ -362,6 +362,10 @@ if __name__ == '__main__':
parsed_args.func(parsed_args)
print('\ntotal processing time: %.2fs' % (time.time() - t0))
else:
warnings.warn("The script 'arosics_cli.py' provides a command line argument parser for AROSICS and is not to be "
"used as a normal Python module.")
if __name__ == "__main__":
if 'arosics_cli.py' in sys.argv[0]:
warnings.warn("Starting the AROSICS command line argument parser with 'arosics_cli.py ...' is deprecated and "
"will be removed in future releases. Use 'arosics ...' instead.", DeprecationWarning)
sys.exit(main()) # pragma: no cover
Command line interface reference
********************************
arosics_cli.py
--------------
arosics
-------
At the command line, arosics provides the **arosics_cli.py** command:
At the command line, arosics provides the **arosics** command:
.. argparse::
:filename: ./../bin/arosics_cli.py
:func: get_arosics_argparser
:prog: arosics_cli.py
:prog: arosics
.. note::
......
......@@ -202,11 +202,11 @@ The help instructions of the console interface can be accessed like this:
.. code-block:: bash
$ python arosics_cli.py -h
$ arosics -h
Follow these instructions to run AROSICS from a shell console. For example, the most simple call for a global
co-registration would look like this:
.. code-block:: bash
$ python arosics_cli.py global /path/to/your/ref_image.bsq /path/to/your/tgt_image.bsq
$ arosics global /path/to/your/ref_image.bsq /path/to/your/tgt_image.bsq
......@@ -178,4 +178,4 @@ co-registration would look like this:
.. code-block:: bash
$ python arosics_cli.py local /path/to/your/ref_image.bsq /path/to/your/tgt_image.bsq 50
$ arosics local /path/to/your/ref_image.bsq /path/to/your/tgt_image.bsq 50
......@@ -88,6 +88,11 @@ setup(
'Programming Language :: Python :: 3.9',
],
description="An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data",
entry_points={
'console_scripts': [
'arosics=bin.arosics_cli:main',
],
},
extras_require={
"interactive_plotting": req_intplot,
"doc": req_doc,
......@@ -102,7 +107,7 @@ setup(
long_description=readme + '\n\n' + history,
name='arosics',
packages=find_packages(exclude=['tests*']),
scripts=["bin/arosics_cli.py"],
scripts=["bin/arosics_cli.py"], # TODO Deprecated in 1.4.1. Remove in future.
setup_requires=req_setup,
test_suite='tests',
tests_require=req + req_test,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment