Hello,
the error below appears within the update iteration, if indexed=1 and
rows>4999.
Reason may be the chunksize code in IndexArray.py.
Is there anything wrong with the code, or is it not implemented
following the error message ?
Regards,
Bernd

------------------------------------------------
# error:

NotImplementedError: You are only allowed to update rows through the
Row.update() method if you are in the middle of a table iterator.
Traceback (innermost last):
File "c:\amdpython\scripts\datacrawler\update_test.py", line 1, in ?
  import sys, os
File "c:\amdpython\scripts\datacrawler\update_test.py", line 37, in ?
  row.update()
File "C:\Python24\Lib\site-packages\tables\TableExtension.pyd", line
1161, in TableExtension.Row.update

------------------------------------------------
# code:

file = "c:/temp/update_test.h5"
dims = (2,2,2)
indexed = 1
rows = 5000

class Item(IsDescription):
        name = StringCol(16, indexed=indexed) # 16-character String
        vals = Float32Col(0.0, shape=(dims))

# write
h5 = openFile(file, mode = "w")
group = h5.createGroup("/", 'igroup')
table = h5.createTable(group, "items", Item, "Item",
Filters(complevel=9, complib='zlib'))
row = table.row
for i in xrange(rows):
        row['name'] = "x%d" % (i)
        row['vals'] = ones(dims)
        row.append()
table.flush()
h5.close()

# update
h5 = openFile(file, mode = "a")
table = h5.root.igroup.items
for row in table:
        buf = row['vals']
        buf[0] = 2.2
        row['vals'] = buf
        row.update()
h5.close()



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to