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

Function _generate_col_classes

tables/description.py:260–282  ·  view source on GitHub ↗

Generate all column classes.

()

Source from the content-addressed store, hash-verified

258
259
260def _generate_col_classes() -> Generator[type[Col]]:
261 """Generate all column classes."""
262 # Abstract classes are not in the class map.
263 cprefixes = ["Int", "UInt", "Float", "Time"]
264 for kind, kdata in atom.atom_map.items():
265 if hasattr(kdata, "kind"): # atom class: non-fixed item size
266 atomclass = kdata
267 cprefixes.append(atomclass.prefix())
268 else: # dictionary: fixed item size
269 for atomclass in kdata.values():
270 cprefixes.append(atomclass.prefix())
271
272 # Bottom-level complex classes are not in the type map, of course.
273 # We still want the user to get the compatibility warning, though.
274 cprefixes.extend(["Complex32", "Complex64", "Complex128"])
275 if hasattr(atom, "Complex192Atom"):
276 cprefixes.append("Complex192")
277 if hasattr(atom, "Complex256Atom"):
278 cprefixes.append("Complex256")
279
280 for cprefix in cprefixes:
281 newclass = Col._subclass_from_prefix(cprefix)
282 yield newclass
283
284
285# Create all column classes.

Callers

nothing calls this directly

Calls 5

_subclass_from_prefixMethod · 0.80
itemsMethod · 0.45
appendMethod · 0.45
prefixMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected