jrising / prospectus-tools

Tools for processing results of the Climate Prospectus
MIT License
2 stars 7 forks source link

Unclear Correct Format for CLI Flags quantiles.py #44

Closed KatChampion closed 1 year ago

KatChampion commented 1 year ago

I am struggling to pass in arguments using CLI flags to quantiles.py. Reading consume_config in the configs.py script it seems like any argument can come from either the yaml config file or a CLI flag on the command line. However, it's unclear how the input value should be formatted when using a CLI flag. For example changing whether the CLI flag is fed a string or a vector of values effects whether it correctly interprets the input but each flag appears to act differently. Specifically I am struggling to understand how I would pass information to years, yearsets, and only-models in CLI flag form. (I want to do this because it means I can iterate through several extractions in shell automatically rather than manually running 400 different extractions each with a different yaml file).

jrising commented 1 year ago

Thanks for the issue. You should be able to pass in CLI arguments in the exact same format as yaml options, since these are just passed to the yaml parser. Can you add here any examples you have of when this doesn't work?

KatChampion commented 1 year ago

Actually I managed to figure out everything except how to pass yearsets tuples. I have been trying to pass in a tuple as [(2080,2099)] but it fails in both the yaml and as the CLI flag. It gives an error saying %d expects a number.

jrising commented 1 year ago

YAML doesn't have a syntax for tuples. Instead, you should pass these as a list of lists: [[2080,2099]].