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

fix for #252 #253

Closed
wants to merge 6 commits into from
Closed

fix for #252 #253

wants to merge 6 commits into from

Conversation

scopatz
Copy link
Member

@scopatz scopatz commented May 11, 2013

This is a fix for this negative step size issue, since hsize_t on many platforms is now an unsigned long.

@avalentino
Copy link
Member

@scopatz also applying the patch it seems that revere iteration still doesn't work (see 255e669).
The fix seems to be not immediate. Also we should make a decision about gh-44 that seems to be related to table iteration and implies an API change).

@scopatz
Copy link
Member Author

scopatz commented May 12, 2013

So this fix that I put in works for when step is -1 but not when it is < -1. Thus the test case I was working with (below) passes, but the one that you put in the test suite doesn't since step = -5 there.

import tables

class IndexRecord(tables.IsDescription):
    frame = tables.Int32Col(pos=1)
    key = tables.StringCol(itemsize=40, pos=2)     

h5 = tables.openFile("trace.h5", 'w')
index = h5.createTable(h5.root, "index", IndexRecord)


index.append([(0, 'A')])
index.append([(1, 'B')])
index.append([(3, 'C')])
index.append([(4, 'D')])
index.flush()

index.cols._f_col('frame').createCSIndex()
for row in index.itersorted('frame', step=-1):   #<-crashes here!
    print row['frame'], row['key']

from http://stackoverflow.com/questions/16407274/reverse-iterate-pytable-with-itersorted-and-negative-step-produces-overflowerror

@avalentino
Copy link
Member

Merged with commit 7c2093a.

@avalentino avalentino closed this May 16, 2013
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.

None yet

2 participants