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

Method _f_close

tables/leaf.py:1033–1055  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 9

closeMethod · 0.95
drop_nodeMethod · 0.45
_close_nodesMethod · 0.45
shutdownMethod · 0.45
closeMethod · 0.45
test18_closedReprMethod · 0.45
test19a_getNodeMethod · 0.45
test20_removeNodeMethod · 0.45
test21_attrsOfNodeMethod · 0.45

Calls 2

flushMethod · 0.95
_g_closeMethod · 0.45

Tested by 4

test18_closedReprMethod · 0.36
test19a_getNodeMethod · 0.36
test20_removeNodeMethod · 0.36
test21_attrsOfNodeMethod · 0.36