Create a new array in file (specific part).
(self)
| 172 | ) |
| 173 | |
| 174 | def _g_create(self) -> int: |
| 175 | """Create a new array in file (specific part).""" |
| 176 | # Pre-conditions and extdim computation |
| 177 | zerodims = np.sum(np.array(self.shape) == 0) |
| 178 | if zerodims > 0: |
| 179 | if zerodims == 1: |
| 180 | self.extdim = list(self.shape).index(0) |
| 181 | else: |
| 182 | raise NotImplementedError( |
| 183 | "Multiple enlargeable (0-)dimensions are not " "supported." |
| 184 | ) |
| 185 | else: |
| 186 | raise ValueError( |
| 187 | "When creating EArrays, you need to set one of " |
| 188 | "the dimensions of the Atom instance to zero." |
| 189 | ) |
| 190 | |
| 191 | # Finish the common part of the creation process |
| 192 | return self._g_create_common(self._v_expectedrows) |
| 193 | |
| 194 | def _check_shape_append(self, nparr: np.ndarray) -> None: |
| 195 | """Test that nparr shape is consistent with underlying EArray.""" |
nothing calls this directly
no test coverage detected