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

Method copy

tables/leaf.py:797–856  ·  view source on GitHub ↗

Copy this node and return the new one. This method has the behavior described in :meth:`Node._f_copy`. Please note that there is no recursive flag since leaves do not have child nodes. .. warning:: Note that unknown parameters passed to this method will

(
        self,
        newparent: Group | None = None,
        newname: str | None = None,
        overwrite: bool = False,
        createparents: bool = False,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

795 self._f_move(newparent, newname, overwrite, createparents)
796
797 def copy(
798 self,
799 newparent: Group | None = None,
800 newname: str | None = None,
801 overwrite: bool = False,
802 createparents: bool = False,
803 **kwargs,
804 ) -> Leaf:
805 """Copy this node and return the new one.
806
807 This method has the behavior described in :meth:`Node._f_copy`. Please
808 note that there is no recursive flag since leaves do not have child
809 nodes.
810
811 .. warning::
812
813 Note that unknown parameters passed to this method will be
814 ignored, so may want to double check the spelling of these
815 (i.e. if you write them incorrectly, they will most probably
816 be ignored).
817
818 Parameters
819 ----------
820 title
821 The new title for the destination. If omitted or None, the original
822 title is used.
823 filters : Filters
824 Specifying this parameter overrides the original filter properties
825 in the source node. If specified, it must be an instance of the
826 Filters class (see :ref:`FiltersClassDescr`). The default is to
827 copy the filter properties from the source node.
828 copyuserattrs
829 You can prevent the user attributes from being copied by setting
830 this parameter to False. The default is to copy them.
831 start, stop, step : int
832 Specify the range of rows to be copied; the default is to copy all
833 the rows.
834 stats
835 This argument may be used to collect statistics on the copy
836 process. When used, it should be a dictionary with keys 'groups',
837 'leaves' and 'bytes' having a numeric value. Their values will be
838 incremented to reflect the number of groups, leaves and bytes,
839 respectively, that have been copied during the operation.
840 chunkshape
841 The chunkshape of the new leaf. It supports a couple of special
842 values. A value of keep means that the chunkshape will be the same
843 as original leaf (this is the default). A value of auto means
844 that a new shape will be computed automatically in order to ensure
845 the best performance when accessing the dataset through the main
846 dimension. Any other value should be an integer or a tuple
847 matching the dimensions of the leaf.
848
849 """
850 return self._f_copy(
851 newparent,
852 newname,
853 overwrite,
854 createparents=createparents,

Callers 15

setup.pyFile · 0.45
__init__Method · 0.45
_g_fix_byteorder_dataMethod · 0.45
_point_selectionMethod · 0.45
conv_to_numpyFunction · 0.45
__init__Method · 0.45
_g_copyMethod · 0.45
initial_appendMethod · 0.45
cleanup_tempMethod · 0.45
search_last_rowMethod · 0.45
_read_selectionMethod · 0.45

Calls 1

_f_copyMethod · 0.45

Tested by 15

test_methodFunction · 0.36
test03_readEArrayMethod · 0.36
test04_getitemEArrayMethod · 0.36
test05_setitemEArrayMethod · 0.36
test01_copyMethod · 0.36
test02_copyMethod · 0.36
test03a_copyMethod · 0.36
test03b_copyMethod · 0.36
test03c_copyMethod · 0.36
test04_copyMethod · 0.36
test05_copyMethod · 0.36