Improved ModelConfiguration serialization #222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new version of the
build_config_constructor_serializers
function. Compared to the previous one, now alsoEnum
values as well aslist
,tuple
anddict
values with non-primitive elements inside are serialized. This is useful for example for theGenericFrontendV1
which use a sequence ofFrontendLayerType
enum values for the layer ordering. This wouldn't work with the original function but is possible with thev2
version.Another change is that the de-duplication of the recognized imports now works properly and imports get sorted.
The changes are realized in a
v2
function because they can affect the hash of the serializer objects and thus would break existing setups.