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

[Feature]: Differentiate between calling Container __init__ by user vs during object construction #750

Closed
3 tasks done
rly opened this issue Aug 3, 2022 · 0 comments · Fixed by #751
Closed
3 tasks done
Assignees

Comments

@rly
Copy link
Contributor

rly commented Aug 3, 2022

What would you like to see added to HDMF?

In PyNWB/HDMF, we often want to check that input parameters to an object's init method are compliant with the schema. Over time, w may add new checks in init that raise errors when a noncompliant set of parameters is provided. However, if this noncompliant set of parameters were allowed to be written by a previous version of the API, then files exist in the wild with this noncompliant set of parameters. Reading these files involves constructing the object using the object's constructor, which now raises an error. Even though these files are technically noncompliant, they still need to be readable by the current API.

Is your feature request related to a problem?

No response

What solution would you like?

Provide two different paths or a branching path in init where calling init by a user would raise an error if non-compliant data are provided but calling init by the object construction process would raise a warning if non-compliant data are provided.

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

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 a pull request may close this issue.

1 participant