Open emlys opened 3 years ago
@dcdenu4 @davemfish @phargogh this ties in to https://github.com/natcap/invest.users-guide/pull/34. Would love to get everyone's feedback!
Hey @emlys , points 1 & 2 seem like a nice improvement to me. At first I had a slight concern of making it overly "complicated" to write args_spec with special syntax. However, I think this small special case makes it easier at the same time to maintain and write. I like it!
It's possible that when these are translated word-for-word, the meanings could diverge.
This is some great thoughtfulness. Consistency will matter when translating for sure.
I think this is a good idea. Worth doing to end the inconsistent names problem.
And I think I like doing the process
step outside of the model too because it's only for the benefit of a UI/docs layer.
Another reason to have this process
wrapper is to deal with serializing mentioned in #617
In
ARGS_SPEC
"about" texts it is very common to refer to other args by name. For example, "A map of land cover for the future scenario. All values in this raster must have corresponding entries in the Carbon Pools table. Required if Calculate Sequestration is selected."Objectives:
@phargogh suggested how to make a sort-of self-referential dictionary, which solves (1) and (2):
Then, when we import the model,
ARGS_SPEC['arg2']['about']
is'This arg depends on Arg One.
Extending this to achieve (3), we could move the
process()
step outside of the model. Leaving in the marked-up keys, we could apply different formatting in the UG vs. the workbench. For example, if we wanted to make the names bolded, we could surround them with** **
in the generated RST and<b> </b>
in the HTML."about" texts have always been a human-readable plain text description (except a few places where we used HTML tags). They also haven't been used for anything, prior to the workbench and the Sphinx extension. So we're free to change the contract here.