New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "--fields" option for glance info #13
Conversation
Prep for more extensive modifications.
No new functionlity yet, but plumbing in place.
Can now say "--fields long_name,units" and get exactly such
(What it did already)
It will force the first field to be "filename"; if it isn't, it will be prepended.
This seems reasonable. Could you give me a couple of simple examples of using the syntax you designed? |
If you aren't using
I use this command when exploring new files.
For a recent report, I needed a pile of the calculated statistics. The names are the same names that appear in the statistics reports. Here's a simple example:
Here's the actual command I ran:
|
Please add at least a minimal descriptive comment for the gather_stats_for_variable and info_impl methods. Also, if you could name the info_impl method something slightly more descriptive that would be easier to read. Please change your option entry in the option parser for “—fields” to give information about the fields a user can ask for. Right now it’s very hard for a user to figure out how to use this feature without reading the code comments. |
(It might actually be best to include description or examples of how to use --fields in the comment that is printed for the info command when you ask for "glance help info".) |
matches naming convention used elsewhere in file.
"glance help info" now includes information on using the --fields option. "glance --help" not includes a summary of the various things you can put into --fields.
I believe this addresses all of your requests. |
Missed the "shape" field; added. |
--fields is a comma seperated list of fields to be output. By default, it's "filename,variable", which is the old output. You can use any of:
I'd regularly wanted "shape" and the attribute "long_name" for use while exploring new data. A need to create a report of all of our output data drove generalizing the problem and adding stats(STAT_NAME).
This includes and completely replaces pull request #12