-
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
: do not set dynamic=False
when valid_type=None
#146
Conversation
1d054f1
to
5b7471d
Compare
Agree with the change, but I'm not sure should close #146 just yet. As you mentioned elsewhere, the whole automatic setting of |
Sorry, shouldn't close #135 yet. |
And in AiiDA I guess it can go into 1.2.0, since it is a breaking change, but only a minor one. We don't do strict semver, right? |
We don't do strict as in no breaking changes whatsoever, zero, zilch, since that is almost impossible, but since But couldn't we just follow the same logic and just put this in And why shouldn't this close #135? Is this because the more refined question that you brought up later regarding precedence of |
Well, As for #135, a separate issue might indeed be cleaner. |
I will merge this and release it with |
777ee43
to
8141488
Compare
When setting `valid_type` to anything but `None` the setter will automatically also set `dynamic` to `True`, because this almost always what one wants and so saves having to set this attribute explicitly. Setting a valid type for a namespace but then not allowing any value whatsoever is non-sensical. The `valid_type` setter also implemented the reverse, meaning that setting `valid_type=None` would automatically set `dynamic=False`. This use case is a lot less common and actually leads to a lot of problems since the default `valid_type` of a namespace is `None`. When exposing a namespace that is dynamic, but without a particular `valid_type`, which is perfectly fine logically - it just accepts any value, the exposed namespace would lose its dynamicity. This is because the `valid_type` would be set after the `dynamic`, resetting it to `False` because the `valid_type` is `None`.
8141488
to
2a66b31
Compare
…iidateam#146) When setting `valid_type` to anything but `None` the setter will automatically also set `dynamic` to `True`, because this almost always what one wants and so saves having to set this attribute explicitly. Setting a valid type for a namespace but then not allowing any value whatsoever is non-sensical. The `valid_type` setter also implemented the reverse, meaning that setting `valid_type=None` would automatically set `dynamic=False`. This use case is a lot less common and actually leads to a lot of problems since the default `valid_type` of a namespace is `None`. When exposing a namespace that is dynamic, but without a particular `valid_type`, which is perfectly fine logically - it just accepts any value, the exposed namespace would lose its dynamicity. This is because the `valid_type` would be set after the `dynamic`, resetting it to `False` because the `valid_type` is `None`.
Fixes #135
When setting
valid_type
to anything butNone
the setter willautomatically also set
dynamic
toTrue
, because this almost alwayswhat one wants and so saves having to set this attribute explicitly.
Setting a valid type for a namespace but then not allowing any value
whatsoever is non-sensical.
The
valid_type
setter also implemented the reverse, meaning thatsetting
valid_type=None
would automatically setdynamic=False
. Thisuse case is a lot less common and actually leads to a lot of problems
since the default
valid_type
of a namespace isNone
. When exposing anamespace that is dynamic, but without a particular
valid_type
, whichis perfectly fine logically - it just accepts any value, the exposed
namespace would lose its dynamicity. This is because the
valid_type
would be set after the
dynamic
, resetting it toFalse
because thevalid_type
isNone
.