Skip to content

BLD: 0 13 pickles #5295

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

Merged
merged 2 commits into from
Oct 23, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 18 additions & 10 deletions pandas/io/tests/generate_legacy_pickles.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
""" self-contained to write legacy pickle files """
from __future__ import print_function

# make sure we are < 0.13 compat (in py3)
try:
from pandas.compat import zip, cPickle as pickle
except:
import pickle

def _create_sp_series():

import numpy as np
Expand Down Expand Up @@ -114,21 +108,35 @@ def write_legacy_pickles():
import sys
sys.path.insert(0,'.')

import os
import os, os.path
import numpy as np
import pandas
import pandas.util.testing as tm
import platform as pl

print("This script generates a pickle file for the current arch, system, and python version")
# make sure we are < 0.13 compat (in py3)
try:
from pandas.compat import zip, cPickle as pickle
except:
import pickle

sys_version = version = pandas.__version__
if len(sys.argv) < 2:
exit("{0} <version> <output_dir>".format(sys.argv[0]))

version = pandas.__version__
version = str(sys.argv[1])
output_dir = str(sys.argv[2])

print("This script generates a pickle file for the current arch, system, and python version")
print(" system version: {0}".format(sys_version))
print(" output version: {0}".format(version))
print(" output dir : {0}".format(output_dir))

# construct a reasonable platform name
f = '_'.join([ str(version), str(pl.machine()), str(pl.system().lower()), str(pl.python_version()) ])
pth = '{0}.pickle'.format(f)

fh = open(pth,'wb')
fh = open(os.path.join(output_dir,pth),'wb')
pickle.dump(create_data(),fh,pickle.HIGHEST_PROTOCOL)
fh.close()

Expand Down
3 changes: 3 additions & 0 deletions pandas/io/tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def test_read_pickles_0_11_0(self):
def test_read_pickles_0_12_0(self):
self.read_pickles('0.12.0')

def test_read_pickles_0_13_0(self):
self.read_pickles('0.13.0')

def test_round_trip_current(self):

for typ, dv in self.data.items():
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ def pxd(name):
'tests/data/legacy_pickle/0.10.1/*.pickle',
'tests/data/legacy_pickle/0.11.0/*.pickle',
'tests/data/legacy_pickle/0.12.0/*.pickle',
'tests/data/legacy_pickle/0.13.0/*.pickle',
'tests/data/*.csv',
'tests/data/*.dta',
'tests/data/*.txt',
Expand Down