Skip to content

Commit 9da1fd3

Browse files
committed
RLS: Feather 0.4 Python release
1 parent d253ed6 commit 9da1fd3

File tree

2 files changed

+154
-3
lines changed

2 files changed

+154
-3
lines changed

bench/ArrowMigration.ipynb

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import numpy as np\n",
10+
"import pandas as pd\n",
11+
"import pyarrow as pa\n",
12+
"import feather as fth\n",
13+
"\n",
14+
"type_ = np.dtype('float64')\n",
15+
"DATA_SIZE = (1 << 30)\n",
16+
"NCOLS = 100\n",
17+
"NROWS = DATA_SIZE / NCOLS / np.dtype(type_).itemsize\n",
18+
"\n",
19+
"data = {\n",
20+
" 'c' + str(i): np.random.randn(int(NROWS))\n",
21+
" for i in range(int(NCOLS))\n",
22+
"}\n",
23+
"df = pd.DataFrame(data)\n",
24+
"df[::5] = np.nan"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": 4,
30+
"metadata": {
31+
"collapsed": true
32+
},
33+
"outputs": [],
34+
"source": [
35+
"fth.write_dataframe?"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 5,
41+
"metadata": {
42+
"collapsed": true
43+
},
44+
"outputs": [],
45+
"source": [
46+
"NFILES = 20\n",
47+
"for i in range(NFILES):\n",
48+
" fth.write_dataframe(df, 'df{0}.feather'.format(i))"
49+
]
50+
},
51+
{
52+
"cell_type": "code",
53+
"execution_count": 9,
54+
"metadata": {
55+
"collapsed": true
56+
},
57+
"outputs": [],
58+
"source": [
59+
"def read_all(nfiles=NFILES, nthreads=1):\n",
60+
" for i in range(nfiles):\n",
61+
" path = 'df{0}.feather'.format(i)\n",
62+
" fth.read_dataframe(path, nthreads=nthreads)"
63+
]
64+
},
65+
{
66+
"cell_type": "markdown",
67+
"metadata": {},
68+
"source": [
69+
"## Make sure to run before each command\n",
70+
"## echo 3 > /proc/sys/vm/drop_caches"
71+
]
72+
},
73+
{
74+
"cell_type": "code",
75+
"execution_count": 21,
76+
"metadata": {},
77+
"outputs": [
78+
{
79+
"name": "stdout",
80+
"output_type": "stream",
81+
"text": [
82+
"CPU times: user 1.74 s, sys: 7.75 s, total: 9.49 s\n",
83+
"Wall time: 16.5 s\n"
84+
]
85+
}
86+
],
87+
"source": [
88+
"%time read_all(10)"
89+
]
90+
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": 22,
94+
"metadata": {},
95+
"outputs": [
96+
{
97+
"name": "stdout",
98+
"output_type": "stream",
99+
"text": [
100+
"CPU times: user 2.08 s, sys: 8.56 s, total: 10.6 s\n",
101+
"Wall time: 10.9 s\n"
102+
]
103+
}
104+
],
105+
"source": [
106+
"%time read_all(10, nthreads=4)"
107+
]
108+
},
109+
{
110+
"cell_type": "code",
111+
"execution_count": 16,
112+
"metadata": {
113+
"collapsed": true
114+
},
115+
"outputs": [],
116+
"source": [
117+
"fth.read_dataframe??"
118+
]
119+
},
120+
{
121+
"cell_type": "code",
122+
"execution_count": null,
123+
"metadata": {
124+
"collapsed": true
125+
},
126+
"outputs": [],
127+
"source": []
128+
}
129+
],
130+
"metadata": {
131+
"kernelspec": {
132+
"display_name": "Python 3",
133+
"language": "python",
134+
"name": "python3"
135+
},
136+
"language_info": {
137+
"codemirror_mode": {
138+
"name": "ipython",
139+
"version": 3
140+
},
141+
"file_extension": ".py",
142+
"mimetype": "text/x-python",
143+
"name": "python",
144+
"nbconvert_exporter": "python",
145+
"pygments_lexer": "ipython3",
146+
"version": "3.6.1"
147+
}
148+
},
149+
"nbformat": 4,
150+
"nbformat_minor": 2
151+
}

python/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MINOR = 4
2424
MICRO = 0
2525
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
26-
ISRELEASED = False
26+
ISRELEASED = True
2727

2828
setup_dir = os.path.abspath(os.path.dirname(__file__))
2929

@@ -65,10 +65,10 @@ def write_version_py(filename=os.path.join(setup_dir, 'feather/version.py')):
6565

6666
setup(
6767
name="feather-format",
68-
packages=['feather', 'feather.tests'],
68+
packages=['feather'],
6969
version=VERSION,
7070
package_data={'feather': ['*.pxd', '*.pyx']},
71-
install_requires=['pyarrow>=0.3.0'],
71+
install_requires=['pyarrow>=0.4.0'],
7272
description=DESCRIPTION,
7373
long_description=LONG_DESCRIPTION,
7474
license='Apache License, Version 2.0',

0 commit comments

Comments
 (0)