-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PortNamespace
: Fix bug in valid type checking of dynamic namespaces
#255
Conversation
If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace.
Codecov ReportBase: 90.73% // Head: 90.74% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## support/0.21.x #255 +/- ##
==================================================
+ Coverage 90.73% 90.74% +0.01%
==================================================
Files 21 21
Lines 2964 2967 +3
==================================================
+ Hits 2689 2692 +3
Misses 275 275
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
…#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
…#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
…aiidateam#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
If a
valid_type
is set on aPortNamespace
it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect thevalid_type
. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values.The
PortNamespace.validate_dynamic_ports
is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace.