Skip to content

Commit

Permalink
replace usages of copy_arrays with memmap (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett authored Jul 18, 2024
1 parent a01295f commit ee4756f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2.0.1 (unreleased)
===================

-
- replace usages of ``copy_arrays`` with ``memmap`` [#306]

2.0.0 (2024-06-24)
===================
Expand Down
2 changes: 1 addition & 1 deletion src/stdatamodels/jwst/datamodels/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def open(init=None, guess=True, memmap=False, **kwargs):
return ModelContainer(init, **kwargs)

elif file_type == "asdf":
asdffile = asdf.open(init, copy_arrays=not memmap)
asdffile = asdf.open(init, memmap=memmap)

# Detect model type, then get defined model, and call it.
new_class = _class_from_model_type(asdffile)
Expand Down
4 changes: 1 addition & 3 deletions src/stdatamodels/model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ def __init__(self, init=None, schema=None, memmap=False,
)

elif file_type == "asdf":
# use memmap argument of "copy_arrays" was not defined
kwargs["copy_arrays"] = kwargs.get("copy_arrays", not memmap)
asdffile = self.open_asdf(init=init, **kwargs)
asdffile = self.open_asdf(init=init, memmap=memmap, **kwargs)

else:
# TODO handle json files as well
Expand Down

0 comments on commit ee4756f

Please sign in to comment.