Skip to content
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

Don't hard-code allow_None to True in Array #726

Merged
merged 2 commits into from Apr 12, 2023
Merged

Don't hard-code allow_None to True in Array #726

merged 2 commits into from Apr 12, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Apr 5, 2023

Fixes #583

This is effectively a breaking change. The code below used to work fine, while after this change p.a = None will raise an error.

import param, numpy as np

class P(param.Parameterized):
    a = param.Array(np.zeros((2, 2)))

p = P()

p.a = None

@maximlt maximlt added this to the 2.0 milestone Apr 5, 2023
@maximlt maximlt requested a review from jlstevens April 12, 2023 14:20
@jlstevens
Copy link
Contributor

Simple change and looks correct to me. Based on the discussion in #583, this is a breaking change but one we think makes sense for 2.0.

@maximlt
Copy link
Member Author

maximlt commented Apr 12, 2023

Thanks for the review! Merging.

@maximlt maximlt merged commit c96c1f4 into main Apr 12, 2023
18 checks passed
@maximlt maximlt deleted the array_allow_none branch April 12, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array should not force allow_None=True
2 participants