You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The field_table converter uses a different set of options (that is field_table has no options) from the diag and data table converter scripts. All should use a similar set of options.
Also, I feel a change in the options and default behavior will make the tools easier to use.
As currently written, all have a default file name to use. I feel the default should be removed and require the user to specify the table file to convert, and that file should be the first argument on the line. E.g.,
> table_to_yaml table_file
The diag_table_to_yaml and diag_table_to_yaml scripts require the file to convert be listed with the -f option. This change will make the -f option no longer needed.
I also feel by default the conversion should print the output to stdout. This can then be captured (or redirected to a file table_to_yaml table_file > output.yaml). An option -o should also be added to write converted file out (e.g., table_to_yaml -f output.yaml table_file). I feel these changes make the scripts more intuitive.
It will be useful both for users and when debugging to have a verbose option that prints additional information out to stderr. To help with this, the python [logging] (https://docs.python.org/3/library/logging.html#module-logging) can be useful to print warnings, errors, etc to either a log file (useful when run in FRE) or stderr/stdout.
As an example, the argparse code for the scripts would look similar to:
frompathlibimportPathparser=argparse.ArgumentParser(prog='table_to_yaml',
description="Converts a legacy ascii table to a yaml table.")
parser.add_argument('-o', '--output',
help='Output file',
metaVar="outFile",
dest="outFile",
default=None,
type=Path)
parser.add_argument('-v', '--verbose',
help='Verbosity level',
metaVar="verbose",
dest="verbose",
default=0,
action=count)
parser.add_argument('table_file',
help="Table file to read",
metavar=table_file,
type=Path,
required=True)
The text was updated successfully, but these errors were encountered:
The field_table converter uses a different set of options (that is field_table has no options) from the diag and data table converter scripts. All should use a similar set of options.
Also, I feel a change in the options and default behavior will make the tools easier to use.
As currently written, all have a default file name to use. I feel the default should be removed and require the user to specify the table file to convert, and that file should be the first argument on the line. E.g.,
The
diag_table_to_yaml
anddiag_table_to_yaml
scripts require the file to convert be listed with the-f
option. This change will make the-f
option no longer needed.I also feel by default the conversion should print the output to stdout. This can then be captured (or redirected to a file
table_to_yaml table_file > output.yaml
). An option-o
should also be added to write converted file out (e.g.,table_to_yaml -f output.yaml table_file
). I feel these changes make the scripts more intuitive.It will be useful both for users and when debugging to have a verbose option that prints additional information out to stderr. To help with this, the python [logging] (https://docs.python.org/3/library/logging.html#module-logging) can be useful to print warnings, errors, etc to either a log file (useful when run in FRE) or stderr/stdout.
As an example, the argparse code for the scripts would look similar to:
The text was updated successfully, but these errors were encountered: