MCPcopy Create free account
hub / github.com/PyTables/PyTables / _g_create

Method _g_create

tables/earray.py:174–192  ·  view source on GitHub ↗

Create a new array in file (specific part).

(self)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 2

indexMethod · 0.80
_g_create_commonMethod · 0.80

Tested by

no test coverage detected