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

Set column slices using an ndarray view of the underlying data #3020

Merged
merged 2 commits into from Oct 8, 2014
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.rst
Expand Up @@ -283,7 +283,7 @@ Other Changes and Additions

- ``astropy.table``

- Sped up setting of ``Column`` slices by an order of magnitude. [#2994]
- Sped up setting of ``Column`` slices by an order of magnitude. [#2994, #3020]

- Updated the bundled ``six`` module to version 1.7.3 and made 1.7.3 the
minimum acceptable version of ``six``. [#2814]
Expand Down
5 changes: 5 additions & 0 deletions astropy/table/column.py
Expand Up @@ -210,6 +210,11 @@ def __ne__(self, other):
def __setitem__(self, index, value):
self.data[index] = value

# Set slices using a view of the underlying data, as it gives an
# order-of-magnitude speed-up. Only gets called in Python 2. [#3020]
def __setslice__(self, start, stop, value):
self.data.__setslice__(start, stop, value)

def __array_finalize__(self, obj):
# Obj will be none for direct call to Column() creator
if obj is None:
Expand Down