Add a sequence of data to the end of the dataset. The sequence must have the same type as the array; otherwise a TypeError is raised. In the same way, the dimensions of the sequence must conform to the shape of the array, that is, all dimensions must match, with the
(self, sequence: npt.ArrayLike)
| 216 | ) |
| 217 | |
| 218 | def append(self, sequence: npt.ArrayLike) -> None: |
| 219 | """Add a sequence of data to the end of the dataset. |
| 220 | |
| 221 | The sequence must have the same type as the array; otherwise a |
| 222 | TypeError is raised. In the same way, the dimensions of the |
| 223 | sequence must conform to the shape of the array, that is, all |
| 224 | dimensions must match, with the exception of the enlargeable |
| 225 | dimension, which can be of any length (even 0!). If the shape |
| 226 | of the sequence is invalid, a ValueError is raised. |
| 227 | |
| 228 | """ |
| 229 | self._g_check_open() |
| 230 | self._v_file._check_writable() |
| 231 | |
| 232 | # Convert the sequence into a NumPy object |
| 233 | nparr = convert_to_np_atom2(sequence, self.atom) |
| 234 | # Check if it has a consistent shape with underlying EArray |
| 235 | self._check_shape_append(nparr) |
| 236 | # If the size of the nparr is zero, don't do anything else |
| 237 | if nparr.size > 0: |
| 238 | self._append(nparr) |
| 239 | |
| 240 | def _g_copy_with_stats( |
| 241 | self, |
no test coverage detected