~ubuntu-branches/ubuntu/natty/pytables/natty-updates

« back to all changes in this revision

Viewing changes to doc/html/x4389.html

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2006-06-28 10:45:03 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060628104503-qsoprcycf84lql5h
Tags: 1.3.2-2
  * Fixed call to pyversions in debian/rules which failed on recent versions 
    of pyversions
  * Fixed clean rule in debian/rules which left the stamp files behind
  * Acknowledge NMU
  * Added Alexandre Fayolle to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Declarative classes
 
6
          </TITLE
 
7
><META
 
8
NAME="GENERATOR"
 
9
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
10
REL="HOME"
 
11
TITLE="PyTables User's Guide"
 
12
HREF="index.html"><LINK
 
13
REL="UP"
 
14
TITLE="Library Reference"
 
15
HREF="c1381.html"><LINK
 
16
REL="PREVIOUS"
 
17
TITLE="The AttributeSet
 
18
            class"
 
19
HREF="x4306.html"><LINK
 
20
REL="NEXT"
 
21
TITLE="Helper classes"
 
22
HREF="x4983.html"></HEAD
 
23
><BODY
 
24
CLASS="sect1"
 
25
BGCOLOR="#FFFFFF"
 
26
TEXT="#000000"
 
27
LINK="#0000FF"
 
28
VLINK="#840084"
 
29
ALINK="#0000FF"
 
30
><DIV
 
31
CLASS="NAVHEADER"
 
32
><TABLE
 
33
SUMMARY="Header navigation table"
 
34
WIDTH="100%"
 
35
BORDER="0"
 
36
CELLPADDING="0"
 
37
CELLSPACING="0"
 
38
><TR
 
39
><TH
 
40
COLSPAN="3"
 
41
ALIGN="center"
 
42
><SPAN
 
43
CLASS="markup"
 
44
>PyTables</SPAN
 
45
> User's Guide: Hierarchical datasets in Python - Release 1.3.2</TH
 
46
></TR
 
47
><TR
 
48
><TD
 
49
WIDTH="10%"
 
50
ALIGN="left"
 
51
VALIGN="bottom"
 
52
><A
 
53
HREF="x4306.html"
 
54
ACCESSKEY="P"
 
55
>Prev</A
 
56
></TD
 
57
><TD
 
58
WIDTH="80%"
 
59
ALIGN="center"
 
60
VALIGN="bottom"
 
61
>Chapter 4. Library Reference</TD
 
62
><TD
 
63
WIDTH="10%"
 
64
ALIGN="right"
 
65
VALIGN="bottom"
 
66
><A
 
67
HREF="x4983.html"
 
68
ACCESSKEY="N"
 
69
>Next</A
 
70
></TD
 
71
></TR
 
72
></TABLE
 
73
><HR
 
74
ALIGN="LEFT"
 
75
WIDTH="100%"></DIV
 
76
><DIV
 
77
CLASS="sect1"
 
78
><H1
 
79
CLASS="sect1"
 
80
><A
 
81
NAME="section4.16"
 
82
>4.16. Declarative classes</A
 
83
></H1
 
84
><A
 
85
NAME="declarativeClasses"
 
86
></A
 
87
><P
 
88
>In this section a series of classes that are meant to
 
89
            <SPAN
 
90
CLASS="emphasis"
 
91
><I
 
92
CLASS="emphasis"
 
93
>declare</I
 
94
></SPAN
 
95
> datatypes that are required for primary
 
96
            <SAMP
 
97
CLASS="computeroutput"
 
98
>PyTables</SAMP
 
99
> (like <SAMP
 
100
CLASS="computeroutput"
 
101
>Table</SAMP
 
102
> or
 
103
            <SAMP
 
104
CLASS="computeroutput"
 
105
>VLArray</SAMP
 
106
> ) objects are described.
 
107
          </P
 
108
><DIV
 
109
CLASS="sect2"
 
110
><H2
 
111
CLASS="sect2"
 
112
><A
 
113
NAME="subsection4.16.1"
 
114
>4.16.1. The <SPAN
 
115
CLASS="markup"
 
116
>IsDescription</SPAN
 
117
>
 
118
              class</A
 
119
></H2
 
120
><A
 
121
NAME="IsDescriptionClassDescr"
 
122
></A
 
123
><P
 
124
>This class is designed to be used as an easy, yet
 
125
              meaningful way to describe the properties of
 
126
              <SAMP
 
127
CLASS="computeroutput"
 
128
>Table</SAMP
 
129
> objects through the definition of
 
130
              <SPAN
 
131
CLASS="emphasis"
 
132
><I
 
133
CLASS="emphasis"
 
134
>derived classes</I
 
135
></SPAN
 
136
> that inherit properties from it.
 
137
              In order to define such a class, you must declare it as
 
138
              descendant of <SPAN
 
139
CLASS="emphasis"
 
140
><I
 
141
CLASS="emphasis"
 
142
>IsDescription</I
 
143
></SPAN
 
144
>, with as many
 
145
              attributes as columns you want in your table.  The name of
 
146
              each attribute will become the name of a column, and its
 
147
              value will hold a description of it.
 
148
            </P
 
149
><P
 
150
>Ordinary columns can be described using instances of the
 
151
              <SAMP
 
152
CLASS="computeroutput"
 
153
>Col</SAMP
 
154
> (see <A
 
155
HREF="x4389.html#ColClassDescr"
 
156
>section�4.16.2</A
 
157
>) class.  Nested
 
158
              columns can be described by using classes derived from
 
159
              <SAMP
 
160
CLASS="computeroutput"
 
161
>IsDescription</SAMP
 
162
> or instances of it.  Derived
 
163
              classes can be declared in place (in which case the column
 
164
              takes the name of the class) or referenced by name, and
 
165
              they can have a <SAMP
 
166
CLASS="computeroutput"
 
167
>_v_pos</SAMP
 
168
> special attribute
 
169
              which sets the position of the nested column among its
 
170
              sibling columns.
 
171
            </P
 
172
><P
 
173
>Once you have created a description object, you can pass
 
174
              it to the <SAMP
 
175
CLASS="computeroutput"
 
176
>Table</SAMP
 
177
> constructor, where all the
 
178
              information it contains will be used to define the table
 
179
              structure. See the <A
 
180
HREF="x1017.html#secondExample"
 
181
>section�3.4</A
 
182
> for an example on how
 
183
              that works.
 
184
            </P
 
185
><P
 
186
>See below for a complete list of the special attributes
 
187
              that can be specified to complement the
 
188
              <SPAN
 
189
CLASS="emphasis"
 
190
><I
 
191
CLASS="emphasis"
 
192
>metadata</I
 
193
></SPAN
 
194
> of an <SAMP
 
195
CLASS="computeroutput"
 
196
>IsDescription</SAMP
 
197
>
 
198
              class.
 
199
            </P
 
200
><DIV
 
201
CLASS="sect3"
 
202
><H3
 
203
CLASS="sect3"
 
204
><A
 
205
NAME="subsubsection4.16.1.1"
 
206
>4.16.1.1. <SPAN
 
207
CLASS="markup"
 
208
>IsDescription</SPAN
 
209
> special
 
210
                attributes</A
 
211
></H3
 
212
><A
 
213
NAME="IsDescription.specialAttrs"
 
214
></A
 
215
><DIV
 
216
CLASS="glosslist"
 
217
><DL
 
218
><DT
 
219
><B
 
220
>_v_flavor</B
 
221
></DT
 
222
><DD
 
223
><P
 
224
>The flavor of the
 
225
                  table. It can take <SPAN
 
226
CLASS="emphasis"
 
227
><I
 
228
CLASS="emphasis"
 
229
>"numarray"</I
 
230
></SPAN
 
231
> (default) or
 
232
                  <SPAN
 
233
CLASS="emphasis"
 
234
><I
 
235
CLASS="emphasis"
 
236
>"numpy"</I
 
237
></SPAN
 
238
> values. This determines the type of
 
239
                  objects returned during input (i.e. read) operations.
 
240
                </P
 
241
></DD
 
242
><DT
 
243
><B
 
244
>_v_indexprops</B
 
245
></DT
 
246
><DD
 
247
><P
 
248
>An instance of the
 
249
                  <SAMP
 
250
CLASS="computeroutput"
 
251
>IndexProps</SAMP
 
252
> class (see <A
 
253
HREF="x4983.html#IndexPropsClassDescr"
 
254
>section�4.17.2</A
 
255
>). You can
 
256
                  use this to alter the properties of the index
 
257
                  creation process for a table.
 
258
                </P
 
259
></DD
 
260
><DT
 
261
><B
 
262
>_v_pos</B
 
263
></DT
 
264
><DD
 
265
><P
 
266
>Sets the position of a
 
267
                  possible nested column description among its sibling
 
268
                  columns.
 
