Skip to content

Commit

Permalink
Cython code reorg and co-opted pyzmq build framework so do not have t…
Browse files Browse the repository at this point in the history
…o check in cythonized .c code into git
  • Loading branch information
wesm committed Jun 27, 2011
1 parent 2a73eb0 commit dcf3490
Show file tree
Hide file tree
Showing 48 changed files with 337 additions and 41,771 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ dist
MANIFEST
*.so
*.pyd
pandas/src/tseries.c
pandas/src/sparse.c
doc/source/generated
*flymake*
scikits
.coverage
16 changes: 15 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ include README.rst
include TODO.rst
include setup.py
include setupegg.py

graft docs
prune docs/build
prune docs/gh-pages

graft examples
graft pandas

global-exclude *.so
global-exclude *.pyd
global-exclude *.pyc
global-exclude .git*
global-exclude .DS_Store

# include examples/data/*
recursive-include examples *.py
# recursive-include examples *.py
# recursive-include doc/source *
# recursive-include doc/sphinxext *
3 changes: 3 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ Thanks
- Chris Uga
- Chris Withers
- Jeff Reback
- William Ferreira
- Daniel Fortunov
- Martin Felder

************************
pandas 0.3 Release Notes
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numpy.lib.format import read_array, write_array
import numpy as np

import pandas.lib.tseries as tseries
import pandas._tseries as _tseries

# XXX: HACK for NumPy 1.5.1 to suppress warnings
try:
Expand All @@ -32,11 +32,11 @@ def isnull(input):
if input.dtype.kind in ('O', 'S'):
# Working around NumPy ticket 1542
result = input.copy().astype(bool)
result[:] = tseries.isnullobj(input)
result[:] = _tseries.isnullobj(input)
else:
result = -np.isfinite(input)
else:
result = tseries.checknull(input)
result = _tseries.checknull(input)

return result

Expand All @@ -56,7 +56,7 @@ def notnull(input):
if isinstance(input, np.ndarray):
return -isnull(input)
else:
return not tseries.checknull(input)
return not _tseries.checknull(input)

def _pickle_array(arr):
arr = arr.view(np.ndarray)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from pandas.core.series import Series
import pandas.core.common as common
import pandas.core.datetools as datetools
import pandas.lib.tseries as tseries
import pandas._tseries as _tseries

#-------------------------------------------------------------------------------
# Factory helper methods
Expand Down Expand Up @@ -2182,7 +2182,7 @@ def median(self, axis=0):
def f(arr):
if arr.dtype != np.float_:
arr = arr.astype(float)
return tseries.median(arr[notnull(arr)])
return _tseries.median(arr[notnull(arr)])

if axis == 0:
med = [f(self[col].values) for col in self.columns]
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ def ts_upsample(dates, buckets, values, aggfunc, inclusive=True):

result = reduce_mean(values, index, buckets)

import pandas.lib.tseries as tseries
import pandas._tseries as tseries
tseries.ts_upsample_mean(index, buckets, values)
7 changes: 3 additions & 4 deletions pandas/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pandas.core.series import Series
from pandas.core.panel import WidePanel
import pandas.core.common as common
import pandas.lib.tseries as tseries
import pandas._tseries as _tseries

