You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something that had occurred when I was converting tardis_config_definition.yml to JSON Schema was the default values of None which sometimes were mistakenly expressed as none.
When the word None didn't start with a capital N, the (old) validator translated it as a string. The two cases were this happened are plasma.helium_treatment and plasma.heating_rate_data_file
For example, in the plasma.heating_rate_data_file case its default value was set to none but the code is comparing to the python object None, making the code have no effect.
This bug has survived after the conversion to JSON Schema, since only what the old validator was translating as python None was converted to jsonschema null (which is the way to say python None in jsonschema). This was left out on purpose because it was out of scope for the particular task, and changes in the code needed to be done to solve it.
Finally, we should discuss dropping None/null as a default value altogether, since the only thing it offers is not having to check in the code if the property was provided by the configuration file, i.e. it only saves us from doing:
Something that had occurred when I was converting
tardis_config_definition.yml
to JSON Schema was the default values ofNone
which sometimes were mistakenly expressed asnone
.When the word None didn't start with a capital
N
, the (old) validator translated it as a string. The two cases were this happened areplasma.helium_treatment
andplasma.heating_rate_data_file
For example, in the
plasma.heating_rate_data_file
case its default value was set tonone
but the code is comparing to the python objectNone
, making the code have no effect.This bug has survived after the conversion to JSON Schema, since only what the old validator was translating as python
None
was converted to jsonschemanull
(which is the way to say pythonNone
in jsonschema). This was left out on purpose because it was out of scope for the particular task, and changes in the code needed to be done to solve it.Finally, we should discuss dropping None/null as a default value altogether, since the only thing it offers is not having to check in the code if the property was provided by the configuration file, i.e. it only saves us from doing:
but there are nice workarounds to this, such as
The text was updated successfully, but these errors were encountered: