Private part of Leaf.copy() for each kind of leaf.
(
self,
group: Group,
name: str,
start: int,
stop: int,
step: int,
title: str,
filters: Filters,
chunkshape: tuple[int, ...],
_log: bool,
**kwargs,
)
| 938 | return internal_to_flavor(arr, self.flavor) |
| 939 | |
| 940 | def _g_copy_with_stats( |
| 941 | self, |
| 942 | group: Group, |
| 943 | name: str, |
| 944 | start: int, |
| 945 | stop: int, |
| 946 | step: int, |
| 947 | title: str, |
| 948 | filters: Filters, |
| 949 | chunkshape: tuple[int, ...], |
| 950 | _log: bool, |
| 951 | **kwargs, |
| 952 | ) -> tuple[Array, int]: |
| 953 | """Private part of Leaf.copy() for each kind of leaf.""" |
| 954 | # Compute the correct indices. |
| 955 | start, stop, step = self._process_range_read(start, stop, step) |
| 956 | # Get the slice of the array |
| 957 | # (non-buffered version) |
| 958 | if self.shape: |
| 959 | arr = self[start:stop:step] |
| 960 | else: |
| 961 | arr = self[()] |
| 962 | # Build the new Array object. Use the _atom reserved keyword |
| 963 | # just in case the array is being copied from a native HDF5 |
| 964 | # with atomic types different from scalars. |
| 965 | # For details, see #275 of trac. |
| 966 | object_ = Array( |
| 967 | group, name, arr, title=title, _log=_log, _atom=self.atom |
| 968 | ) |
| 969 | nbytes = np.prod(self.shape, dtype=SizeType) * self.atom.size |
| 970 | |
| 971 | return (object_, nbytes) |
| 972 | |
| 973 | def __repr__(self) -> str: |
| 974 | """Provide more metainfo in addition to standard __str__.""" |
nothing calls this directly
no test coverage detected