class GroupDict(dict):
def __repr__(self):
Expand Down Expand Up @@ -54,15 +54,14 @@ def __init__(self, obj, grouper):
grouper = grouper.get
self.grouper = grouper
axis = self._group_axis
self.groups = tseries.groupby(axis, self.grouper,
self.groups = _tseries.groupby(axis, self.grouper,
output=GroupDict())

@property
def group_indices(self):
if self._group_indices is None:
axis = self._group_axis
self._group_indices = tseries.groupby_indices(axis,
self.grouper)
self._group_indices = _tseries.groupby_indices(axis, self.grouper)

return self._group_indices

Expand Down
8 changes: 3 additions & 5 deletions pandas/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np

from pandas.core.common import _ensure_index
import pandas.lib.tseries as _tseries
import pandas._tseries as _tseries

__all__ = ['Index']

Expand Down Expand Up @@ -260,8 +260,6 @@ def get_indexer(self, target, method=None):
-------
(indexer, mask)
"""
import pandas.lib.tseries as tseries

if method:
method = method.upper()

Expand All @@ -273,8 +271,8 @@ def get_indexer(self, target, method=None):
target = _ensure_index(target)

method = aliases.get(method, method)
indexer, mask = tseries.getFillVec(self, target, self.indexMap,
target.indexMap, method)
indexer, mask = _tseries.getFillVec(self, target, self.indexMap,
target.indexMap, method)
return indexer, mask

def slice_locs(self, start=None, end=None):
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pandas.core.frame import DataFrame
from pandas.core.generic import PandasGeneric, Picklable
import pandas.core.common as common
import pandas.lib.tseries as tseries
import pandas._tseries as _tseries

class PanelError(Exception):
pass
Expand Down Expand Up @@ -900,7 +900,7 @@ def median(self, axis='major'):
y : DataFrame
"""
def f(arr):
return tseries.median(arr[common.notnull(arr)])
return _tseries.median(arr[common.notnull(arr)])

return self.apply(f, axis=axis)

Expand Down Expand Up @@ -1086,8 +1086,8 @@ def fromRecords(cls, data, major_field, minor_field,
major_axis = Index(sorted(set(major_vec)))
minor_axis = Index(sorted(set(minor_vec)))

major_labels, _ = tseries.getMergeVec(major_vec, major_axis.indexMap)
minor_labels, _ = tseries.getMergeVec(minor_vec, minor_axis.indexMap)
major_labels, _ = _tseries.getMergeVec(major_vec, major_axis.indexMap)
minor_labels, _ = _tseries.getMergeVec(minor_vec, minor_axis.indexMap)

for col in exclude:
del data[col]
Expand Down Expand Up @@ -2012,8 +2012,8 @@ def _make_long_index(major_values, minor_values):
major_axis = Index(sorted(set(major_values)))
minor_axis = Index(sorted(set(minor_values)))

major_labels, _ = tseries.getMergeVec(major_values, major_axis.indexMap)
minor_labels, _ = tseries.getMergeVec(minor_values, minor_axis.indexMap)
major_labels, _ = _tseries.getMergeVec(major_values, major_axis.indexMap)
minor_labels, _ = _tseries.getMergeVec(minor_values, minor_axis.indexMap)

long_index = LongPanelIndex(major_axis, minor_axis,
major_labels, minor_labels)
Expand Down
14 changes: 7 additions & 7 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pandas.core.generic import PandasGeneric
from pandas.core.index import Index
import pandas.core.datetools as datetools
import pandas.lib.tseries as tseries
import pandas._tseries as _tseries

__all__ = ['Series', 'TimeSeries']

Expand Down Expand Up @@ -58,10 +58,10 @@ def wrapper(self, other):

# buffered Cython function expects double type

arr = tseries.combineFunc(name, newIndex,
this, other,
self.index.indexMap,
other.index.indexMap)
arr = _tseries.combineFunc(name, newIndex,
this, other,
self.index.indexMap,
other.index.indexMap)
except Exception:
arr = Series._combineFunc(self, other,
getattr(type(self[0]), name))
Expand Down Expand Up @@ -613,7 +613,7 @@ def median(self):
arr = arr.astype(float)

arr = arr[notnull(arr)]
return tseries.median(arr)
return _tseries.median(arr)

def corr(self, other):
"""
Expand Down Expand Up @@ -923,7 +923,7 @@ def map(self, arg):
if isinstance(arg, dict):
arg = Series(arg)

indexer, mask = tseries.getMergeVec(self, arg.index.indexMap)
indexer, mask = _tseries.getMergeVec(self, arg.index.indexMap)
notmask = -mask

new_values = arg.view(np.ndarray).take(indexer)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import pandas.core.common as common
import pandas.core.datetools as datetools

from pandas.lib.sparse import BlockIndex, IntIndex
import pandas.lib.sparse as splib
from pandas._sparse import BlockIndex, IntIndex
import pandas._sparse as splib

def make_sparse(arr, kind='block', fill_value=nan):
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/finance/portstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Compute common portfolio statistics
"""

import pandas.lib.tseries as _tseries
import pandas._tseries as _tseries
import pandas.stats.moments as moments

def leverage(weights):
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
LongPanel)
from pandas.core.pytools import adjoin
import pandas.core.internals as internals
import pandas.lib.tseries as tseries
import pandas._tseries as _tseries

# reading and writing the full object in one go
_TYPE_MAP = {
Expand Down Expand Up @@ -593,7 +593,7 @@ def _read_index_legacy(group, key):

def _unconvert_index_legacy(data, kind, legacy=False):
if kind == 'datetime':
index = tseries.array_to_datetime(data)
index = _tseries.array_to_datetime(data)
elif kind in ('string', 'integer'):
index = np.array(data, dtype=object)
else: # pragma: no cover
Expand Down
Empty file removed pandas/lib/__init__.py
Empty file.
2 changes: 0 additions & 2 deletions pandas/lib/rebuild.sh

This file was deleted.

32 changes: 0 additions & 32 deletions pandas/lib/setup.py

This file was deleted.

Loading

0 comments on commit dcf3490

Please sign in to comment.