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

Method from_sctype

tables/description.py:109–125  ·  view source on GitHub ↗

Create a `Col` definition from a NumPy scalar type `sctype`. Optional shape, default value and position may be specified as the `shape`, `dflt` and `pos` arguments, respectively. Information in the `sctype` not represented in a `Col` is ignored.

(
        cls,
        sctype: str | np.dtype,
        shape: tuple[int, ...] = (),
        dflt: Any | None = None,
        pos: int | None = None,
    )

Source from the content-addressed store, hash-verified

107
108 @classmethod
109 def from_sctype(
110 cls,
111 sctype: str | np.dtype,
112 shape: tuple[int, ...] = (),
113 dflt: Any | None = None,
114 pos: int | None = None,
115 ) -> Col:
116 """Create a `Col` definition from a NumPy scalar type `sctype`.
117
118 Optional shape, default value and position may be specified as
119 the `shape`, `dflt` and `pos` arguments, respectively.
120 Information in the `sctype` not represented in a `Col` is
121 ignored.
122
123 """
124 newatom = atom.Atom.from_sctype(sctype, shape, dflt)
125 return cls.from_atom(newatom, pos=pos)
126
127 @classmethod
128 def from_dtype(

Callers

nothing calls this directly

Calls 1

from_atomMethod · 0.80

Tested by

no test coverage detected