valohai / valohai-utils

Python helper library for Valohai
MIT License
2 stars 2 forks source link

Don't treat booleans as flags #80

Closed magdapoppins closed 2 years ago

magdapoppins commented 2 years ago

Fixes #78

JuhaKiili commented 2 years ago

@magdapoppins This looks very good, but only fixes 50% of the problem.

The problem is in two parts: A) Use real bools instead of flags when generating the YAML B) Parse real bools instead of flags from the CLI

This fixes B, but we also need to fix A.

The YAML gen for parameters happens here: https://github.com/valohai/valohai-utils/blob/3bdd79d33a0882e8de254f290cab3ff1e281c7f7/valohai/internals/yaml.py#L40

You need to make sure that through this method, the YAML is always generated with pass-false-as and pass-true-as.

Note: When user is passing a dict, it is their responsibility to do that and we don't need to care.

(this might already be the case, but my guess is that it is not)