MCPcopy Index your code
hub / github.com/PyTables/PyTables / create_temp2

Method create_temp2

tables/index.py:1233–1322  ·  view source on GitHub ↗

Create some temporary objects for slice sorting purposes.

(self)

Source from the content-addressed store, hash-verified

1231 )
1232
1233 def create_temp2(self) -> None:
1234 """Create some temporary objects for slice sorting purposes."""
1235 # The algorithms for doing the swap can be optimized so that
1236 # one should be necessary to create temporaries for keeping just
1237 # the contents of a single superblock.
1238 # F. Alted 2007-01-03
1239 cs = self.chunksize
1240 ss = self.slicesize
1241 filters = self.filters
1242 # temporary sorted & indices arrays
1243 shape = (self.nslices, ss)
1244 atom = Atom.from_dtype(self.dtype)
1245 tmp = self.tmp
1246 CArray(
1247 tmp,
1248 "sorted2",
1249 atom,
1250 shape,
1251 "Temporary sorted 2",
1252 filters,
1253 chunkshape=(1, cs),
1254 )
1255 CArray(
1256 tmp,
1257 "indices2",
1258 UIntAtom(itemsize=self.indsize),
1259 shape,
1260 "Temporary indices 2",
1261 filters,
1262 chunkshape=(1, cs),
1263 )
1264 # temporary bounds
1265 nbounds_inslice = (ss - 1) // cs
1266 shape = (self.nslices, nbounds_inslice)
1267 CArray(
1268 tmp,
1269 "bounds2",
1270 atom,
1271 shape,
1272 "Temp chunk bounds 2",
1273 filters,
1274 chunkshape=(cs, nbounds_inslice),
1275 )
1276 shape = (self.nchunks,)
1277 CArray(
1278 tmp,
1279 "abounds2",
1280 atom,
1281 shape,
1282 "Temp start bounds 2",
1283 filters,
1284 chunkshape=(cs,),
1285 )
1286 CArray(
1287 tmp,
1288 "zbounds2",
1289 atom,
1290 shape,

Callers 1

optimizeMethod · 0.95

Calls 3

CArrayClass · 0.85
UIntAtomClass · 0.85
from_dtypeMethod · 0.45

Tested by

no test coverage detected