Move this node in the hierarchy. Moves the node into the given `newparent`, with the given `newname`. It does not log the change.
(self, newparent: Group, newname: str)
| 551 | move_to_shadow(file_, oldpathname) |
| 552 | |
| 553 | def _g_move(self, newparent: Group, newname: str) -> None: |
| 554 | """Move this node in the hierarchy. |
| 555 | |
| 556 | Moves the node into the given `newparent`, with the given |
| 557 | `newname`. |
| 558 | |
| 559 | It does not log the change. |
| 560 | |
| 561 | """ |
| 562 | oldparent = self._v_parent |
| 563 | oldname = self._v_name |
| 564 | oldpathname = self._v_pathname # to move the HDF5 node |
| 565 | |
| 566 | # Try to insert the node into the new parent. |
| 567 | newparent._g_refnode(self, newname) |
| 568 | # Remove the node from the new parent. |
| 569 | oldparent._g_unrefnode(oldname) |
| 570 | |
| 571 | # Remove location information for this node. |
| 572 | self._g_del_location() |
| 573 | # Set new location information for this node. |
| 574 | self._g_set_location(newparent, newname) |
| 575 | |
| 576 | # hdf5extension operations: |
| 577 | # Update node attributes. |
| 578 | self._g_new(newparent, self._v_name, init=False) |
| 579 | # Move the node. |
| 580 | # self._v_parent._g_move_node(oldpathname, self._v_pathname) |
| 581 | self._v_parent._g_move_node( |
| 582 | oldparent._v_objectid, |
| 583 | oldname, |
| 584 | newparent._v_objectid, |
| 585 | newname, |
| 586 | oldpathname, |
| 587 | self._v_pathname, |
| 588 | ) |
| 589 | |
| 590 | # Tell dependent objects about the new location of this node. |
| 591 | self._g_update_dependent() |
| 592 | |
| 593 | def _f_rename(self, newname: str, overwrite: bool = False) -> None: |
| 594 | """Rename this node in place. |
no test coverage detected