If you take the optimizer json defined below and try to load it as an AdamOptimizer, you get an abstruse error:
AttributeError: 'NoneType' object has no attribute 'pixel_size'
If you instead only try to load the TopologyDesignRegion part of the json, you get the real error:
ValidationError: 1 validation error for TopologyDesignRegion
transformations -> 0 -> radius
field required (type=value_error.missing)
In many cases, pydantic manages this well and gives you the underlying error first, but here it's completely missing from the stack trace. Not sure if it has something to do with the fact that it happens in a root validator?
If you take the optimizer json defined below and try to load it as an
AdamOptimizer
, you get an abstruse error:If you instead only try to load the
TopologyDesignRegion
part of the json, you get the real error:In many cases, pydantic manages this well and gives you the underlying error first, but here it's completely missing from the stack trace. Not sure if it has something to do with the fact that it happens in a root validator?