269
                </P
 
270
></DD
 
271
></DL
 
272
></DIV
 
273
></DIV
 
274
></DIV
 
275
><DIV
 
276
CLASS="sect2"
 
277
><H2
 
278
CLASS="sect2"
 
279
><A
 
280
NAME="subsection4.16.2"
 
281
>4.16.2. The <SPAN
 
282
CLASS="markup"
 
283
>Col</SPAN
 
284
> class and its
 
285
              descendants</A
 
286
></H2
 
287
><A
 
288
NAME="ColClassDescr"
 
289
></A
 
290
><P
 
291
>The <SAMP
 
292
CLASS="computeroutput"
 
293
>Col</SAMP
 
294
> class is used as a mean to declare
 
295
              the different properties of a table column. In addition, a
 
296
              series of descendant classes are offered in order to make
 
297
              these column descriptions easier to the user. In general,
 
298
              it is recommended to use these descendant classes, as they
 
299
              are more meaningful when found in the middle of the code.
 
300
            </P
 
301
><DIV
 
302
CLASS="sect3"
 
303
><H3
 
304
CLASS="sect3"
 
305
><A
 
306
NAME="subsubsection4.16.2.1"
 
307
>4.16.2.1. <SPAN
 
308
CLASS="markup"
 
309
>Col</SPAN
 
310
> instance
 
311
                attributes</A
 
312
></H3
 
313
><DIV
 
314
CLASS="glosslist"
 
315
><DL
 
316
><DT
 
317
><B
 
318
>type</B
 
319
></DT
 
320
><DD
 
321
><P
 
322
>The type class of the column.
 
323
                </P
 
324
></DD
 
325
><DT
 
326
><B
 
327
>stype</B
 
328
></DT
 
329
><DD
 
330
><P
 
331
>The string type of the column.
 
332
                </P
 
333
></DD
 
334
><DT
 
335
><B
 
336
>recarrtype</B
 
337
></DT
 
338
><DD
 
339
><P
 
340
>The string type, in
 
341
                  <SAMP
 
342
CLASS="computeroutput"
 
343
>RecArray</SAMP
 
344
> format, of the column.
 
345
                </P
 
346
></DD
 
347
><DT
 
348
><B
 
349
>shape</B
 
350
></DT
 
351
><DD
 
352
><P
 
353
>The shape of the column.</P
 
354
></DD
 
355
><DT
 
356
><B
 
357
>itemsize</B
 
358
></DT
 
359
><DD
 
360
><P
 
361
>The size of the base
 
362
                  items. Specially useful for <SAMP
 
363
CLASS="computeroutput"
 
364
>StringCol</SAMP
 
365
>
 
366
                  objects.
 
367
                </P
 
368
></DD
 
369
><DT
 
370
><B
 
371
>indexed</B
 
372
></DT
 
373
><DD
 
374
><P
 
375
>Whether this column is meant
 
376
                  to be indexed or not.</P
 
377
></DD
 
378
><DT
 
379
><B
 
380
>_v_pos</B
 
381
></DT
 
382
><DD
 
383
><P
 
384
>The position of this column
 
385
                  with regard to its column siblings.</P
 
386
></DD
 
387
><DT
 
388
><B
 
389
>_v_name</B
 
390
></DT
 
391
><DD
 
392
><P
 
393
>The name of this column</P
 
394
></DD
 
395
><DT
 
396
><B
 
397
>_v_pathname</B
 
398
></DT
 
399
><DD
 
400
><P
 
401
>The complete pathname of
 
402
                  the column. This is mainly useful in nested columns;
 
403
                  for non-nested ones this value is the same a
 
404
                  <SAMP
 
405
CLASS="computeroutput"
 
406
>_v_name</SAMP
 
407
>.
 
408
                </P
 
409
></DD
 
410
></DL
 
411
></DIV
 
412
></DIV
 
413
><DIV
 
414
CLASS="sect3"
 
415
><H3
 
416
CLASS="sect3"
 
417
><A
 
418
NAME="subsubsection4.16.2.2"
 
419
>4.16.2.2. <SPAN
 
420
CLASS="markup"
 
421
>Col</SPAN
 
422
>
 
423
                methods</A
 
424
></H3
 
425
><P
 
426
>None.</P
 
427
></DIV
 
428
><DIV
 
429
CLASS="sect3"
 
430
><H3
 
431
CLASS="sect3"
 
432
><A
 
433
NAME="subsubsection4.16.2.3"
 
434
>4.16.2.3. <SPAN
 
435
CLASS="markup"
 
436
>Col</SPAN
 
437
>
 
438
                constructors</A
 
439
></H3
 
440
><P
 
441
>A description of the different constructors with their
 
442
                parameters follows:
 
443
              </P
 
444
><DIV
 
445
CLASS="glosslist"
 
446
><DL
 
447
><DT
 
448
><B
 
449
>Col(dtype="Float64", shape=1, dflt=None, pos=None,
 
450
                  indexed=0)
 
451
                </B
 
452
></DT
 
453
><DD
 
454
><P
 
455
>Declare the properties of a <SAMP
 
456
CLASS="computeroutput"
 
457
>Table</SAMP
 
458
>
 
459
                  column.
 
460
 
 
461
                  </P
 
462
><DIV
 
463
CLASS="glosslist"
 
464
><DL
 
465
><DT
 
466
><B
 
467
>dtype</B
 
468
></DT
 
469
><DD
 
470
><P
 
471
>The data type for the
 
472
                      column. All types listed in <A
 
473
HREF="a6585.html#datatypesSupported"
 
474
> appendix�A</A
 
475
> are valid
 
476
                      data types for columns.  The type description is
 
477
                      accepted both in string-type format and as a
 
478
                      numarray data type.</P
 
479
></DD
 
480
><DT
 
481
><B
 
482
>shape</B
 
483
></DT
 
484
><DD
 
485
><P
 
486
>An integer or a tuple, that
 
487
                      specifies the number of <SPAN
 
488
CLASS="emphasis"
 
489
><I
 
490
CLASS="emphasis"
 
491
>dtype</I
 
492
></SPAN
 
493
> items for
 
494
                      each element (or shape, for multidimensional
 
495
                      elements) of this column. For <SAMP
 
496
CLASS="computeroutput"
 
497
>CharType</SAMP
 
498
>
 
499
                      columns, the last dimension is used as the length
 
500
                      of the character strings. However, for this kind of
 
501
                      objects, the use of <SAMP
 
502
CLASS="computeroutput"
 
503
>StringCol</SAMP
 
504
> subclass
 
505
                      is strongly recommended.</P
 
506
></DD
 
507
><DT
 
508
><B
 
509
>dflt</B
 
510
></DT
 
511
><DD
 
512
><P
 
513
>The default value for
 
514
                      elements of this column. If the user does not
 
515
                      supply a value for an element while filling a
 
516
                      table, this default value will be written to
 
517
                      disk. If the user supplies an scalar value for a
 
518
                      multidimensional column, this value is
 
519
                      automatically <SPAN
 
520
CLASS="emphasis"
 
521
><I
 
522
CLASS="emphasis"
 
523
>broadcasted</I
 
524
></SPAN
 
525
> to all the
 
526
                      elements in the column cell. If <SPAN
 
527
CLASS="emphasis"
 
528
><I
 
529
CLASS="emphasis"
 
530
>dflt</I
 
531
></SPAN
 
532
> is
 
533
                      not supplied, an appropriate zero value (or
 
534
                      <SPAN
 
535
CLASS="emphasis"
 
536
><I
 
537
CLASS="emphasis"
 
538
>null</I
 
539
></SPAN
 
540
> string) will be chosen by default.
 
541
                      Please, note that all the default values are kept
 
542
                      internally as numarray objects. </P
 
543
></DD
 
544
><DT
 
545
><B
 
546
>pos</B
 
547
></DT
 
548
><DD
 
549
><P
 
550
>By default, columns are
 
551
                      arranged in memory following an alpha-numerical
 
552
                      order of the column names. In some situations,
 
553
                      however, it is convenient to impose a user defined
 
554
                      ordering. <SPAN
 
555
CLASS="emphasis"
 
556
><I
 
557
CLASS="emphasis"
 
558
>pos</I
 
559
></SPAN
 
560
> parameter allows the user
 
561
                      to force the desired ordering.</P
 
562
></DD
 
563
><DT
 
564
><B
 
565
>indexed</B
 
566
></DT
 
567
><DD
 
568
><P
 
569
>Whether this column should
 
570
                      be indexed for better performance in table
 
571
                      selections. </P
 
572
></DD
 
573
></DL
 
574
></DIV
 
575
><P
 
576
>&#13;          </P
 
577
></DD
 
578
><DT
 
579
><B
 
580
>StringCol(length=None, dflt=None, shape=1, pos=None,
 
581
                  indexed=0)
 
