avalentino / s1isp

Sentinel-1 Instrument Source Packets decoder
Apache License 2.0
3 stars 1 forks source link

CLI not working #1

Closed sirbastiano closed 3 days ago

sirbastiano commented 6 days ago

Error from the line:

from . import version

avalentino commented 6 days ago

Ciao @sirbastiano, I'm not able to reproduce the issue. Could you please provide more details about how to reproduce the issue (e.g. the environment, Python version, the exact command)?

FWIW, the CI jobs seem to work fine and also the run that I have just triggered completes successfully although I think that it does not includes specific tests for the CLI.

avalentino commented 6 days ago
% python3 -m s1isp -h
usage: s1isp [-h] [--version] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-q] [-v] [-d] [-o OUTFILE] [--skip SKIP] [--maxcount MAXCOUNT]
             [--bytes_offset BYTES_OFFSET] [--enum-value] [--output-format {pkl,h5,csv,xlsx}] [--force] [--data {none,extract,decode}]
             filename

Sentinel-1 Instrument Source Packets decoder Command Line Interface.

positional arguments:
  filename              RAW data file name

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        logging level (default: INFO)
  -q, --quiet           suppress standard output messages, only errors are printed to screen
  -v, --verbose         print verbose output messages
  -d, --debug           print debug messages
  -o OUTFILE, --outfile OUTFILE
                        output file name for metadata (default file with the same basename of the input stored in the current working directory)
  --skip SKIP           number of ISPs to skip at the beginning of the file
  --maxcount MAXCOUNT   number of ISPs to dump
  --bytes_offset BYTES_OFFSET
                        number bytes to skip at the beginning of the file
  --enum-value          dump the enum numeric value instead of the symbolic name
  --output-format {pkl,h5,csv,xlsx}, --of {pkl,h5,csv,xlsx}
                        specify the output format (default: <EOutputFormat.PICKLE: 'pkl'>)
  --force               overwtire the output file if it already exists
  --data {none,extract,decode}
                        control the management of the user data field data (default: 'none')
sirbastiano commented 5 days ago

The error was:

Traceback (most recent call last): File "/Users/robertodelprete/Desktop/AutoFocusNet/s1isp/s1isp/cli.py", line 12, in from . import version

When I execute as a module as you suggest, the error does not occur.

avalentino commented 5 days ago

Thanks @sirbastiano, indeed s1isp/cli.py is not meant to be called as a script. I will add a clarification in the README.rst.

sirbastiano commented 5 days ago

Thanks, I am closing this issue.

avalentino commented 5 days ago

Thanks @sirbastiano , I will keep it open as a memo for me to improve the README.rst.