Close this node in the tree. This method has the behavior described in :meth:`Node._f_close`. Besides that, the optional argument flush tells whether to flush pending data to disk or not before closing.
(self, flush: bool = True)
| 1031 | self._g_write_chunk(coords, data, filter_mask) |
| 1032 | |
| 1033 | def _f_close(self, flush: bool = True) -> None: |
| 1034 | """Close this node in the tree. |
| 1035 | |
| 1036 | This method has the behavior described in :meth:`Node._f_close`. |
| 1037 | Besides that, the optional argument flush tells whether to flush |
| 1038 | pending data to disk or not before closing. |
| 1039 | |
| 1040 | """ |
| 1041 | if not self._v_isopen: |
| 1042 | return # the node is already closed or not initialized |
| 1043 | |
| 1044 | # Only do a flush in case the leaf has an IO buffer. The |
| 1045 | # internal buffers of HDF5 will be flushed afterwards during the |
| 1046 | # self._g_close() call. Avoiding an unnecessary flush() |
| 1047 | # operation accelerates the closing for the unbuffered leaves. |
| 1048 | if flush and hasattr(self, "_v_iobuf"): |
| 1049 | self.flush() |
| 1050 | |
| 1051 | # Close the dataset and release resources |
| 1052 | self._g_close() |
| 1053 | |
| 1054 | # Close myself as a node. |
| 1055 | super()._f_close() |
| 1056 | |
| 1057 | def close(self, flush: bool = True) -> None: |
| 1058 | """Close this node in the tree. |