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

test unpack picklable #110

Merged
merged 3 commits into from
May 14, 2015
Merged

test unpack picklable #110

merged 3 commits into from
May 14, 2015

Conversation

mducoffe
Copy link

No description provided.

@mducoffe
Copy link
Author

I have tested with NUMPY_AVAILABLE = True/False in iter_dispatch from picklable itertools. When NUMPY_AVAILABLE is False, the test fails

@mducoffe
Copy link
Author

@vdumoulin first impression ?

epoch = wrapper.get_epoch_iterator()
# Pickle the epoch
with tempfile.NamedTemporaryFile(delete=False) as f:
cPickle.dump(epoch, f)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the need for a temporary file by using cPickle.dumps, which returns the pickled string for a given object:

cPickle.dumps(epoch)

would be sufficient.

@vdumoulin
Copy link
Contributor

Beside my comment everything looks fine.

Your location choice is not a bad idea at all, but I'd put this test in tests/test_transformers.py along with the other Unpack unit test. You can reformat the two tests as a test class and factor out the common logic in a setUp method (see TestMerge for a good example on how to do that).

@vdumoulin
Copy link
Contributor

Mission accomplished. Merging.

vdumoulin added a commit that referenced this pull request May 14, 2015
@vdumoulin vdumoulin merged commit dc4f3eb into mila-iqia:master May 14, 2015
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.

2 participants