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

Only write base array of a view when explicitly requested #1005

Open
lgarrison opened this issue Jun 9, 2021 · 1 comment
Open

Only write base array of a view when explicitly requested #1005

lgarrison opened this issue Jun 9, 2021 · 1 comment

Comments

@lgarrison
Copy link
Contributor

From #989, the current ASDF behavior of writing the underlying base array of a Numpy view can lead to unexpected results, like a file being much bigger than anticipated when the view is a small portion of the base array. Of course, this behavior can lead to space savings when multiple views of the base array are in the ASDF file. But rather than try to infer whether to enable this behavior based on expected space savings, the simpler behavior is to make this opt-in, probably via an arg to write_to or the ASDF config.

@jdavies-st
Copy link
Contributor

Agree. It would be nice to not try to infer intentions, but make intentions explicit in a kwarg.

So is the suggestion to then make a copy before writing out, and only keep the base/view if explicitly asked? That seems sane to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants