Closed mih closed 1 year ago
Base: 69.94% // Head: 68.84% // Decreases project coverage by -1.09%
:warning:
Coverage data is based on head (
44d762b
) compared to base (9f8776c
). Patch coverage: 69.38% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Before it was a mess, now it is less of a mess.
Importantly, the parameter widget selection is no longer based on a mixture of parameter names, constraints, and argparse internal settings. Now the selection is made solely based on an assigned
Constraint
.To make this possible the whole slew of new Constraints that came to life lately is put to action. The constraint provided by -core's
Parameter
class is now treated as an "item constraint". This is turned into a "comprehensive constraint" by wrapping it, as necessary, into additional constraints. E.g.nargs='*'
causesEnsureIterableOf(list, constraint)
.A number of other rules are implemented to always yield a single constraint as a fully qualified ruleset to translate a parameters requirements into a widget(set).
Importantly, it is not necessary to indicate an explicit
| EnsureNone()
for a parameter that takes totally different values, but defaults toNone
, merely to indicate that it is optional. Now, anEnsureNone()
is added automatically.The approach should be extended to an
EnsureValue(default)
, for any default value that is not already covered by the assigned constraint.Closes #302