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

Fix unexpected loading after print #1724

Merged
merged 3 commits into from
Nov 17, 2017

Conversation

fujiisoup
Copy link
Member

Only a single missing underscore causes this issue :)
Added tests.

Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! In the long term, it would be nice to get ride of these uses of _data, maybe by switching entirely from our lazy array classes to Dask.

""" Make sure print does not load file into memory """
in_memory = create_test_data()
with self.roundtrip(in_memory) as on_disk:
if not on_disk['var1']._in_memory:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we write this without the conditional check? It's usually best to avoid control flow in tests -- it makes it more obvious what is going on.

in_memory = create_test_data()
with self.roundtrip(in_memory) as on_disk:
if not on_disk['var1']._in_memory:
print(on_disk)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call repr(on_disk) to avoid actually printing to stdout.

@fujiisoup
Copy link
Member Author

@shoyer
Thanks. Fixed.

In the long term, it would be nice to get ride of these uses of _data, maybe by switching entirely from our lazy array classes to Dask.

Maybe related to your previous comment in #1705?
It sounds great.
I will raise another issue (maybe better to wait for the work by @benbovy #1627).

@shoyer shoyer merged commit 6463504 into pydata:master Nov 17, 2017
@shoyer shoyer mentioned this pull request Nov 20, 2017
13 tasks
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

Successfully merging this pull request may close these issues.

3 participants