asdf-format/asdf

asdftools info --help not very informative

Opened this issue · 5 comments

pllim commented
$ asdftool info --help
usage: asdftool info [-h] [--max-rows MAX_ROWS] [--max-cols MAX_COLS] [--show-values] [--no-show-values] filename

Print a rendering of an ASDF tree.

positional arguments:
  filename             ASDF file to render

options:
  -h, --help           show this help message and exit
  --max-rows MAX_ROWS  maximum number of lines
  --max-cols MAX_COLS  maximum length of line
  --show-values
  --no-show-values

I have no idea what any of the options really mean. I don't see any option to only list the tree one level down.

p.s. Why can't --show-values and --no-show-values be combined into a single flag? They sound mutually exclusive.

It looks like those options correspond to options for the asdf._convenience.info function which contains slightly more information:

max_rows : int, tuple, or None, optional
Maximum number of lines to print. Nodes that cannot be
displayed will be elided with a message.
If int, constrain total number of displayed lines.
If tuple, constrain lines per node at the depth corresponding \
to the tuple index.
If None, display all lines.
max_cols : int or None, optional
Maximum length of line to print. Nodes that cannot
be fully displayed will be truncated with a message.
If int, constrain length of displayed lines.
If None, line length is unconstrained.
show_values : bool, optional
Set to False to disable display of primitive values in
the rendered tree.

Suggestions and/or PRs to improve this are appreciated. I'm not familiar with nor do I use asdftool and it's not high on my list of priorities. If it's use is required for something you're doing please let me know and I can reassess.

I agree that the help on this tool should be improved. As for the last line of your comment, did you mean "can" instead of "can't"?

pllim commented

If it's use is required for something you're doing

I just wanted a quick glance at the file structure like fitsinfo you get to use for FITS files. But I also don't need to see all the way down the tree. I just wanted the extension names (data, err, etc).

did you mean "can" instead of "can't"?

Now that I see the docstring, I think one of them should not exist at all.

Would an option like show-all-big-data be useful, where it just shows the path to arrays or tables that are sizable (e.g., not arrays that are 40 elements long)?

pllim commented

show-all-big-data

Not really, what if my data is actually small subarray or dummy test data that is very small?