582
                </B
 
583
></DT
 
584
><DD
 
585
><P
 
586
>Declare a column to be of type
 
587
                  <SAMP
 
588
CLASS="computeroutput"
 
589
>CharType</SAMP
 
590
>. The <SPAN
 
591
CLASS="emphasis"
 
592
><I
 
593
CLASS="emphasis"
 
594
>length</I
 
595
></SPAN
 
596
> parameter
 
597
                  sets the length of the strings. The meaning of the other
 
598
                  parameters are like in the <SAMP
 
599
CLASS="computeroutput"
 
600
>Col</SAMP
 
601
> class.
 
602
                </P
 
603
></DD
 
604
><DT
 
605
><B
 
606
>BoolCol(dflt=0, shape=1, pos=None, indexed=0) </B
 
607
></DT
 
608
><DD
 
609
><P
 
610
>Define a column to be of type <SAMP
 
611
CLASS="computeroutput"
 
612
>Bool</SAMP
 
613
>.
 
614
                  The meaning of the parameters are the same of those in
 
615
                  the <SAMP
 
616
CLASS="computeroutput"
 
617
>Col</SAMP
 
618
> class.
 
619
                </P
 
620
></DD
 
621
><DT
 
622
><B
 
623
>IntCol(dflt=0, shape=1, itemsize=4, sign=1,
 
624
                  pos=None, indexed=0)
 
625
                </B
 
626
></DT
 
627
><DD
 
628
><P
 
629
>Declare a column to be of type <SAMP
 
630
CLASS="computeroutput"
 
631
>IntXX</SAMP
 
632
>,
 
633
                  depending on the value of <SPAN
 
634
CLASS="emphasis"
 
635
><I
 
636
CLASS="emphasis"
 
637
>itemsize</I
 
638
></SPAN
 
639
> parameter,
 
640
                  that sets the number of bytes of the integers in the
 
641
                  column. <SPAN
 
642
CLASS="emphasis"
 
643
><I
 
644
CLASS="emphasis"
 
645
>sign</I
 
646
></SPAN
 
647
> determines whether the integers
 
648
                  are signed or not. The meaning of the other parameters
 
649
                  are the same of those in the <SAMP
 
650
CLASS="computeroutput"
 
651
>Col</SAMP
 
652
> class.
 
653
 
 
654
                  </P
 
655
><P
 
656
>This class has several descendants:
 
657
                  </P
 
658
><P
 
659
>&#13;
 
660
                  </P
 
661
><DIV
 
662
CLASS="glosslist"
 
663
><DL
 
664
><DT
 
665
><B
 
666
>Int8Col(dflt=0, shape=1, pos=None,
 
667
                      indexed=0)</B
 
668
></DT
 
669
><DD
 
670
><P
 
671
>Define a column of type
 
672
                      <SAMP
 
673
CLASS="computeroutput"
 
674
>Int8</SAMP
 
675
>.</P
 
676
></DD
 
677
><DT
 
678
><B
 
679
>UInt8Col(dflt=0, shape=1, pos=None,
 
680
                      indexed=0)</B
 
681
></DT
 
682
><DD
 
683
><P
 
684
>Define a column of type
 
685
                      <SAMP
 
686
CLASS="computeroutput"
 
687
>UInt8</SAMP
 
688
>.</P
 
689
></DD
 
690
><DT
 
691
><B
 
692
>Int16Col(dflt=0, shape=1, pos=None, indexed=0)</B
 
693
></DT
 
694
><DD
 
695
><P
 
696
>Define a column of type <SAMP
 
697
CLASS="computeroutput"
 
698
>Int16</SAMP
 
699
>.</P
 
700
></DD
 
701
><DT
 
702
><B
 
703
>UInt16Col(dflt=0, shape=1, pos=None, indexed=0)</B
 
704
></DT
 
705
><DD
 
706
><P
 
707
>Define a column of type <SAMP
 
708
CLASS="computeroutput"
 
709
>UInt16</SAMP
 
710
>.</P
 
711
></DD
 
712
><DT
 
713
><B
 
714
>Int32Col(dflt=0, shape=1, pos=None, indexed=0)</B
 
715
></DT
 
716
><DD
 
717
><P
 
718
>Define a column of type <SAMP
 
719
CLASS="computeroutput"
 
720
>Int32</SAMP
 
721
>.</P
 
722
></DD
 
723
><DT
 
724
><B
 
725
>UInt32Col(dflt=0, shape=1, pos=None, indexed=0)</B
 
726
></DT
 
727
><DD
 
728
><P
 
729
>Define a column of type <SAMP
 
730
CLASS="computeroutput"
 
731
>UInt32</SAMP
 
732
>.</P
 
733
></DD
 
734
><DT
 
735
><B
 
736
>Int64Col(dflt=0, shape=1, pos=None, indexed=0)</B
 
737
></DT
 
738
><DD
 
739
><P
 
740
>Define a column of type <SAMP
 
741
CLASS="computeroutput"
 
742
>Int64</SAMP
 
743
>.</P
 
744
></DD
 
745
><DT
 
746
><B
 
747
>UInt64Col(dflt=0, shape=1, pos=None, indexed=0)</B
 
748
></DT
 
749
><DD
 
750
><P
 
751
>Define a column of type <SAMP
 
752
CLASS="computeroutput"
 
753
>UInt64</SAMP
 
754
>.</P
 
755
></DD
 
756
></DL
 
757
></DIV
 
758
><P
 
759
>&#13;
 
760
                </P
 
761
></DD
 
762
><DT
 
763
><B
 
764
>FloatCol(dflt=0.0, shape=1, itemsize=8, pos=None,
 
765
                  indexed=0)
 
766
                </B
 
767
></DT
 
768
><DD
 
769
><P
 
770
>Define a column to be of type <SAMP
 
771
CLASS="computeroutput"
 
772
>FloatXX</SAMP
 
773
>,
 
774
                  depending on the value of <SAMP
 
775
CLASS="computeroutput"
 
776
>itemsize</SAMP
 
777
>. The
 
778
                  <SAMP
 
779
CLASS="computeroutput"
 
780
>itemsize</SAMP
 
781
> parameter sets the number of bytes
 
782
                  of the floats in the column and the default is 8 bytes
 
783
                  (double precision). The meaning of the other parameters
 
784
                  are the same as those in the <SAMP
 
785
CLASS="computeroutput"
 
786
>Col</SAMP
 
787
> class.
 
788
 
 
789
                  </P
 
790
><P
 
791
>This class has two descendants:
 
792
                  </P
 
793
><P
 
794
>&#13;
 
795
                  </P
 
796
><DIV
 
797
CLASS="glosslist"
 
798
><DL
 
799
><DT
 
800
><B
 
801
>Float32Col(dflt=0.0, shape=1, pos=None,
 
802
                      indexed=0)</B
 
803
></DT
 
804
><DD
 
805
><P
 
806
>Define a column of type
 
807
                      <SAMP
 
808
CLASS="computeroutput"
 
809
>Float32</SAMP
 
810
>.</P
 
811
></DD
 
812
><DT
 
813
><B
 
814
>Float64Col(dflt=0.0, shape=1, pos=None,
 
815
                      indexed=0)</B
 
816
></DT
 
817
><DD
 
818
><P
 
819
>Define a column of type
 
820
                      <SAMP
 
821
CLASS="computeroutput"
 
822
>Float64</SAMP
 
823
>.</P
 
824
></DD
 
825
></DL
 
826
></DIV
 
827
><P
 
828
>&#13;          </P
 
829
></DD
 
830
><DT
 
831
><B
 
832
>ComplexCol(dflt=0.+0.j, shape=1, itemsize=16, pos=None)
 
833
                </B
 
834
></DT
 
835
><DD
 
836
><P
 
837
>Define a column to be of type
 
838
                  <SAMP
 
839
CLASS="computeroutput"
 
840
>ComplexXX</SAMP
 
841
>, depending on the value of
 
842
                  <SAMP
 
843
CLASS="computeroutput"
 
844
>itemsize</SAMP
 
845
>. The <SAMP
 
846
CLASS="computeroutput"
 
847
>itemsize</SAMP
 
848
>
 
849
                  parameter sets the number of bytes of the complex types
 
850
                  in the column and the default is 16 bytes (double
 
851
                  precision complex). The meaning of the other parameters
 
852
                  are the same as those in the <SAMP
 
853
CLASS="computeroutput"
 
854
>Col</SAMP
 
855
> class.
 
856
 
 
857
                  </P
 
858
><P
 
859
>This class has two descendants:
 
860
                  </P
 
861
><P
 
862
>&#13;
 
863
                  </P
 
864
><DIV
 
865
CLASS="glosslist"
 
866
><DL
 
867
><DT
 
868
><B
 
869
>Complex32Col(dflt=0.+0.j, shape=1, pos=None)</B
 
870
></DT
 
871
><DD
 
872
><P
 
873
>Define a column of type <SAMP
 
874
CLASS="computeroutput"
 
875
>Complex32</SAMP
 
876
>.</P
 
877
></DD
 
878
><DT
 
879
><B
 
880
>Float64Col(dflt=0+0.j, shape=1, pos=None)</B
 
881
></DT
 
882
><DD
 
883
><P
 
884
>Define a column of type <SAMP
 
885
CLASS="computeroutput"
 
886
>Complex64</SAMP
 
887
>.</P
 
888
></DD
 
889
></DL
 
890
></DIV
 
891
><P
 
892
>&#13;
 
893
                  </P
 
894
><P
 
895
><SAMP
 
896
CLASS="computeroutput"
 
897
>ComplexCol</SAMP
 
898
> columns and its descendants
 
899
                    do not support indexation.</P
 
900
><P
 
901
>&#13;          </P
 
902
></DD
 
903
><DT
 
904
><B
 
905
>TimeCol(dflt=0, shape=1, itemsize=8, pos=None,
 
906
                  indexed=0)
 
907
                </B
 
908
></DT
 
909
><DD
 
910
><P
 
911
>Define a column to be of type <SPAN
 
912
CLASS="emphasis"
 
913
><I
 
914
CLASS="emphasis"
 
915
>Time</I
 
916
></SPAN
 
917
>.  Two
 
918
                  kinds of time columns are supported depending on the
 
919
                  value of <SAMP
 
920
CLASS="computeroutput"
 
921
>itemsize</SAMP
 
922
>: 4-byte signed integer
 
923
                  and 8-byte double precision floating point columns
 
924
                  (the default ones).  The meaning of the other
 
925
                  parameters are the same as those in the
 
926
                  <SAMP
 
927
CLASS="computeroutput"
 
928
>Col</SAMP
 
929
> class.
 
930
 
 
931
                  </P
 
932
><P
 
933
>Time columns have a special encoding in the HFD5 file.
 
934
                    See <A
 
935
HREF="a6585.html#datatypesSupported"
 
936
>appendix�A</A
 
937
>
 
938
                    for more information on those types.
 
939
                  </P
 
940
><P
 
941
>&#13;
 
942
                  </P
 
943
><P
 
944
>This class has two descendants:
 
945
                  </P
 
946
><P
 
947
>&#13;
 
948
                  </P
 
949
><DIV
 
950
CLASS="glosslist"
 
951
><DL
 
952
><DT
 
953
><B
 
954
>Time32Col(dflt=0, shape=1, pos=None,
 
955
                      indexed=0)</B
 
956
></DT
 
957
><DD
 
958
><P
 
959
>Define a column of type
 
960
                      <SAMP
 
961
CLASS="computeroutput"
 
962
>Time32</SAMP
 
963
>.</P
 
964
></DD
 
965
><DT
 
966
><B
 
967
>Time64Col(dflt=0.0, shape=1, pos=None,
 
968
                      indexed=0)</B
 
969
></DT
 
970
><DD
 
971
><P
 
972
>Define a column of type
 
973
                      <SAMP
 
974
CLASS="computeroutput"
 
975
>Time64</SAMP
 
976
>.</P
 
977
></DD
 
978
></DL
 
979
></DIV
 
980
><P
 
981
>&#13;          </P
 
982
></DD
 
983
><DT
 
984
><B
 
985
>EnumCol(enum, dflt, dtype='UInt32', shape=1, pos=None,
 
986
                  indexed=False)
 
987
                </B
 
988
></DT
 
989
><DD
 
990
><P
 
991
>&#13;            </P
 
992
><P
 
993
>Description of a column of an enumerated type.</P
 
994
><P
 
995
>&#13;
 
996
                  </P
 
997
><P
 
998
>Instances of this class describe a table column which
 
999
                    stores enumerated values.  Those values belong to an
 
1000
                    enumerated type, defined by the first argument
 
1001
                    (<SAMP
 
1002
CLASS="computeroutput"
 
1003
>enum</SAMP
 
1004
>) in the constructor of
 
1005
                    <SAMP
 
1006
CLASS="computeroutput"
 
1007
>EnumCol</SAMP
 
1008
>, which accepts the same kinds of
 
1009
                    arguments as <SAMP
 
1010
CLASS="computeroutput"
 
1011
>Enum</SAMP
 
1012
> (see <A
 
1013
HREF="x4983.html#EnumClassDescr"
 
1014
>4.17.4</A
 
1015
>).  The enumerated type
 
1016
                    is stored in the <SAMP
 
1017
CLASS="computeroutput"
 
1018
>enum</SAMP
 
1019
> attribute of the
 
1020
                    column.
 
1021
                  </P
 
1022
><P
 
1023
>&#13;
 
1024
                  </P
 
1025
><P
 
1026
>A default value must be specified as the second
 
1027
                    argument (<SAMP
 
1028
CLASS="computeroutput"
 
1029
>dflt</SAMP
 
1030
>) in the constructor; it
 
1031
                    must be the <SPAN
 
1032
CLASS="emphasis"
 
1033
><I
 
1034
CLASS="emphasis"
 
1035
>name</I
 
1036
></SPAN
 
1037
> (a string) of one of the
 
1038
                    enumerated values in the enumerated type.  Once the
 
1039
                    column is created, the corresponding concrete value
 
1040
                    is stored in its <SAMP
 
1041
CLASS="computeroutput"
 
1042
>dflt</SAMP
 
1043
> attribute.  If
 
1044
                    the name does not match any value in the enumerated
 
1045
                    type, a <SAMP
 
1046
CLASS="computeroutput"
 
1047
>KeyError</SAMP
 
1048
> is raised.
 
1049
                  </P
 
1050
><P
 
1051
>&#13;
 
1052
                  </P
 
1053
><P
 
1054
>A numarray data type might be specified in order
 
1055
                    to determine the base type used for storing the
 
1056
                    values of enumerated values in memory and disk.
 
1057
                    The data type must be able to represent each and
 
1058
                    every concrete value in the enumeration.  If it is
 
1059
                    not, a <SAMP
 
1060
CLASS="computeroutput"
 
1061
>TypeError</SAMP
 
1062
> is raised.  The
 
1063
                    default base type is unsigned 32-bit integer,
 
1064
                    which is sufficient for most cases.
 
1065
                  </P
 
1066
><P
 
1067
>&#13;
 
1068
                  </P
 
1069
><P
 
1070
>The <SAMP
 
1071
CLASS="computeroutput"
 
1072
>stype</SAMP
 
1073
> attribute of enumerated
 
1074
                    columns is always <SAMP
 
1075
CLASS="computeroutput"
 
1076
>'Enum'</SAMP
 
1077
>, while the
 
1078
                    <SAMP
 
1079
CLASS="computeroutput"
 
1080
>type</SAMP
 
1081
> attribute is the data type used
 
1082
                    for storing concrete values.
 
1083
                  </P
 
1084
><P
 
1085
>&#13;
 
1086
                  </P
 
1087
><P
 
1088
>The shape, position and indexed attributes of the
 
1089
                    column are treated as with other column description
 
1090
                    objects (see <A
 
1091
HREF="x4389.html#ColClassDescr"
 
1092
>4.16.2</A
 
1093
>).
 
1094
                  </P
 
1095
><P
 
1096
>&#13;          </P
 
1097
></DD
 
1098
></DL
 
1099
></DIV
 
1100
></DIV
 
1101
></DIV
 
1102
><DIV
 
1103
CLASS="sect2"
 
1104
><H2
 
1105
CLASS="sect2"
 
1106
><A
 
1107
NAME="subsection4.16.3"
 
1108
>4.16.3. The <SPAN
 
1109
CLASS="markup"
 
1110
>Atom</SPAN
 
1111
> class and its
 
1112
              descendants.</A
 
1113
></H2
 
1114
><A
 
1115
NAME="AtomClassDescr"
 
1116
></A
 
1117
><P
 
1118
>The <SAMP
 
1119
CLASS="computeroutput"
 
1120
>Atom</SAMP
 
1121
> class is a descendant of the
 
1122
              <SAMP
 
1123
CLASS="computeroutput"
 
1124
>Col</SAMP
 
1125
> class (see <A
 
1126
HREF="x4389.html#ColClassDescr"
 
1127
>4.16.2</A
 
1128
>) and is meant to declare the
 
1129
              different properties of the <SPAN
 
1130
CLASS="emphasis"
 
1131
><I
 
1132
CLASS="emphasis"
 
1133
>base element</I
 
1134
></SPAN
 
1135
> (also
 
1136
              known as <SPAN
 
1137
CLASS="emphasis"
 
1138
><I
 
1139
CLASS="emphasis"
 
1140
>atom</I
 
1141
></SPAN
 
1142
>) of <SAMP
 
1143
CLASS="computeroutput"
 
1144
>CArray</SAMP
 
1145
>,
 
1146
              <SAMP
 
1147
CLASS="computeroutput"
 
1148
>EArray</SAMP
 
1149
> and <SAMP
 
1150
CLASS="computeroutput"
 
1151
>VLArray</SAMP
 
1152
> objects. The
 
1153
              <SAMP
 
1154
CLASS="computeroutput"
 
1155
>Atom</SAMP
 
1156
> instances have the property that their
 
1157
              length is always the same. However, you can grow objects
 
1158
              along the extensible dimension in the case of
 
1159
              <SAMP
 
1160
CLASS="computeroutput"
 
1161
>EArray</SAMP
 
1162
> or put a variable number of them on a
 
1163
              <SAMP
 
1164
CLASS="computeroutput"
 
1165
>VLArray</SAMP
 
1166
> row. Moreover, the atoms are not
 
1167
              restricted to scalar values, and they can be fully
 
1168
              multidimensional objects.
 
1169
            </P
 
1170
><P
 
1171
>A series of descendant classes are offered in order to
 
1172
              make the use of these element descriptions easier. In
 
1173
              general, it is recommended to use these descendant
 
1174
              classes, as they are more meaningful when found in the
 
1175
              middle of the code.
 
1176
            </P
 
1177
><DIV
 
1178
CLASS="sect3"
 
1179
><H3
 
1180
CLASS="sect3"
 
1181
><A
 
1182
NAME="subsubsection4.16.3.1"
 
1183
>4.16.3.1. <SPAN
 
1184
CLASS="markup"
 
1185
>Atom</SPAN
 
1186
>
 
1187
                instance variables</A
 
1188
></H3
 
1189
><P
 
1190
>In addition to the variables that it inherits from the
 
1191
                <SAMP
 
1192
CLASS="computeroutput"
 
1193
>Col</SAMP
 
1194
> class, it has the next additional
 
1195
                attributes:</P
 
1196
><DIV
 
1197
CLASS="glosslist"
 
1198
><DL
 
1199
><DT
 
1200
><B
 
1201
>flavor</B
 
1202
></DT
 
1203
><DD
 
1204
><P
 
1205
>The object representation for
 
1206
                  this atom. See below on constructors description for
 
1207
                  <SAMP
 
1208
CLASS="computeroutput"
 
1209
>Atom</SAMP
 
1210
> class the possible values it can
 
1211
                  take.
 
1212
                </P
 
1213
></DD
 
1214
></DL
 
1215
></DIV
 
1216
></DIV
 
1217
><DIV
 
1218
CLASS="sect3"
 
1219
><H3
 
1220
CLASS="sect3"
 
1221
><A
 
1222
NAME="subsubsection4.16.3.2"
 
1223
>4.16.3.2. <SPAN
 
1224
CLASS="markup"
 
1225
>Atom</SPAN
 
1226
>
 
1227
                methods</A
 
1228
></H3
 
1229
><DIV
 
1230
CLASS="glosslist"
 
1231
><DL
 
1232
><DT
 
1233
><B
 
1234
>atomsize()</B
 
1235
></DT
 
1236
><DD
 
1237
><P
 
1238
>Returns the total length,
 
1239
                  in bytes, of the element base atom. If its shape is
 
1240
                  has one zero element on it (for use in
 
1241
                  <SAMP
 
1242
CLASS="computeroutput"
 
1243
>EArrays</SAMP
 
1244
>, for example), this is replaced
 
1245
                  by an one in order to compute the atom size correctly.
 
1246
                </P
 
1247
></DD
 
1248
></DL
 
1249
></DIV
 
1250
></DIV
 
1251
><DIV
 
1252
CLASS="sect3"
 
1253
><H3
 
1254
CLASS="sect3"
 
1255
><A
 
1256
NAME="subsubsection4.16.3.3"
 
1257
>4.16.3.3. <SPAN
 
1258
CLASS="markup"
 
1259
>Atom</SPAN
 
1260
>
 
1261
                constructors</A
 
1262
></H3
 
1263
><P
 
1264
>A description of the different constructors with their
 
1265
                parameters follows:
 
1266
              </P
 
1267
><DIV
 
1268
CLASS="glosslist"
 
1269
><DL
 
1270
><DT
 
1271
><B
 
1272
>Atom(dtype="Float64", shape=1, flavor="numarray")
 
1273
                </B
 
1274
></DT
 
1275
><DD
 
1276
><P
 
1277
>Define properties for the base elements of
 
1278
                  <SAMP
 
1279
CLASS="computeroutput"
 
1280
>CArray</SAMP
 
1281
>, <SAMP
 
1282
CLASS="computeroutput"
 
1283
>EArray</SAMP
 
1284
> and
 
1285
                  <SAMP
 
1286
CLASS="computeroutput"
 
1287
>VLArray</SAMP
 
1288
> objects.
 
1289
                  </P
 
1290
><DIV
 
1291
CLASS="glosslist"
 
1292
><DL
 
1293
><DT
 
1294
><B
 
1295
>dtype</B
 
1296
></DT
 
1297
><DD
 
1298
><P
 
1299
>The data type for the base
 
1300
                      element. See the <A
 
1301
HREF="a6585.html#datatypesSupported"
 
1302
>appendix�A</A
 
1303
> for a
 
1304
                      relation of data types supported. The type
 
1305
                      description is accepted both in string-type format
 
1306
                      and as a numarray data type.
 
1307
                    </P
 
1308
></DD
 
1309
><DT
 
1310
><B
 
1311
>shape</B
 
1312
></DT
 
1313
><DD
 
1314
><P
 
1315
>In a <SAMP
 
1316
CLASS="computeroutput"
 
1317
>EArray</SAMP
 
1318
>
 
1319
                      context, it is a <SPAN
 
1320
CLASS="emphasis"
 
1321
><I
 
1322
CLASS="emphasis"
 
1323
>tuple</I
 
1324
></SPAN
 
1325
>
 
1326
                      specifying the shape of the object, and one (and only
 
1327
                      one) of its dimensions <SPAN
 
1328
CLASS="emphasis"
 
1329
><I
 
1330
CLASS="emphasis"
 
1331
>must</I
 
1332
></SPAN
 
1333
> be 0, meaning that the
 
1334
                      <SAMP
 
1335
CLASS="computeroutput"
 
1336
>EArray</SAMP
 
1337
> object will be enlarged along
 
1338
                      this axis. In the case of a <SAMP
 
1339
CLASS="computeroutput"
 
1340
>VLArray</SAMP
 
1341
>, it
 
1342
                      can be an integer with a value of 1 (one) or a
 
1343
                      tuple, that specifies whether the atom is an scalar
 
1344
                      (in the case of a 1) or has multiple dimensions (in
 
1345
                      the case of a tuple). For 
 
1346
                      <SAMP
 
1347
CLASS="computeroutput"
 
1348
>CharType</SAMP
 
1349
> elements, the last dimension
 
1350
                      is used as the length of the character
 
1351
                      strings. However, for this kind of objects, the use
 
1352
                      of <SAMP
 
1353
CLASS="computeroutput"
 
1354
>StringAtom</SAMP
 
1355
> subclass is strongly
 
1356
                      recommended.
 
1357
                    </P
 
1358
></DD
 
1359
><DT
 
1360
><B
 
1361
>flavor</B
 
1362
></DT
 
1363
><DD
 
1364
><P
 
1365
>The object
 
1366
                      representation for this atom. It can be any of
 
1367
                      <SPAN
 
1368
CLASS="emphasis"
 
1369
><I
 
1370
CLASS="emphasis"
 
1371
>"numarray"</I
 
1372
></SPAN
 
1373
>, <SPAN
 
1374
CLASS="emphasis"
 
1375
><I
 
1376
CLASS="emphasis"
 
1377
>"numpy"</I
 
1378
></SPAN
 
1379
> or
 
1380
                      <SPAN
 
1381
CLASS="emphasis"
 
1382
><I
 
1383
CLASS="emphasis"
 
1384
>"python"</I
 
1385
></SPAN
 
1386
> for the character types and
 
1387
                      <SPAN
 
1388
CLASS="emphasis"
 
1389
><I
 
1390
CLASS="emphasis"
 
1391
>"numarray"</I
 
1392
></SPAN
 
1393
>, <SPAN
 
1394
CLASS="emphasis"
 
1395
><I
 
1396
CLASS="emphasis"
 
1397
>"numpy"</I
 
1398
></SPAN
 
1399
>,
 
1400
                      <SPAN
 
1401
CLASS="emphasis"
 
1402
><I
 
1403
CLASS="emphasis"
 
1404
>"numeric"</I
 
1405
></SPAN
 
1406
> or <SPAN
 
1407
CLASS="emphasis"
 
1408
><I
 
1409
CLASS="emphasis"
 
1410
>"python"</I
 
1411
></SPAN
 
1412
> for the
 
1413
                      numerical types. If specified, the read atoms
 
1414
                      will be converted to that specific flavor. If
 
1415
                      not specified, the atoms will remain in their
 
1416
                      native format (i.e. <SAMP
 
1417
CLASS="computeroutput"
 
1418
>numarray</SAMP
 
1419
>).
 
1420
                    </P
 
1421
></DD
 
1422
></DL
 
1423
></DIV
 
1424
><P
 
1425
>&#13;
 
1426
                </P
 
1427
></DD
 
1428
><DT
 
1429
><B
 
1430
>StringAtom(shape=1, length=None,
 
1431
                  flavor="numarray")</B
 
1432
></DT
 
1433
><DD
 
1434
><P
 
1435
>Define an atom to be
 
1436
                  of <SAMP
 
1437
CLASS="computeroutput"
 
1438
>CharType</SAMP
 
1439
> type. The meaning of the
 
1440
                  <SPAN
 
1441
CLASS="emphasis"
 
1442
><I
 
1443
CLASS="emphasis"
 
1444
>shape</I
 
1445
></SPAN
 
1446
> parameter is the same as in the
 
1447
                  <SAMP
 
1448
CLASS="computeroutput"
 
1449
>Atom</SAMP
 
1450
> class. <SPAN
 
1451
CLASS="emphasis"
 
1452
><I
 
1453
CLASS="emphasis"
 
1454
>length</I
 
1455
></SPAN
 
1456
> sets the
 
1457
                  length of the strings atoms. <SPAN
 
1458
CLASS="emphasis"
 
1459
><I
 
1460
CLASS="emphasis"
 
1461
>flavor</I
 
1462
></SPAN
 
1463
> can be
 
1464
                  whether <SAMP
 
1465
CLASS="computeroutput"
 
1466
>"numarray"</SAMP
 
1467
>,
 
1468
                  <SAMP
 
1469
CLASS="computeroutput"
 
1470
>"numpy"</SAMP
 
1471
> or
 
1472
                  <SAMP
 
1473
CLASS="computeroutput"
 
1474
>"python"</SAMP
 
1475
>. Unicode strings are not
 
1476
                  supported by this type; see the
 
1477
                  <SAMP
 
1478
CLASS="computeroutput"
 
1479
>VLStringAtom</SAMP
 
1480
> class if you want Unicode
 
1481
                  support (only available for <SAMP
 
1482
CLASS="computeroutput"
 
1483
>VLAtom</SAMP
 
1484
>
 
1485
                  objects).
 
1486
                </P
 
1487
></DD
 
1488
><DT
 
1489
><B
 
1490
>BoolAtom(shape=1, flavor="numarray") </B
 
1491
></DT
 
1492
><DD
 
1493
><P
 
1494
>Define an atom to be of type <SAMP
 
1495
CLASS="computeroutput"
 
1496
>Bool</SAMP
 
1497
>.
 
1498
                  The meaning of the parameters are the same of those in
 
1499
                  the <SAMP
 
1500
CLASS="computeroutput"
 
1501
>Atom</SAMP
 
1502
> class.
 
1503
                </P
 
1504
></DD
 
1505
><DT
 
1506
><B
 
1507
>IntAtom(shape=1, itemsize=4, sign=1,
 
1508
                  flavor="numarray") </B
 
1509
></DT
 
1510
><DD
 
1511
><P
 
1512
>Define an atom to be of
 
1513
                  type <SAMP
 
1514
CLASS="computeroutput"
 
1515
>IntXX</SAMP
 
1516
>, depending on the value of
 
1517
                  <SPAN
 
1518
CLASS="emphasis"
 
1519
><I
 
1520
CLASS="emphasis"
 
1521
>itemsize</I
 
1522
></SPAN
 
1523
> parameter, that sets the number of
 
1524
                  bytes of the integers that conform the
 
1525
                  atom. <SPAN
 
1526
CLASS="emphasis"
 
1527
><I
 
1528
CLASS="emphasis"
 
1529
>sign</I
 
1530
></SPAN
 
1531
> determines whether the integers are
 
1532
                  signed or not. The meaning of the other parameters are
 
1533
                  the same of those in the <SAMP
 
1534
CLASS="computeroutput"
 
1535
>Atom</SAMP
 
1536
> class.
 
1537
 
 
1538
                  </P
 
1539
><P
 
1540
>This class has several descendants:
 
1541
                  </P
 
1542
><P
 
1543
>&#13;
 
1544
                  </P
 
1545
><DIV
 
1546
CLASS="glosslist"
 
1547
><DL
 
1548
><DT
 
1549
><B
 
1550
>Int8Atom(shape=1, flavor="numarray")</B
 
1551
></DT
 
1552
><DD
 
1553
><P
 
1554
>Define an atom of type <SAMP
 
1555
CLASS="computeroutput"
 
1556
>Int8</SAMP
 
1557
>.</P
 
1558
></DD
 
1559
><DT
 
1560
><B
 
1561
>UInt8Atom(shape=1, flavor="numarray")</B
 
1562
></DT
 
1563
><DD
 
1564
><P
 
1565
>Define an atom of type <SAMP
 
1566
CLASS="computeroutput"
 
1567
>UInt8</SAMP
 
1568
>.</P
 
1569
></DD
 
1570
><DT
 
1571
><B
 
1572
>Int16Atom(shape=1, flavor="numarray")</B
 
1573
></DT
 
1574
><DD
 
1575
><P
 
1576
>Define an atom of type <SAMP
 
1577
CLASS="computeroutput"
 
1578
>Int16</SAMP
 
1579
>.</P
 
1580
></DD
 
1581
><DT
 
1582
><B
 
1583
>UInt16Atom(shape=1, flavor="numarray")</B
 
1584
></DT
 
1585
><DD
 
1586
><P
 
1587
>Define an atom of type <SAMP
 
1588
CLASS="computeroutput"
 
1589
>UInt16</SAMP
 
1590
>.</P
 
1591
></DD
 
1592
><DT
 
1593
><B
 
1594
>Int32Atom(shape=1, flavor="numarray")</B
 
1595
></DT
 
1596
><DD
 
1597
><P
 
1598
>Define an atom of type <SAMP
 
1599
CLASS="computeroutput"
 
1600
>Int32</SAMP
 
1601
>.</P
 
1602
></DD
 
1603
><DT
 
1604
><B
 
1605
>UInt32Atom(shape=1, flavor="numarray")</B
 
1606
></DT
 
1607
><DD
 
1608
><P
 
1609
>Define an atom of type <SAMP
 
1610
CLASS="computeroutput"
 
1611
>UInt32</SAMP
 
1612
>.</P
 
1613
></DD
 
1614
><DT
 
1615
><B
 
1616
>Int64Atom(shape=1, flavor="numarray")</B
 
1617
></DT
 
1618
><DD
 
1619
><P
 
1620
>Define an atom of type <SAMP
 
1621
CLASS="computeroutput"
 
1622
>Int64</SAMP
 
1623
>.</P
 
1624
></DD
 
1625
><DT
 
1626
><B
 
1627
>UInt64Atom(shape=1, flavor="numarray")</B
 
1628
></DT
 
1629
><DD
 
1630
><P
 
1631
>Define an atom of type <SAMP
 
1632
CLASS="computeroutput"
 
1633
>UInt64</SAMP
 
1634
>.</P
 
1635
></DD
 
1636
></DL
 
1637
></DIV
 
1638
><P
 
1639
>&#13;
 
1640
                </P
 
1641
></DD
 
1642
><DT
 
1643
><B
 
1644
>FloatAtom(shape=1, itemsize=8, flavor="numarray")
 
1645
                </B
 
1646
></DT
 
1647
><DD
 
1648
><P
 
1649
>Define an atom to be of <SAMP
 
1650
CLASS="computeroutput"
 
1651
>FloatXX</SAMP
 
1652
>
 
1653
                  type, depending on the value of <SAMP
 
1654
CLASS="computeroutput"
 
1655
>itemsize</SAMP
 
1656
>. The
 
1657
                  <SAMP
 
1658
CLASS="computeroutput"
 
1659
>itemsize</SAMP
 
1660
> parameter sets the number of bytes
 
1661
                  of the floats in the atom and the default is 8 bytes
 
1662
                  (double precision). The meaning of the other parameters
 
1663
                  are the same as those in the <SAMP
 
1664
CLASS="computeroutput"
 
1665
>Atom</SAMP
 
1666
> class.
 
1667
 
 
1668
                  </P
 
1669
><P
 
1670
>This class has two descendants:
 
1671
                  </P
 
1672
><P
 
1673
>&#13;
 
1674
                  </P
 
1675
><DIV
 
1676
CLASS="glosslist"
 
1677
><DL
 
1678
><DT
 
1679
><B
 
1680
>Float32Atom(shape=1, flavor="numarray")</B
 
1681
></DT
 
1682
><DD
 
1683
><P
 
1684
>Define an atom of type <SAMP
 
1685
CLASS="computeroutput"
 
1686
>Float32</SAMP
 
1687
>.</P
 
1688
></DD
 
1689
><DT
 
1690
><B
 
1691
>Float64Atom(shape=1, flavor="numarray")</B
 
1692
></DT
 
1693
><DD
 
1694
><P
 
1695
>Define an atom of type <SAMP
 
1696
CLASS="computeroutput"
 
1697
>Float64</SAMP
 
1698
>.</P
 
1699
></DD
 
1700
></DL
 
1701
></DIV
 
1702
><P
 
1703
>&#13;          </P
 
1704
></DD
 
1705
><DT
 
1706
><B
 
1707
>ComplexAtom(shape=1, itemsize=16, flavor="numarray")
 
1708
                </B
 
1709
></DT
 
1710
><DD
 
1711
><P
 
1712
>Define an atom to be of <SAMP
 
1713
CLASS="computeroutput"
 
1714
>ComplexXX</SAMP
 
1715
> type,
 
1716
                  depending on the value of <SAMP
 
1717
CLASS="computeroutput"
 
1718
>itemsize</SAMP
 
1719
>. The
 
1720
                  <SAMP
 
1721
CLASS="computeroutput"
 
1722
>itemsize</SAMP
 
1723
> parameter sets the number of bytes
 
1724
                  of the floats in the atom and the default is 16 bytes
 
1725
                  (double precision complex). The meaning of the other
 
1726
                  parameters are the same as those in the
 
1727
                  <SAMP
 
1728
CLASS="computeroutput"
 
1729
>Atom</SAMP
 
1730
> class.
 
1731
 
 
1732
                  </P
 
1733
><P
 
1734
>This class has two descendants:
 
1735
                  </P
 
1736
><P
 
1737
>&#13;
 
1738
                  </P
 
1739
><DIV
 
1740
CLASS="glosslist"
 
1741
><DL
 
1742
><DT
 
1743
><B
 
1744
>Complex32Atom(shape=1, flavor="numarray")</B
 
1745
></DT
 
1746
><DD
 
1747
><P
 
1748
>Define an atom of type <SAMP
 
1749
CLASS="computeroutput"
 
1750
>Complex32</SAMP
 
1751
>.</P
 
1752
></DD
 
1753
><DT
 
1754
><B
 
1755
>Complex64Atom(shape=1, flavor="numarray")</B
 
1756
></DT
 
1757
><DD
 
1758
><P
 
1759
>Define an atom of type <SAMP
 
1760
CLASS="computeroutput"
 
1761
>Complex64</SAMP
 
1762
>.</P
 
1763
></DD
 
1764
></DL
 
1765
></DIV
 
1766
><P
 
1767
>&#13;          </P
 
1768
></DD
 
1769
><DT
 
1770
><B
 
1771
>TimeAtom(shape=1, itemsize=8, flavor="numarray")
 
1772
                </B
 
1773
></DT
 
1774
><DD
 
1775
><P
 
1776
>Define an atom to be of type <SPAN
 
1777
CLASS="emphasis"
 
1778
><I
 
1779
CLASS="emphasis"
 
1780
>Time</I
 
1781
></SPAN
 
1782
>.  Two
 
1783
                  kinds of time atoms are supported depending on the
 
1784
                  value of <SAMP
 
1785
CLASS="computeroutput"
 
1786
>itemsize</SAMP
 
1787
>: 4-byte signed integer
 
1788
                  and 8-byte double precision floating point atoms (the
 
1789
                  default ones).  The meaning of the other parameters
 
1790
                  are the same as those in the <SAMP
 
1791
CLASS="computeroutput"
 
1792
>Atom</SAMP
 
1793
> class.
 
1794
 
 
1795
                  </P
 
1796
><P
 
1797
>Time atoms have a special encoding in the HFD5 file.
 
1798
                    See <A
 
1799
HREF="a6585.html#datatypesSupported"
 
1800
>appendix�A</A
 
1801
>
 
1802
                    for more information on those types.
 
1803
                  </P
 
1804
><P
 
1805
>&#13;
 
1806
                  </P
 
1807
><P
 
1808
>This class has two descendants:
 
1809
                  </P
 
1810
><P
 
1811
>&#13;
 
1812
                  </P
 
1813
><DIV
 
1814
CLASS="glosslist"
 
1815
><DL
 
1816
><DT
 
1817
><B
 
1818
>Time32Atom(shape=1, flavor="numarray")</B
 
1819
></DT
 
1820
><DD
 
1821
><P
 
1822
>Define an atom of type <SAMP
 
1823
CLASS="computeroutput"
 
1824
>Time32</SAMP
 
1825
>.</P
 
1826
></DD
 
1827
><DT
 
1828
><B
 
1829
>Time64Atom(shape=1, flavor="numarray")</B
 
1830
></DT
 
1831
><DD
 
1832
><P
 
1833
>Define an atom of type <SAMP
 
1834
CLASS="computeroutput"
 
1835
>Time64</SAMP
 
1836
>.</P
 
1837
></DD
 
1838
></DL
 
1839
></DIV
 
1840
><P
 
1841
>&#13;          </P
 
1842
></DD
 
1843
><DT
 
1844
><B
 
1845
>EnumAtom(enum, dtype='UInt32', shape=1,
 
1846
                  flavor='numarray')</B
 
1847
></DT
 
1848
><DD
 
1849
><P
 
1850
>&#13;            </P
 
1851
><P
 
1852
>Description of an atom of an enumerated type.</P
 
1853
><P
 
1854
>&#13;
 
1855
                  </P
 
1856
><P
 
1857
>Instances of this class describe the atom type used
 
1858
                    by an array to store enumerated values.  Those
 
1859
                    values belong to an enumerated type.
 
1860
                  </P
 
1861
><P
 
1862
>&#13;
 
1863
                  </P
 
1864
><P
 
1865
>The meaning of the <SAMP
 
1866
CLASS="computeroutput"
 
1867
>enum</SAMP
 
1868
> and
 
1869
                    <SAMP
 
1870
CLASS="computeroutput"
 
1871
>dtype</SAMP
 
1872
> arguments is the same as in
 
1873
                    <SAMP
 
1874
CLASS="computeroutput"
 
1875
>EnumCol</SAMP
 
1876
> (see <A
 
1877
HREF="x4389.html#ColClassDescr"
 
1878
>4.16.2</A
 
1879
>).  The
 
1880
                    <SAMP
 
1881
CLASS="computeroutput"
 
1882
>shape</SAMP
 
1883
> and <SAMP
 
1884
CLASS="computeroutput"
 
1885
>flavor</SAMP
 
1886
> arguments
 
1887
                    have the usual meaning of other <SAMP
 
1888
CLASS="computeroutput"
 
1889
>Atom</SAMP
 
1890
>
 
1891
                    classes (the <SAMP
 
1892
CLASS="computeroutput"
 
1893
>flavor</SAMP
 
1894
> applies to the
 
1895
                    representation of concrete read values).
 
1896
                  </P
 
1897
><P
 
1898
>&#13;
 
1899
                  </P
 
1900
><P
 
1901
>Enumerated atoms also have <SAMP
 
1902
CLASS="computeroutput"
 
1903
>stype</SAMP
 
1904
> and
 
1905
                    <SAMP
 
1906
CLASS="computeroutput"
 
1907
>type</SAMP
 
1908
> attributes with the same values as
 
1909
                    in <SAMP
 
1910
CLASS="computeroutput"
 
1911
>EnumCol</SAMP
 
1912
>.
 
1913
                  </P
 
1914
><P
 
1915
>&#13;          </P
 
1916
></DD
 
1917
></DL
 
1918
></DIV
 
1919
><P
 
1920
>Now, there come two special classes,
 
1921
                <SAMP
 
1922
CLASS="computeroutput"
 
1923
>ObjectAtom</SAMP
 
1924
> and <SAMP
 
1925
CLASS="computeroutput"
 
1926
>VLString</SAMP
 
1927
>, that
 
1928
                actually do not descend from <SAMP
 
1929
CLASS="computeroutput"
 
1930
>Atom</SAMP
 
1931
>, but
 
1932
                which goal is so similar that they should be described
 
1933
                here. The difference between them and the
 
1934
                <SAMP
 
1935
CLASS="computeroutput"
 
1936
>Atom</SAMP
 
1937
> and descendants classes is that these
 
1938
                special classes does not allow multidimensional atoms,
 
1939
                nor multiple values per row. A <SPAN
 
1940
CLASS="emphasis"
 
