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

Data model constructors should return object instance used in constructor if right type #51

Closed
perrygreenfield opened this issue Nov 4, 2021 · 1 comment
Assignees

Comments

@perrygreenfield
Copy link
Collaborator

Currently if one supplies an existing instance of a datamodel (say RampModel) to one of the datamodel constructors (say RampModel), and the instance is the same type as the constructor, the constructor should return that instance. Currently it raises an error.

This may require some trickery to effectively replace self with the instance (I will have to brush up on this)

@nden
Copy link
Collaborator

nden commented Nov 19, 2021

Fixed in #52

@nden nden closed this as completed Nov 19, 2021
dmggh added a commit to dmggh/roman_datamodels that referenced this issue Dec 16, 2021
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this issue Jul 6, 2023
Issue spacetelescope#51 and PR spacetelescope#52 indicate that we should be able to pass a
model instance to a matching model's constructor, and then
return exactly the same instance unmodified.
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this issue Jul 7, 2023
Issue spacetelescope#51 and PR spacetelescope#52 indicate that we should be able to pass a
model instance to a matching model's constructor, and then
return exactly the same instance unmodified.
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this issue Jul 7, 2023
Issue spacetelescope#51 and PR spacetelescope#52 indicate that we should be able to pass a
model instance to a matching model's constructor, and then
return exactly the same instance unmodified.
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this issue Jul 7, 2023
Issue spacetelescope#51 and PR spacetelescope#52 indicate that we should be able to pass a
model instance to a matching model's constructor, and then
return exactly the same instance unmodified.
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this issue Jul 7, 2023
Issue spacetelescope#51 and PR spacetelescope#52 indicate that we should be able to pass a
model instance to a matching model's constructor, and then
return exactly the same instance unmodified.
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

No branches or pull requests

2 participants