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

External references ignore memmap argument passed to open #1867

Open
braingram opened this issue Nov 8, 2024 · 0 comments
Open

External references ignore memmap argument passed to open #1867

braingram opened this issue Nov 8, 2024 · 0 comments

Comments

@braingram
Copy link
Contributor

Example of the problem

import asdf
import numpy as np

arr = np.arange(42)
asdf.AsdfFile({"arr": arr}).write_to("external.asdf")

tree = {
    "rarr": {"$ref": "external.asdf#/arr"},
}

asdf.AsdfFile(tree).write_to("foo.asdf")

with asdf.open("foo.asdf", memmap=False) as af:
    af.find_references()
    af["rarr"][0] = 1

results in

ValueError: assignment destination is read-only

even though memmap=False was passed to asdf.open (note that this example will start to pass with asdf 4.0.0 but only because the default for memmap will be set to False, the example could be updated to instead check for memmap=True and a ValueError where it will fail for asdf 4.0.0)

asdf version: main
python version: 3.10
operating system: mac

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

1 participant