Skip to content

Commit

Permalink
remove extra asdf validation during DataModel.clone (#230)
Browse files Browse the repository at this point in the history
Co-authored-by: Howard Bushouse <[email protected]>
  • Loading branch information
braingram and hbushouse authored Dec 4, 2023
1 parent 6884f83 commit d3d37c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Other

- Add mrsptcorr ref_file to core.schema [#228]

- Avoid unnecessary validation during ``DataModel.clone`` [#230]

- Replace uses of ``utcnow`` (deprecated in python 3.12) [#231]

- Updated JWST MIRI imager photom model to include time-dependent correction
Expand Down
5 changes: 4 additions & 1 deletion src/stdatamodels/model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,10 @@ def close(self):
def clone(target, source, deepcopy=False, memo=None):
if deepcopy:
instance = copy.deepcopy(source._instance, memo=memo)
target._asdf = AsdfFile(instance)
target._asdf = AsdfFile()
# assign to private '_tree' to avoid validation caused
# by either using AsdfFile(instance) or target._asdf = tree
target._asdf._tree = instance
target._instance = instance
else:
target._asdf = source._asdf
Expand Down

0 comments on commit d3d37c4

Please sign in to comment.