Create a `Col` definition from a PyTables `kind`. Optional item size, shape, default value and position may be specified as the `itemsize`, `shape`, `dflt` and `pos` arguments, respectively. Bear in mind that not all columns support a default item size.
(
cls,
kind,
itemsize=None,
shape: tuple[int, ...] = (),
dflt: Any | None = None,
pos: int | None = None,
)
| 163 | |
| 164 | @classmethod |
| 165 | def from_kind( |
| 166 | cls, |
| 167 | kind, |
| 168 | itemsize=None, |
| 169 | shape: tuple[int, ...] = (), |
| 170 | dflt: Any | None = None, |
| 171 | pos: int | None = None, |
| 172 | ) -> Col: |
| 173 | """Create a `Col` definition from a PyTables `kind`. |
| 174 | |
| 175 | Optional item size, shape, default value and position may be |
| 176 | specified as the `itemsize`, `shape`, `dflt` and `pos` |
| 177 | arguments, respectively. Bear in mind that not all columns |
| 178 | support a default item size. |
| 179 | |
| 180 | """ |
| 181 | newatom = atom.Atom.from_kind(kind, itemsize, shape, dflt) |
| 182 | return cls.from_atom(newatom, pos=pos) |
| 183 | |
| 184 | @classmethod |
| 185 | def _subclass_from_prefix(cls, prefix: str) -> type[Col]: |