(self)
| 194 | class MixedContainersTestCase(common.TempFileMixin, common.PyTablesTestCase): |
| 195 | |
| 196 | def setUp(self): |
| 197 | super().setUp() |
| 198 | |
| 199 | # The expression |
| 200 | self.expr = "2 * a*b + c**2+d**2+e-f+g" |
| 201 | |
| 202 | # Create a directory in file for outputs |
| 203 | root = self.h5file.root |
| 204 | outs = self.h5file.create_group(root, "outs") |
| 205 | |
| 206 | # Define the NumPy variables to be used in expression |
| 207 | N = np.prod(self.shape) |
| 208 | |
| 209 | # Initial values for variables |
| 210 | a = np.arange(0, N, dtype="int32").reshape(self.shape) |
| 211 | b = np.arange(N, 2 * N, dtype="int64").reshape(self.shape) |
| 212 | c = np.arange(2 * N, 3 * N, dtype="int32").reshape(self.shape) |
| 213 | d = np.arange(3 * N, 4 * N, dtype="int32").reshape(self.shape) |
| 214 | e = np.arange(4 * N, 5 * N, dtype="int32").reshape(self.shape) |
| 215 | self.f = f = int(3) # a regular python type |
| 216 | self.g = g = np.int16(2) # a NumPy scalar type |
| 217 | |
| 218 | # Original values |
| 219 | self.npvars = {"a": a, "b": b, "c": c, "d": d, "e": e, "f": f, "g": g} |
| 220 | rnda = b.copy() |
| 221 | |
| 222 | # ndarray input and output |
| 223 | self.a = a |
| 224 | self.rnda = rnda |
| 225 | |
| 226 | # Array input and output |
| 227 | self.b = self.h5file.create_array(root, "b", b) |
| 228 | self.rarr = self.b.copy(outs) |
| 229 | |
| 230 | # CArray input and output |
| 231 | self.c = self.h5file.create_carray( |
| 232 | root, "c", atom=tb.Atom.from_dtype(c.dtype), shape=self.shape |
| 233 | ) |
| 234 | self.c[:] = c |
| 235 | self.rcarr = self.c.copy(outs) |
| 236 | |
| 237 | # EArray input and output |
| 238 | eshape = list(self.shape) |
| 239 | eshape[0] = 0 |
| 240 | self.d = self.h5file.create_earray( |
| 241 | root, "d", atom=tb.Atom.from_dtype(d.dtype), shape=eshape |
| 242 | ) |
| 243 | self.d.append(d) |
| 244 | self.rearr = self.d.copy(outs) |
| 245 | |
| 246 | # Column input and output |
| 247 | rtype = {} |
| 248 | colshape = self.shape[1:] |
| 249 | for i, col in enumerate((a, b, c, d, e, rnda)): |
| 250 | rtype["f%d" % i] = tb.Col.from_sctype(col.dtype.type, colshape) |
| 251 | t = self.h5file.create_table(root, "t", rtype) |
| 252 | nrows = self.shape[0] |
| 253 | row = t.row |
nothing calls this directly
no test coverage detected