Create a new array in file (common part).
(self, expectedrows: int)
| 231 | return self._g_create_common(self.nrows) |
| 232 | |
| 233 | def _g_create_common(self, expectedrows: int) -> int: |
| 234 | """Create a new array in file (common part).""" |
| 235 | self._v_version = obversion |
| 236 | |
| 237 | if self._v_chunkshape is None: |
| 238 | # Compute the optimal chunk size |
| 239 | self._v_chunkshape = self._calc_chunkshape( |
| 240 | expectedrows, self.rowsize, self.atom.size |
| 241 | ) |
| 242 | # Compute the optimal nrowsinbuf |
| 243 | self.nrowsinbuf = self._calc_nrowsinbuf() |
| 244 | # Correct the byteorder if needed |
| 245 | if self.byteorder is None: |
| 246 | self.byteorder = correct_byteorder(self.atom.type, sys.byteorder) |
| 247 | |
| 248 | try: |
| 249 | # ``self._v_objectid`` needs to be set because would be |
| 250 | # needed for setting attributes in some descendants later |
| 251 | # on |
| 252 | self._v_objectid = self._create_carray(self._v_new_title) |
| 253 | except Exception: # XXX |
| 254 | # Problems creating the Array on disk. Close node and re-raise. |
| 255 | self.close(flush=0) |
| 256 | raise |
| 257 | |
| 258 | return self._v_objectid |
| 259 | |
| 260 | def _g_copy_with_stats( |
| 261 | self, |
no test coverage detected