Mark group.
| 1277 | |
| 1278 | |
| 1279 | class MarkG(NotLoggedMixin, Group): |
| 1280 | """Mark group.""" |
| 1281 | |
| 1282 | # Class identifier. |
| 1283 | _c_classid = "MARKG" |
| 1284 | |
| 1285 | import re |
| 1286 | |
| 1287 | _c_shadow_name_re = re.compile(r"^a[0-9]+$") |
| 1288 | |
| 1289 | def _g_width_warning(self) -> None: |
| 1290 | warnings.warn( |
| 1291 | f"mark ``{self._v_pathname}`` is exceeding the recommended " |
| 1292 | f"maximum action storage ({self._v_max_group_width} nodes); " |
| 1293 | f"be ready to see PyTables asking for *lots* of memory and " |
| 1294 | f"possibly slow I/O", |
| 1295 | PerformanceWarning, |
| 1296 | ) |
| 1297 | |
| 1298 | def _g_reset(self) -> None: |
| 1299 | """Empty action storage (nodes and attributes). |
| 1300 | |
| 1301 | This method empties all action storage kept in this node: nodes |
| 1302 | and attributes. |
| 1303 | |
| 1304 | """ |
| 1305 | # Remove action storage nodes. |
| 1306 | for child in list(self._v_children.values()): |
| 1307 | child._g_remove(True, True) |
| 1308 | |
| 1309 | # Remove action storage attributes. |
| 1310 | attrs = self._v_attrs |
| 1311 | shname = self._c_shadow_name_re |
| 1312 | for attrname in attrs._v_attrnamesuser[:]: |
| 1313 | if shname.match(attrname): |
| 1314 | attrs._g__delattr(attrname) |