Open ejfdickinson opened 4 months ago
@rtimms @martinjrobins
Maybe related, it seems like some optional fields are not validated correctly. E.g. the below test fails (no ValidationError
is raised even though title should be a string!)
def test_bad_title(self):
test = copy.copy(self.base)
test["Header"]["Title"] = 1
with self.assertRaises(ValidationError):
parse_obj_as(BPX, test)
@Ubham16 can you take a look?
In the presence of an invalid BPX object, the BPX parser reports non-existent errors in addition to real errors.
Repeat
Here, the file is parsed with no errors (valid BPX).
Delete line 10 from
nmc_pouch_cell_BPX.json
:The parser raises 40 errors, most of which are not correctly identified (missing or extra fields). The only real error (missing required field
["Parameterisation"]["Cell"]["Ambient temperature [K]"]
) is raised twice, as the first and last reported error.