1941
><I
 
1942
CLASS="emphasis"
 
1943
>flavor</I
 
1944
></SPAN
 
1945
> can not
 
1946
                be specified neither as it is immutable (see below).
 
1947
              </P
 
1948
><P
 
1949
><SPAN
 
1950
CLASS="emphasis"
 
1951
><I
 
1952
CLASS="emphasis"
 
1953
>Caveat emptor:</I
 
1954
></SPAN
 
1955
> You are
 
1956
                only allowed to use these classes to create
 
1957
                <SAMP
 
1958
CLASS="computeroutput"
 
1959
>VLArray</SAMP
 
1960
> objects, not <SAMP
 
1961
CLASS="computeroutput"
 
1962
>CArray</SAMP
 
1963
>
 
1964
                and <SAMP
 
1965
CLASS="computeroutput"
 
1966
>EArray</SAMP
 
1967
> objects.
 
1968
              </P
 
1969
><DIV
 
1970
CLASS="glosslist"
 
1971
><DL
 
1972
><DT
 
1973
><B
 
1974
>ObjectAtom()</B
 
1975
></DT
 
1976
><DD
 
1977
><P
 
1978
>This class is meant to
 
1979
                  fit <SPAN
 
1980
CLASS="emphasis"
 
1981
><I
 
1982
CLASS="emphasis"
 
1983
>any</I
 
1984
></SPAN
 
1985
> kind of object in a row of an
 
1986
                  <SAMP
 
1987
CLASS="computeroutput"
 
1988
>VLArray</SAMP
 
1989
> instance by using
 
1990
                  <SAMP
 
1991
CLASS="computeroutput"
 
1992
>cPickle</SAMP
 
1993
> behind the scenes. Due to the
 
1994
                  fact that you can not foresee how long will be the
 
1995
                  output of the <SAMP
 
1996
CLASS="computeroutput"
 
1997
>cPickle</SAMP
 
1998
> serialization
 
1999
                  (i.e. the atom already has a <SPAN
 
2000
CLASS="emphasis"
 
2001
><I
 
2002
CLASS="emphasis"
 
2003
>variable</I
 
2004
></SPAN
 
2005
>
 
2006
                  length), you can only fit a representant of it per
 
2007
                  row. However, you can still pass several parameters to
 
2008
                  the <SAMP
 
2009
CLASS="computeroutput"
 
2010
>VLArray.append()</SAMP
 
2011
> method as they will
 
2012
                  be regarded as a <SPAN
 
2013
CLASS="emphasis"
 
2014
><I
 
2015
CLASS="emphasis"
 
2016
>tuple</I
 
2017
></SPAN
 
2018
> of compound objects
 
2019
                  (the parameters), so that we still have only one
 
2020
                  object to be saved in a single row. It does not accept
 
2021
                  parameters and its flavor is automatically set to
 
2022
                  <SAMP
 
2023
CLASS="computeroutput"
 
2024
>"Object"</SAMP
 
2025
>, so the reads of rows always
 
2026
                  returns an arbitrary python object.
 
2027
 
 
2028
                  You can regard <SAMP
 
2029
CLASS="computeroutput"
 
2030
>ObjectAtom</SAMP
 
2031
> types as an
 
2032
                  easy way to save an arbitrary number of generic python
 
2033
                  objects in a <SAMP
 
2034
CLASS="computeroutput"
 
2035
>VLArray</SAMP
 
2036
> object.
 
2037
                </P
 
2038
></DD
 
2039
><DT
 
2040
><B
 
2041
>VLStringAtom()</B
 
2042
></DT
 
2043
><DD
 
2044
><P
 
2045
>This class describes a
 
2046
                  <SPAN
 
2047
CLASS="emphasis"
 
2048
><I
 
2049
CLASS="emphasis"
 
2050
>row</I
 
2051
></SPAN
 
2052
> of the <SAMP
 
2053
CLASS="computeroutput"
 
2054
>VLArray</SAMP
 
2055
> class, rather
 
2056
                  than an <SPAN
 
2057
CLASS="emphasis"
 
2058
><I
 
2059
CLASS="emphasis"
 
2060
>atom</I
 
2061
></SPAN
 
2062
>. It differs from the
 
2063
                  <SAMP
 
2064
CLASS="computeroutput"
 
2065
>StringAtom</SAMP
 
2066
> class in that you can only add
 
2067
                  one instance of it to one specific row, i.e. the
 
2068
                  <SAMP
 
2069
CLASS="computeroutput"
 
2070
>VLArray.append()</SAMP
 
2071
> method only accepts one
 
2072
                  object when the base atom is of this type. Besides, it
 
2073
                  supports Unicode strings (contrarily to
 
2074
                  <SAMP
 
2075
CLASS="computeroutput"
 
2076
>StringAtom</SAMP
 
2077
>) because it uses the UTF-8
 
2078
                  codification (this is why its <SAMP
 
2079
CLASS="computeroutput"
 
2080
>atomsize()</SAMP
 
2081
>
 
2082
                  method returns always 1) when serializing to disk. It
 
2083
                  does not accept any parameter and because its
 
2084
                  <SPAN
 
2085
CLASS="emphasis"
 
2086
><I
 
2087
CLASS="emphasis"
 
2088
>flavor</I
 
2089
></SPAN
 
2090
> is automatically set to
 
2091
                  <SAMP
 
2092
CLASS="computeroutput"
 
2093
>"VLString"</SAMP
 
2094
>, the reads of rows always
 
2095
                  returns a python string. See the <A
 
2096
HREF="x7045.html#VLArrayFormatDescr"
 
2097
>appendix�D.3.5</A
 
2098
> if you are
 
2099
                  curious on how this is implemented at the low-level.
 
2100
 
 
2101
                  You can regard <SAMP
 
2102
CLASS="computeroutput"
 
2103
>VLStringAtom</SAMP
 
2104
> types as an
 
2105
                  easy way to save generic variable length strings.
 
2106
                </P
 
2107
></DD
 
2108
></DL
 
2109
></DIV
 
2110
><P
 
2111
>See <SAMP
 
2112
CLASS="computeroutput"
 
2113
>examples/vlarray1.py</SAMP
 
2114
> and
 
2115
                <SAMP
 
2116
CLASS="computeroutput"
 
2117
>examples/vlarray2.py</SAMP
 
2118
> for further examples
 
2119
                on <SAMP
 
2120
CLASS="computeroutput"
 
2121
>VLArray</SAMP
 
2122
>s, including object serialization
 
2123
                and Unicode string management.
 
2124
              </P
 
2125
></DIV
 
2126
></DIV
 
2127
></DIV
 
2128
><DIV
 
2129
CLASS="NAVFOOTER"
 
2130
><HR
 
2131
ALIGN="LEFT"
 
2132
WIDTH="100%"><TABLE
 
2133
SUMMARY="Footer navigation table"
 
2134
WIDTH="100%"
 
2135
BORDER="0"
 
2136
CELLPADDING="0"
 
2137
CELLSPACING="0"
 
2138
><TR
 
2139
><TD
 
2140
WIDTH="33%"
 
2141
ALIGN="left"
 
2142
VALIGN="top"
 
2143
><A
 
2144
HREF="x4306.html"
 
2145
ACCESSKEY="P"
 
2146
>Prev</A
 
2147
></TD
 
2148
><TD
 
2149
WIDTH="34%"
 
2150
ALIGN="center"
 
2151
VALIGN="top"
 
2152
><A
 
2153
HREF="index.html"
 
2154
ACCESSKEY="H"
 
2155
>Home</A
 
2156
></TD
 
2157
><TD
 
2158
WIDTH="33%"
 
2159
ALIGN="right"
 
2160
VALIGN="top"
 
2161
><A
 
2162
HREF="x4983.html"
 
2163
ACCESSKEY="N"
 
2164
>Next</A
 
2165
></TD
 
2166
></TR
 
2167
><TR
 
2168
><TD
 
2169
WIDTH="33%"
 
2170
ALIGN="left"
 
2171
VALIGN="top"
 
2172
>The <SPAN
 
2173
CLASS="markup"
 
2174
>AttributeSet</SPAN
 
2175
>
 
2176
            class</TD
 
2177
><TD
 
2178
WIDTH="34%"
 
2179
ALIGN="center"
 
2180
VALIGN="top"
 
2181
><A
 
2182
HREF="c1381.html"
 
2183
ACCESSKEY="U"
 
2184
>Up</A
 
2185
></TD
 
2186
><TD
 
2187
WIDTH="33%"
 
2188
ALIGN="right"
 
2189
VALIGN="top"
 
2190
>Helper classes</TD
 
2191
></TR
 
2192
></TABLE
 
2193
></DIV
 
2194
></BODY
 
2195
></HTML
 
2196
>
 
 
b'\\ No newline at end of file'