File: declarative_classes.rst

package info (click to toggle)
pytables 3.10.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,228 kB
  • sloc: ansic: 82,212; python: 65,296; cpp: 753; sh: 394; makefile: 100
file content (284 lines) | stat: -rw-r--r-- 5,377 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
.. currentmodule:: tables

Declarative classes
===================
In this section a series of classes that are meant to
*declare* datatypes that are required for creating
primary PyTables datasets are described.


.. _AtomClassDescr:

The Atom class and its descendants
----------------------------------
.. autoclass:: Atom

..  These are defined in the class docstring
    Atom instance variables
    ^^^^^^^^^^^^^^^^^^^^^^^
    .. autoattribute:: Atom.dflt
    .. autoattribute:: Atom.dtype
    .. autoattribute:: Atom.itemsize
    .. autoattribute:: Atom.kind
    .. autoattribute:: Atom.shape
    .. autoattribute:: Atom.type


Atom properties
~~~~~~~~~~~~~~~
.. autoattribute:: Atom.ndim

.. autoattribute:: Atom.recarrtype

.. autoattribute:: Atom.size


Atom methods
~~~~~~~~~~~~
.. automethod:: Atom.copy


Atom factory methods
~~~~~~~~~~~~~~~~~~~~
.. automethod:: Atom.from_dtype

.. automethod:: Atom.from_kind

.. automethod:: Atom.from_sctype

.. automethod:: Atom.from_type


Atom Sub-classes
~~~~~~~~~~~~~~~~
.. autoclass:: StringAtom
    :members:

.. autoclass:: BoolAtom
    :members:

.. autoclass:: IntAtom
    :members:

.. autoclass:: Int8Atom
    :members:

.. autoclass:: Int16Atom
    :members:

.. autoclass:: Int32Atom
    :members:

.. autoclass:: Int64Atom
    :members:

.. autoclass:: UIntAtom
    :members:

.. autoclass:: UInt8Atom
    :members:

.. autoclass:: UInt16Atom
    :members:

.. autoclass:: UInt32Atom
    :members:

.. autoclass:: UInt64Atom
    :members:

.. autoclass:: FloatAtom
    :members:

.. autoclass:: Float32Atom
    :members:

.. autoclass:: Float64Atom
    :members:

.. autoclass:: ComplexAtom
    :members:

.. autoclass:: Time32Atom
    :members:

.. autoclass:: Time64Atom
    :members:

.. autoclass:: EnumAtom
    :members:


Pseudo atoms
~~~~~~~~~~~~
Now, there come three special classes, ObjectAtom, VLStringAtom and
VLUnicodeAtom, that actually do not descend from Atom, but which goal is so
similar that they should be described here. Pseudo-atoms can only be used with
VLArray datasets (see :ref:`VLArrayClassDescr`), and they do not support
multidimensional values, nor multiple values per row.

They can be recognised because they also have kind, type and shape attributes,
but no size, itemsize or dflt ones. Instead, they have a base atom which
defines the elements used for storage.

See :file:`examples/vlarray1.py` and :file:`examples/vlarray2.py` for further
examples on VLArray datasets, including object serialization and string
management.


ObjectAtom
^^^^^^^^^^
.. autoclass:: ObjectAtom
    :members:


.. _VLStringAtom:

VLStringAtom
^^^^^^^^^^^^
.. autoclass:: VLStringAtom
    :members:


.. _VLUnicodeAtom:

VLUnicodeAtom
^^^^^^^^^^^^^
.. autoclass:: VLUnicodeAtom
    :members:


.. _ColClassDescr:

The Col class and its descendants
---------------------------------
.. autoclass:: Col

..
    Col instance variables
    ^^^^^^^^^^^^^^^^^^^^^^
   .. autoattribute:: _v_pos


Col instance variables
~~~~~~~~~~~~~~~~~~~~~~
In addition to the variables that they inherit from the Atom class, Col
instances have the following attributes.

.. attribute:: Col._v_pos

    The *relative* position of this column with regard to its column
    siblings.

.. attribute:: Col._v_col_attrs

    Additional metadata information. See :ref:`AttributeSetClassDescr`.


Col factory methods
~~~~~~~~~~~~~~~~~~~
.. automethod:: Col.from_atom


Col sub-classes
~~~~~~~~~~~~~~~
.. autoclass:: StringCol
    :members:

.. autoclass:: BoolCol
    :members:

.. autoclass:: IntCol
    :members:

.. autoclass:: Int8Col
    :members:

.. autoclass:: Int16Col
    :members:

.. autoclass:: Int32Col
    :members:

.. autoclass:: Int64Col
    :members:

.. autoclass:: UIntCol
    :members:

.. autoclass:: UInt8Col
    :members:

.. autoclass:: UInt16Col
    :members:

.. autoclass:: UInt32Col
    :members:

.. autoclass:: UInt64Col
    :members:

.. autoclass:: Float32Col
    :members:

.. autoclass:: Float64Col
    :members:

.. autoclass:: ComplexCol
    :members:

.. autoclass:: TimeCol
    :members:

.. autoclass:: Time32Col
    :members:

.. autoclass:: Time64Col
    :members:

.. autoclass:: EnumCol
    :members:


.. _IsDescriptionClassDescr:

The IsDescription class
-----------------------
.. autoclass:: IsDescription


Description helper functions
----------------------------
.. autofunction:: tables.description.descr_from_dtype

.. autofunction:: tables.description.dtype_from_descr


.. _AttributeSetClassDescr:

The AttributeSet class
----------------------
.. autoclass:: tables.attributeset.AttributeSet

..  These are defined in the class docstring
    AttributeSet attributes
    ~~~~~~~~~~~~~~~~~~~~~~~
    .. autoattribute:: tables.attributeset.AttributeSet._v_attrnames
    .. autoattribute:: tables.attributeset.AttributeSet._v_attrnamessys
    .. autoattribute:: tables.attributeset.AttributeSet._v_attrnamesuser
    .. autoattribute:: tables.attributeset.AttributeSet._v_unimplemented

AttributeSet properties
~~~~~~~~~~~~~~~~~~~~~~~
.. autoattribute:: tables.attributeset.AttributeSet._v_node


AttributeSet methods
~~~~~~~~~~~~~~~~~~~~
.. automethod:: tables.attributeset.AttributeSet._f_copy

.. automethod:: tables.attributeset.AttributeSet._f_list

.. automethod:: tables.attributeset.AttributeSet._f_rename

.. automethod:: tables.attributeset.AttributeSet.__contains__