pr-omethe-us / PyKED

Python interface to the ChemKED database format
https://pr-omethe-us.github.io/PyKED/
BSD 3-Clause "New" or "Revised" License
14 stars 15 forks source link

What happens if an optional field is included but is blank? #82

Open bryanwweber opened 6 years ago

bryanwweber commented 6 years ago

Code sample, preferably able to be copy-pasted and run with no changes

apparatus:
  kind: rapid compression machine
  institution:
  facility:

Expected behavior

Guess we need to decide this

Actual behavior, including any error messages

No idea :smile:

kyleniemeyer commented 6 years ago

For expected behavior, I guess I would like the ChemKED object either to be None or not present—whatever the behavior is for the optional field not being present.

bryanwweber commented 6 years ago

Currently, this raises an exception during validation with the value 'null value not allowed'. When we implement #78, we can have a special case if we want to set the value to None if its null, or we can require the user to delete the offending field.

My preference is for deletion (no need to clutter up the file).