openfisca / openfisca-core

OpenFisca core engine. See other repositories for countries-specific code & data.

Home Page:https://openfisca.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `label: str` to allowed parameter attributes

nikhilwoodruff opened this issue · comments

This would serve the UK and US systems, since we're currently providing it via a metadata attribute, but as previously pointed out, it might be more optimal for consistency to add it as a main attribute (since label is an attribute of Variable). Happy to make the change if this is not objectionable?

cc. @benjello @sandcha

For context, here's how we're using metadata.

A main attribute to describe briefly a parameter?

We already have such an attribute 🤔: description is the attribute that describes a parameter in 1 line; it's length is not limited.

"description" or "label"?

Thank you for suggesting the label attribute! I agree that it would be more optimal for consistency to rename it into label in the future to have the same name in the model parameters/variables. This was also asked by openfisca-france community (vote).

It could be managed in a PR (with a thought about the migration process) but it could also be linked to other parameters improvements and need an RFC (request for comments) issue (see below).

What about short and long labels/descriptions?

In today's meeting we also discussed your use case and the fact that the policy engine uses the label as a short label (Basic rate for example) and another attribute for the longer description (documentation if I remember correctly).

This question was also raised by other user interfaces in France. We currently have a discussion on this and it leads the model to add new attributes to the metadata section like the short_label (discussed here 🇫🇷 ) and a constraint on the description length (less than 100 characters according to what already exists, so more likely 420 characters 😅).

Here is an example on a parameter node (with a description in English).
Setting short labels might imply that the parameter (the leaf of the parameters tree) describes only the leaf and that the nodes before it contain short labels reduced to every node meaning (thus, concatenating the short labels from the root to the parameter leaf gives the full description).

Would all this also work for you @nikhilwoodruff?