We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>> from roman_datamodels import maker_utils as mk, datamodels as dm >> m = mk.mk_datamodel(dm.ImageModel) >> m.meta._foo = 1 # no error >> m.meta._foo AttributeError: No attribute _foo
I think this is in part due to _foo getting set on an ephemeral DNode instance.
_foo
DNode
>> id(m.meta) 4814979664 >> id(m.meta) 5611666880
Which leads to this fun line of code:
>> m.meta is m.meta False
Saving a reference to and re-using the meta retains _foo:
meta
>> mm = m.meta >> mm._foo = 1 >> mm._foo 1
I'm not sure if this is a bug but I was surprised by it.
The text was updated successfully, but these errors were encountered:
This is expected behavior https://github.com/spacetelescope/roman_datamodels/blob/main/src/roman_datamodels/stnode/_node.py#L214-L215.
Really, we should not be allowing setting of private attributes, however this might break the node internally. I'll need to investigate this.
Sorry, something went wrong.
WilliamJamieson
No branches or pull requests
I think this is in part due to
_foo
getting set on an ephemeralDNode
instance.Which leads to this fun line of code:
Saving a reference to and re-using the
meta
retains_foo
:I'm not sure if this is a bug but I was surprised by it.
The text was updated successfully, but these errors were encountered: