Code to be run after node creation and before creation logging. This method gets or sets the flavor of the leaf.
(self)
| 398 | ) |
| 399 | |
| 400 | def _g_post_init_hook(self) -> None: |
| 401 | """Code to be run after node creation and before creation logging. |
| 402 | |
| 403 | This method gets or sets the flavor of the leaf. |
| 404 | |
| 405 | """ |
| 406 | super()._g_post_init_hook() |
| 407 | if self._v_new: # set flavor of new node |
| 408 | if self._flavor is None: |
| 409 | self._flavor = internal_flavor |
| 410 | else: # flavor set at creation time, do not log |
| 411 | if self._v_file.params["PYTABLES_SYS_ATTRS"]: |
| 412 | self._v_attrs._g__setattr("FLAVOR", self._flavor) |
| 413 | else: # get flavor of existing node (if any) |
| 414 | if self._v_file.params["PYTABLES_SYS_ATTRS"]: |
| 415 | flavor = getattr(self._v_attrs, "FLAVOR", internal_flavor) |
| 416 | self._flavor = flavor_alias_map.get(flavor, flavor) |
| 417 | else: |
| 418 | self._flavor = internal_flavor |
| 419 | |
| 420 | def _calc_chunkshape( |
| 421 | self, expectedrows: int, rowsize: int, itemsize: int |
no test coverage detected