Open landmanbester opened 2 weeks ago
That's a bit of an annoying click limitation. I suppose we could work around it by adding a custom click validator to the option, rather than using click.Choice
. All depends on motivation levels...
I was looking at Typer. I quite like the way it uses Python type annotations. Not sure if it would be a viable alternative to click. I have been thinking about CLIs again because at some point I want to figure out how to simplify the cult-cargo + QC process.
Could be an option! We could consider a typerify_parameters
function alongside the current clickify_parameters
one. In the Stimela view, it's just a convenience function for the developer, no reason why we can't have two.
Ran into an issue where click interprets all choices as strings. According to the docs
so even though the individual choices have the correct datatype in clickify_parameters here
https://github.com/caracal-pipeline/stimela/blob/1c6a973605d611ae6908028ca8c588fe6de2da4b/scabha/schema_utils.py#L259
they still get parsed as strings. This is probably easy enough to handle on the user side but thought I would document it here for posterity