File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
src/roman_datamodels/stnode Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ Fix bug where nodes couldn't be deepcopied after use.
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class SchemaProperties:
5757 """
5858
5959 def __init__ (self , explicit_properties , patterns ):
60- self .explicit_properties = explicit_properties
60+ self .explicit_properties = set ( explicit_properties )
6161 self .patterns = patterns
6262
6363 def __contains__ (self , attr ):
Original file line number Diff line number Diff line change 11import warnings
22from contextlib import nullcontext
3+ from copy import deepcopy
34
45import asdf
56import numpy as np
@@ -1301,3 +1302,14 @@ def test_wfi_wcs_no_wcs(caplog):
13011302 assert not hasattr (wfi_wcs , "wcs_l2" )
13021303
13031304 assert "Model has no WCS defined" in caplog .text
1305+
1306+
1307+ def test_deepcopy_after_use ():
1308+ """
1309+ Test that nodes constructed from using models can be copied
1310+
1311+ See: https://github.com/spacetelescope/roman_datamodels/issues/486
1312+ """
1313+ m = datamodels .ImageModel ()
1314+ m .meta = {}
1315+ deepcopy (m .meta )
You can’t perform that action at this time.
0 commit comments