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

« back to all changes in this revision

Viewing changes to doc/html/x1533.html

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2006-06-28 10:45:03 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20060628104503-cc251q5o5j3e2k10
  * 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
>The File class</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REL="HOME"
 
10
TITLE="PyTables User's Guide"
 
11
HREF="index.html"><LINK
 
12
REL="UP"
 
13
TITLE="Library Reference"
 
14
HREF="c1381.html"><LINK
 
15
REL="PREVIOUS"
 
16
TITLE="Library Reference"
 
17
HREF="c1381.html"><LINK
 
18
REL="NEXT"
 
19
TITLE="The Node class"
 
20
HREF="x2341.html"></HEAD
 
21
><BODY
 
22
CLASS="sect1"
 
23
BGCOLOR="#FFFFFF"
 
24
TEXT="#000000"
 
25
LINK="#0000FF"
 
26
VLINK="#840084"
 
27
ALINK="#0000FF"
 
28
><DIV
 
29
CLASS="NAVHEADER"
 
30
><TABLE
 
31
SUMMARY="Header navigation table"
 
32
WIDTH="100%"
 
33
BORDER="0"
 
34
CELLPADDING="0"
 
35
CELLSPACING="0"
 
36
><TR
 
37
><TH
 
38
COLSPAN="3"
 
39
ALIGN="center"
 
40
><SPAN
 
41
CLASS="markup"
 
42
>PyTables</SPAN
 
43
> User's Guide: Hierarchical datasets in Python - Release 1.3.2</TH
 
44
></TR
 
45
><TR
 
46
><TD
 
47
WIDTH="10%"
 
48
ALIGN="left"
 
49
VALIGN="bottom"
 
50
><A
 
51
HREF="c1381.html"
 
52
ACCESSKEY="P"
 
53
>Prev</A
 
54
></TD
 
55
><TD
 
56
WIDTH="80%"
 
57
ALIGN="center"
 
58
VALIGN="bottom"
 
59
>Chapter 4. Library Reference</TD
 
60
><TD
 
61
WIDTH="10%"
 
62
ALIGN="right"
 
63
VALIGN="bottom"
 
64
><A
 
65
HREF="x2341.html"
 
66
ACCESSKEY="N"
 
67
>Next</A
 
68
></TD
 
69
></TR
 
70
></TABLE
 
71
><HR
 
72
ALIGN="LEFT"
 
73
WIDTH="100%"></DIV
 
74
><DIV
 
75
CLASS="sect1"
 
76
><H1
 
77
CLASS="sect1"
 
78
><A
 
79
NAME="section4.2"
 
80
>4.2. The <SPAN
 
81
CLASS="markup"
 
82
>File</SPAN
 
83
> class</A
 
84
></H1
 
85
><A
 
86
NAME="FileClassDescr"
 
87
></A
 
88
><P
 
89
>An instance of this class is returned when a PyTables file
 
90
          is opened with the <SAMP
 
91
CLASS="computeroutput"
 
92
>openFile()</SAMP
 
93
> function.
 
94
          It offers methods to manipulate (create, rename, delete...) nodes
 
95
          and handle their attributes,
 
96
          as well as methods to traverse the object tree.
 
97
          The <SPAN
 
98
CLASS="emphasis"
 
99
><I
 
100
CLASS="emphasis"
 
101
>user entry point</I
 
102
></SPAN
 
103
> to the object tree attached to the HDF5 file
 
104
          is represented in the <SAMP
 
105
CLASS="computeroutput"
 
106
>rootUEP</SAMP
 
107
> attribute.
 
108
          Other attributes are available.
 
109
        </P
 
110
><P
 
111
><SAMP
 
112
CLASS="computeroutput"
 
113
>File</SAMP
 
114
> objects support an <SPAN
 
115
CLASS="emphasis"
 
116
><I
 
117
CLASS="emphasis"
 
118
>Undo/Redo mechanism</I
 
119
></SPAN
 
120
>
 
121
          which can be enabled with the <SAMP
 
122
CLASS="computeroutput"
 
123
>enableUndo()</SAMP
 
124
> method.
 
125
          Once the Undo/Redo mechanism is enabled,
 
126
          explicit <SPAN
 
127
CLASS="emphasis"
 
128
><I
 
129
CLASS="emphasis"
 
130
>marks</I
 
131
></SPAN
 
132
> (with an optional unique name) can be set
 
133
          on the state of the database using the <SAMP
 
134
CLASS="computeroutput"
 
135
>mark()</SAMP
 
136
> method.
 
137
          There are two implicit marks which are always available:
 
138
          the initial mark (0) and the final mark (-1).
 
139
          Both the identifier of a mark and its name can be used
 
140
          in <SPAN
 
141
CLASS="emphasis"
 
142
><I
 
143
CLASS="emphasis"
 
144
>undo</I
 
145
></SPAN
 
146
> and <SPAN
 
147
CLASS="emphasis"
 
148
><I
 
149
CLASS="emphasis"
 
150
>redo</I
 
151
></SPAN
 
152
> operations.
 
153
        </P
 
154
><P
 
155
>Hierarchy manipulation operations (node creation, movement
 
156
          and removal) and attribute handling operations (setting and
 
157
          deleting) made after a mark can be undone by using the
 
158
          <SAMP
 
159
CLASS="computeroutput"
 
160
>undo()</SAMP
 
161
> method, which returns the database to
 
162
          the state of a past mark.  If <SAMP
 
163
CLASS="computeroutput"
 
164
>undo()</SAMP
 
165
> is not
 
166
          followed by operations that modify the hierarchy or
 
167
          attributes, the <SAMP
 
168
CLASS="computeroutput"
 
169
>redo()</SAMP
 
170
> method can be used to
 
171
          return the database to the state of a future mark.  Else,
 
172
          future states of the database are forgotten.
 
173
        </P
 
174
><P
 
175
>Note that data handling operations can not be undone nor
 
176
          redone by now.  Also, hierarchy manipulation operations on
 
177
          nodes that do not support the Undo/Redo mechanism issue an
 
178
          <SAMP
 
179
CLASS="computeroutput"
 
180
>UndoRedoWarning</SAMP
 
181
> <SPAN
 
182
CLASS="emphasis"
 
183
><I
 
184
CLASS="emphasis"
 
185
>before</I
 
186
></SPAN
 
187
> changing the
 
188
          database.
 
189
        </P
 
190
><P
 
191
>The Undo/Redo mechanism is persistent between sessions and
 
192
          can only be disabled by calling the
 
193
          <SAMP
 
194
CLASS="computeroutput"
 
195
>disableUndo()</SAMP
 
196
> method.
 
197
        </P
 
198
><DIV
 
199
CLASS="sect2"
 
200
><H2
 
201
CLASS="sect2"
 
202
><A
 
203
NAME="subsection4.2.1"
 
204
>4.2.1. <SPAN
 
205
CLASS="markup"
 
206
>File</SPAN
 
207
> instance
 
208
            variables</A
 
209
></H2
 
210
><DIV
 
211
CLASS="glosslist"
 
212
><DL
 
213
><DT
 
214
><B
 
215
>&#13;        filename
 
216
            </B
 
217
></DT
 
218
><DD
 
219
><P
 
220
>The name of the opened file.</P
 
221
></DD
 
222
><DT
 
223
><B
 
224
>&#13;        format_version
 
225
            </B
 
226
></DT
 
227
><DD
 
228
><P
 
229
>The PyTables version number of this file.</P
 
230
></DD
 
231
><DT
 
232
><B
 
233
>&#13;        isopen
 
234
            </B
 
235
></DT
 
236
><DD
 
237
><P
 
238
>True if the underlying file is open, false otherwise.</P
 
239
></DD
 
240
><DT
 
241
><B
 
242
>&#13;        mode
 
243
            </B
 
244
></DT
 
245
><DD
 
246
><P
 
247
>The mode in which the file was opened.</P
 
248
></DD
 
249
><DT
 
250
><B
 
251
>&#13;        title
 
252
            </B
 
253
></DT
 
254
><DD
 
255
><P
 
256
>The title of the root group in the file.</P
 
257
></DD
 
258
><DT
 
259
><B
 
260
>&#13;        trMap
 
261
            </B
 
262
></DT
 
263
><DD
 
264
><P
 
265
>A dictionary that maps node names
 
266
              between PyTables and HDF5 domain names.
 
267
              Its initial values are set from the <SAMP
 
268
CLASS="computeroutput"
 
269
>trMap</SAMP
 
270
> parameter
 
271
              passed to the <SAMP
 
272
CLASS="computeroutput"
 
273
>openFile</SAMP
 
274
> function.
 
275
              You can change its contents <SPAN
 
276
CLASS="emphasis"
 
277
><I
 
278
CLASS="emphasis"
 
279
>after</I
 
280
></SPAN
 
281
> a file is opened
 
282
              and the new map will take effect over any new object
 
283
              added to the tree.
 
284
            </P
 
285
></DD
 
286
><DT
 
287
><B
 
288
>&#13;        rootUEP
 
289
            </B
 
290
></DT
 
291
><DD
 
292
><P
 
293
>The UEP (user entry point) group in the file
 
294
              (see <A
 
295
HREF="c1381.html#openFileDescr"
 
296
>4.1.2</A
 
297
>).
 
298
            </P
 
299
></DD
 
300
><DT
 
301
><B
 
302
>&#13;        filters
 
303
            </B
 
304
></DT
 
305
><DD
 
306
><P
 
307
>Default filter properties for the root group
 
308
              (see <A
 
309
HREF="x4983.html#FiltersClassDescr"
 
310
>section�4.17.1</A
 
311
>).
 
312
            </P
 
313
></DD
 
314
><DT
 
315
><B
 
316
>&#13;        root
 
317
            </B
 
318
></DT
 
319
><DD
 
320
><P
 
321
>The <SPAN
 
322
CLASS="emphasis"
 
323
><I
 
324
CLASS="emphasis"
 
325
>root</I
 
326
></SPAN
 
327
> of the object tree hierarchy
 
328
              (a <SAMP
 
329
CLASS="computeroutput"
 
330
>Group</SAMP
 
331
> instance).
 
332
            </P
 
333
></DD
 
334
><DT
 
335
><B
 
336
>&#13;        objects
 
337
            </B
 
338
></DT
 
339
><DD
 
340
><P
 
341
>A dictionary which maps path names to objects,
 
342
              for every visible node in the tree (deprecated, see note
 
343
              below).
 
344
            </P
 
345
></DD
 
346
><DT
 
347
><B
 
348
>&#13;        groups
 
349
            </B
 
350
></DT
 
351
><DD
 
352
><P
 
353
>A dictionary which maps path names to objects,
 
354
              for every visible group in the tree (deprecated, see
 
355
              note below).
 
356
            </P
 
357
></DD
 
358
><DT
 
359
><B
 
360
>&#13;        leaves
 
361
            </B
 
362
></DT
 
363
><DD
 
364
><P
 
365
>A dictionary which maps path names to objects,
 
366
              for every visible leaf in the tree (deprecated, see note
 
367
              below).
 
368
            </P
 
369
></DD
 
370
></DL
 
371
></DIV
 
372
><P
 
373
><SPAN
 
374
CLASS="emphasis"
 
375
><I
 
376
CLASS="emphasis"
 
377
>Note:</I
 
378
></SPAN
 
379
> From PyTables 1.2 on,
 
380
            the dictionaries <SAMP
 
381
CLASS="computeroutput"
 
382
>objects</SAMP
 
383
>, <SAMP
 
384
CLASS="computeroutput"
 
385
>groups</SAMP
 
386
>
 
387
            and <SAMP
 
388
CLASS="computeroutput"
 
389
>leaves</SAMP
 
390
> are just instances of objects
 
391
            faking the old functionality. Actually, they internally
 
392
            use <SAMP
 
393
CLASS="computeroutput"
 
394
>File.getNode()</SAMP
 
395
>
 
396
            (<A
 
397
HREF="x1533.html#File.getNode"
 
398
>see�4.2.2</A
 
399
>)
 
400
            and <SAMP
 
401
CLASS="computeroutput"
 
402
>File.walknodes()</SAMP
 
403
>
 
404
            (<A
 
405
HREF="x1533.html#File.walkNodes"
 
406
>see�4.2.2</A
 
407
>),
 
408
            which are recommended instead.
 
409
          </P
 
410
></DIV
 
411
><DIV
 
412
CLASS="sect2"
 
413
><H2
 
414
CLASS="sect2"
 
415
><A
 
416
NAME="subsection4.2.2"
 
417
>4.2.2. <SPAN
 
418
CLASS="markup"
 
419
>File</SPAN
 
420
> methods</A
 
421
></H2
 
422
><A
 
423
NAME="FileMethodsDescr"
 
424
></A
 
425
><DIV
 
426
CLASS="sect3"
 
427
><H3
 
428
CLASS="sect3"
 
429
><A
 
430
NAME="subsubsection4.2.2.1"
 
431
>4.2.2.1. createGroup(where, name, title='', filters=None)</A
 
432
></H3
 
433
><A
 
434
NAME="createGroupDescr"
 
435
></A
 
436
><P
 
437
>Create a new Group instance with name <SPAN
 
438
CLASS="emphasis"
 
439
><I
 
440
CLASS="emphasis"
 
441
>name</I
 
442
></SPAN
 
443
> in
 
444
              <SPAN
 
445
CLASS="emphasis"
 
446
><I
 
447
CLASS="emphasis"
 
448
>where</I
 
449
></SPAN
 
450
> location.
 
451
            </P
 
452
><DIV
 
453
CLASS="glosslist"
 
454
><DL
 
455
><DT
 
456
><B
 
457
>where</B
 
458
></DT
 
459
><DD
 
460
><P
 
461
>The parent group where the new
 
462
                group will hang from. <SPAN
 
463
CLASS="emphasis"
 
464
><I
 
465
CLASS="emphasis"
 
466
>where</I
 
467
></SPAN
 
468
> parameter can be
 
469
                a path string (for example
 
470
                <SAMP
 
471
CLASS="computeroutput"
 
472
>"/level1/group5"</SAMP
 
473
>), or another Group
 
474
                instance. </P
 
475
></DD
 
476
><DT
 
477
><B
 
478
>name</B
 
479
></DT
 
480
><DD
 
481
><P
 
482
>The name of the new group.</P
 
483
></DD
 
484
><DT
 
485
><B
 
486
>title</B
 
487
></DT
 
488
><DD
 
489
><P
 
490
>A description for this
 
491
                group.</P
 
492
></DD
 
493
><DT
 
494
><B
 
495
>filters</B
 
496
></DT
 
497
><DD
 
498
><P
 
499
>An instance of the
 
500
                <SAMP
 
501
CLASS="computeroutput"
 
502
>Filters</SAMP
 
503
> class (see section<A
 
504
HREF="x4983.html#FiltersClassDescr"
 
505
>4.17.1</A
 
506
>) that provides
 
507
                information about the desired I/O filters applicable
 
508
                to the leaves that hangs directly from this new group
 
509
                (unless other filters properties are specified for
 
510
                these leaves). Besides, if you do not specify filter
 
511
                properties for its child groups, they will inherit
 
512
                these ones.
 
513
              </P
 
514
></DD
 
515
></DL
 
516
></DIV
 
517
></DIV
 
518
><DIV
 
519
CLASS="sect3"
 
520
><H3
 
521
CLASS="sect3"
 
522
><A
 
523
NAME="subsubsection4.2.2.2"
 
524
>4.2.2.2. createTable(where, name,
 
525
              description, title='', filters=None,
 
526
              expectedrows=10000)</A
 
527
></H3
 
528
><A
 
529
NAME="createTableDescr"
 
530
></A
 
531
><P
 
532
>Create a new <SAMP
 
533
CLASS="computeroutput"
 
534
>Table</SAMP
 
535
> instance with name
 
536
              <SPAN
 
537
CLASS="emphasis"
 
538
><I
 
539
CLASS="emphasis"
 
540
>name</I
 
541
></SPAN
 
542
> in <SPAN
 
543
CLASS="emphasis"
 
544
><I
 
545
CLASS="emphasis"
 
546
>where</I
 
547
></SPAN
 
548
> location.  See the <A
 
549
HREF="x2981.html#TableClassDescr"
 
550
>section�4.6</A
 
551
> for a description
 
552
              of the <SAMP
 
553
CLASS="computeroutput"
 
554
>Table</SAMP
 
555
> class.
 
556
            </P
 
557
><DIV
 
558
CLASS="glosslist"
 
559
><DL
 
560
><DT
 
561
><B
 
562
>where</B
 
563
></DT
 
564
><DD
 
565
><P
 
566
>The parent group where the new
 
567
                table will hang from. <SPAN
 
568
CLASS="emphasis"
 
569
><I
 
570
CLASS="emphasis"
 
571
>where</I
 
572
></SPAN
 
573
> parameter can be
 
574
                a path string (for example
 
575
                <SAMP
 
576
CLASS="computeroutput"
 
577
>"/level1/leaf5"</SAMP
 
578
>), or Group instance.
 
579
               </P
 
580
></DD
 
581
><DT
 
582
><B
 
583
>name</B
 
584
></DT
 
585
><DD
 
586
><P
 
587
>The name of the new table.
 
588
              </P
 
589
></DD
 
590
><DT
 
591
><B
 
592
>description</B
 
593
></DT
 
594
><DD
 
595
><P
 
596
>&#13;
 
597
                </P
 
598
><P
 
599
>This is an object that describes the table, that
 
600
                  is, how many columns has it, and properties for each
 
601
                  column: the type, the shape, etc. as well as other
 
602
                  table properties.
 
603
                </P
 
604
><P
 
605
>&#13;
 
606
                </P
 
607
><P
 
608
><SPAN
 
609
CLASS="emphasis"
 
610
><I
 
611
CLASS="emphasis"
 
612
>description</I
 
613
></SPAN
 
614
> can be any of the next several
 
615
                  objects:
 
616
                </P
 
617
><P
 
618
>&#13;
 
619
                </P
 
620
><DIV
 
621
CLASS="glosslist"
 
622
><DL
 
623
><DT
 
624
><B
 
625
>A user-defined class</B
 
626
></DT
 
627
><DD
 
628
><P
 
629
>This should
 
630
                    inherit from the <SAMP
 
631
CLASS="computeroutput"
 
632
>IsDescription</SAMP
 
633
> class
 
634
                    (see <A
 
635
HREF="x4389.html#IsDescriptionClassDescr"
 
636
>4.16.1</A
 
637
>)
 
638
                    where table fields are specified.
 
639
                  </P
 
640
></DD
 
641
><DT
 
642
><B
 
643
>A dictionary</B
 
644
></DT
 
645
><DD
 
646
><P
 
647
>For example, when
 
648
                    you do not know beforehand which structure will
 
649
                    have your table). See <A
 
650
HREF="x1017.html#secondExample"
 
651
>section�3.4</A
 
652
> for an example
 
653
                    of use.
 
654
                  </P
 
655
></DD
 
656
><DT
 
657
><B
 
658
>A <SAMP
 
659
CLASS="computeroutput"
 
660
>RecArray</SAMP
 
661
></B
 
662
></DT
 
663
><DD
 
664
><P
 
665
>This
 
666
                    object from the <SAMP
 
667
CLASS="computeroutput"
 
668
>numarray</SAMP
 
669
> package is
 
670
                    also accepted, and all the information about
 
671
                    columns and other metadata is used as a basis to
 
672
                    create the <SAMP
 
673
CLASS="computeroutput"
 
674
>Table</SAMP
 
675
> object. Moreover, if
 
676
                    the <SAMP
 
677
CLASS="computeroutput"
 
678
>RecArray</SAMP
 
679
> has actual data this is
 
680
                    also injected on the newly created
 
681
                    <SAMP
 
682
CLASS="computeroutput"
 
683
>Table</SAMP
 
684
> object.
 
685
                  </P
 
686
></DD
 
687
><DT
 
688
><B
 
689
>A <SAMP
 
690
CLASS="computeroutput"
 
691
>NestedRecArray</SAMP
 
692
></B
 
693
></DT
 
694
><DD
 
695
><P
 
696
>Finally, if you want to have nested columns
 
697
                    in your table, you can use this object (see <A
 
698
HREF="a6736.html#NestedRecArrayClassDescr"
 
699
>appendix�B</A
 
700
>)
 
701
                    and all the information about columns and other
 
702
                    metadata is used as a basis to create the
 
703
                    <SAMP
 
704
CLASS="computeroutput"
 
705
>Table</SAMP
 
706
> object. Moreover, if the
 
707
                    <SAMP
 
708
CLASS="computeroutput"
 
709
>NestedRecArray</SAMP
 
710
> has actual data this
 
711
                    is also injected on the newly created
 
712
                    <SAMP
 
713
CLASS="computeroutput"
 
714
>Table</SAMP
 
715
> object.
 
716
                  </P
 
717
></DD
 
718
></DL
 
719
></DIV
 
720
><P
 
721
>&#13;
 
722
              </P
 
723
></DD
 
724
><DT
 
725
><B
 
726
>title</B
 
727
></DT
 
728
><DD
 
729
><P
 
730
>A description for this object.
 
731
              </P
 
732
></DD
 
733
><DT
 
734
><B
 
735
>filters</B
 
736
></DT
 
737
><DD
 
738
><P
 
739
>An instance of the
 
740
                <SAMP
 
741
CLASS="computeroutput"
 
742
>Filters</SAMP
 
743
> class (see <A
 
744
HREF="x4983.html#FiltersClassDescr"
 
745
>section�4.17.1</A
 
746
>) that provides
 
747
                information about the desired I/O filters to be
 
748
                applied during the life of this object.
 
749
              </P
 
750
></DD
 
751
><DT
 
752
><B
 
753
>expectedrows</B
 
754
></DT
 
755
><DD
 
756
><P
 
757
>An user estimate of the
 
758
                number of records that will be on table. If not
 
759
                provided, the default value is appropriate for tables
 
760
                until 10 MB in size (more or less). If you plan to
 
761
                save bigger tables you should provide a guess; this
 
762
                will optimize the HDF5 B-Tree creation and management
 
763
                process time and memory used. See <A
 
764
HREF="c5270.html#expectedRowsOptim"
 
765
>section�5.1</A
 
766
> for a
 
767
                discussion on that issue.
 
768
              </P
 
769
></DD
 
770
></DL
 
771
></DIV
 
772
></DIV
 
773
><DIV
 
774
CLASS="sect3"
 
775
><H3
 
776
CLASS="sect3"
 
777
><A
 
778
NAME="subsubsection4.2.2.3"
 
779
>4.2.2.3. createArray(where, name,
 
780
              object, title='')</A
 
781
></H3
 
782
><A
 
783
NAME="createArrayDescr"
 
784
></A
 
785
><P
 
786
>Create a new <SAMP
 
787
CLASS="computeroutput"
 
788
>Array</SAMP
 
789
> instance with name
 
790
              <SPAN
 
791
CLASS="emphasis"
 
792
><I
 
793
CLASS="emphasis"
 
794
>name</I
 
795
></SPAN
 
796
> in <SPAN
 
797
CLASS="emphasis"
 
798
><I
 
799
CLASS="emphasis"
 
800
>where</I
 
801
></SPAN
 
802
> location.  See the <A
 
803
HREF="x3869.html#ArrayClassDescr"
 
804
>section�4.10</A
 
805
> for a
 
806
              description of the <SAMP
 
807
CLASS="computeroutput"
 
808
>Array</SAMP
 
809
> class.
 
810
            </P
 
811
><DIV
 
812
CLASS="glosslist"
 
813
><DL
 
814
><DT
 
815
><B
 
816
>object</B
 
817
></DT
 
818
><DD
 
819
><P
 
820
>The regular array to be
 
821
                saved. Currently accepted values are:
 
822
                <SAMP
 
823
CLASS="computeroutput"
 
824
>NumPy</SAMP
 
825
>, <SAMP
 
826
CLASS="computeroutput"
 
827
>Numeric</SAMP
 
828
>,
 
829
                <SAMP
 
830
CLASS="computeroutput"
 
831
>numarray</SAMP
 
832
> arrays (including
 
833
                <SAMP
 
834
CLASS="computeroutput"
 
835
>CharArray</SAMP
 
836
> string numarrays) or other
 
837
                native Python types, provided that they are regular
 
838
                (i.e. they are not like <SAMP
 
839
CLASS="computeroutput"
 
840
>[[1,2],2]</SAMP
 
841
>) and
 
842
                homogeneous (i.e. all the elements are of the same
 
843
                type). Also, objects that have some of their
 
844
                dimensions equal to zero are not supported (use an
 
845
                <SAMP
 
846
CLASS="computeroutput"
 
847
>EArray</SAMP
 
848
> object if you want to create an
 
849
                array with one of its dimensions equal to 0).
 
850
              </P
 
851
></DD
 
852
></DL
 
853
></DIV
 
854
><P
 
855
>See <A
 
856
HREF="x1533.html#createTableDescr"
 
857
><SAMP
 
858
CLASS="computeroutput"
 
859
>createTable</SAMP
 
860
>
 
861
              description�4.2.2</A
 
862
> for more information on the
 
863
              <SPAN
 
864
CLASS="emphasis"
 
865
><I
 
866
CLASS="emphasis"
 
867
>where</I
 
868
></SPAN
 
869
>, <SPAN
 
870
CLASS="emphasis"
 
871
><I
 
872
CLASS="emphasis"
 
873
>name</I
 
874
></SPAN
 
875
> and <SPAN
 
876
CLASS="emphasis"
 
877
><I
 
878
CLASS="emphasis"
 
879
>title</I
 
880
></SPAN
 
881
>,
 
882
              parameters.
 
883
            </P
 
884
></DIV
 
885
><DIV
 
886
CLASS="sect3"
 
887
><H3
 
888
CLASS="sect3"
 
889
><A
 
890
NAME="subsubsection4.2.2.4"
 
891
>4.2.2.4. createCArray(where, name, shape, atom,
 
892
              title='', filters=None)</A
 
893
></H3
 
894
><A
 
895
NAME="createCArrayDescr"
 
896
></A
 
897
><P
 
898
>Create a new <SAMP
 
899
CLASS="computeroutput"
 
900
>CArray</SAMP
 
901
> instance with name
 
902
              <SPAN
 
903
CLASS="emphasis"
 
904
><I
 
905
CLASS="emphasis"
 
906
>name</I
 
907
></SPAN
 
908
> in <SPAN
 
909
CLASS="emphasis"
 
910
><I
 
911
CLASS="emphasis"
 
912
>where</I
 
913
></SPAN
 
914
> location. See the <A
 
915
HREF="x4041.html#CArrayClassDescr"
 
916
>section�4.11</A
 
917
> for a
 
918
              description of the <SAMP
 
919
CLASS="computeroutput"
 
920
>CArray</SAMP
 
921
> class.
 
922
            </P
 
923
><DIV
 
924
CLASS="glosslist"
 
925
><DL
 
926
><DT
 
927
><B
 
928
>shape</B
 
929
></DT
 
930
><DD
 
931
><P
 
932
>The <SPAN
 
933
CLASS="emphasis"
 
934
><I
 
935
CLASS="emphasis"
 
936
>shape</I
 
937
></SPAN
 
938
> of the
 
939
                objects to be saved.
 
940
              </P
 
941
></DD
 
942
><DT
 
943
><B
 
944
>atom</B
 
945
></DT
 
946
><DD
 
947
><P
 
948
>An <SAMP
 
949
CLASS="computeroutput"
 
950
>Atom</SAMP
 
951
> instance
 
952
                representing the <SPAN
 
953
CLASS="emphasis"
 
954
><I
 
955
CLASS="emphasis"
 
956
>shape</I
 
957
></SPAN
 
958
>, <SPAN
 
959
CLASS="emphasis"
 
960
><I
 
961
CLASS="emphasis"
 
962
>type</I
 
963
></SPAN
 
964
> and
 
965
                <SPAN
 
966
CLASS="emphasis"
 
967
><I
 
968
CLASS="emphasis"
 
969
>flavor</I
 
970
></SPAN
 
971
> of the chunk of the objects to be saved.
 
972
              </P
 
973
></DD
 
974
></DL
 
975
></DIV
 
976
><P
 
977
>See <A
 
978
HREF="x1533.html#createTableDescr"
 
979
><SAMP
 
980
CLASS="computeroutput"
 
981
>createTable</SAMP
 
982
>
 
983
              description�4.2.2</A
 
984
> for more information on the
 
985
              <SPAN
 
986
CLASS="emphasis"
 
987
><I
 
988
CLASS="emphasis"
 
989
>where</I
 
990
></SPAN
 
991
>, <SPAN
 
992
CLASS="emphasis"
 
993
><I
 
994
CLASS="emphasis"
 
995
>name</I
 
996
></SPAN
 
997
> and <SPAN
 
998
CLASS="emphasis"
 
999
><I
 
1000
CLASS="emphasis"
 
1001
>title</I
 
1002
></SPAN
 
1003
>,
 
1004
              parameters.
 
1005
            </P
 
1006
></DIV
 
1007
><DIV
 
1008
CLASS="sect3"
 
1009
><H3
 
1010
CLASS="sect3"
 
1011
><A
 
1012
NAME="subsubsection4.2.2.5"
 
1013
>4.2.2.5. createEArray(where, name,
 
1014
              atom, title='', filters=None, expectedrows=1000)</A
 
1015
></H3
 
1016
><A
 
1017
NAME="createEArrayDescr"
 
1018
></A
 
1019
><P
 
1020
>Create a new <SAMP
 
1021
CLASS="computeroutput"
 
1022
>EArray</SAMP
 
1023
> instance with name
 
1024
              <SPAN
 
1025
CLASS="emphasis"
 
1026
><I
 
1027
CLASS="emphasis"
 
1028
>name</I
 
1029
></SPAN
 
1030
> in <SPAN
 
1031
CLASS="emphasis"
 
1032
><I
 
1033
CLASS="emphasis"
 
1034
>where</I
 
1035
></SPAN
 
1036
> location.  See the <A
 
1037
HREF="x4072.html#EArrayClassDescr"
 
1038
>section�4.12</A
 
1039
> for a
 
1040
              description of the <SAMP
 
1041
CLASS="computeroutput"
 
1042
>EArray</SAMP
 
1043
> class.
 
1044
            </P
 
1045
><DIV
 
1046
CLASS="glosslist"
 
1047
><DL
 
1048
><DT
 
1049
><B
 
1050
>atom</B
 
1051
></DT
 
1052
><DD
 
1053
><P
 
1054
>An <SAMP
 
1055
CLASS="computeroutput"
 
1056
>Atom</SAMP
 
1057
> instance
 
1058
                representing the <SPAN
 
1059
CLASS="emphasis"
 
1060
><I
 
1061
CLASS="emphasis"
 
1062
>shape</I
 
1063
></SPAN
 
1064
>, <SPAN
 
1065
CLASS="emphasis"
 
1066
><I
 
1067
CLASS="emphasis"
 
1068
>type</I
 
1069
></SPAN
 
1070
> and
 
1071
                <SPAN
 
1072
CLASS="emphasis"
 
1073
><I
 
1074
CLASS="emphasis"
 
1075
>flavor</I
 
1076
></SPAN
 
1077
> of the atomic objects to be saved.
 
1078
                One (and only one) of the shape dimensions <SPAN
 
1079
CLASS="emphasis"
 
1080
><I
 
1081
CLASS="emphasis"
 
1082
>must</I
 
1083
></SPAN
 
1084
> be 0. The dimension being 0
 
1085
                means that the resulting <SAMP
 
1086
CLASS="computeroutput"
 
1087
>EArray</SAMP
 
1088
> object
 
1089
                can be extended along it. Multiple enlargeable
 
1090
                dimensions are not supported right now.  See <A
 
1091
HREF="x4389.html#AtomClassDescr"
 
1092
>section�4.16.3</A
 
1093
> for the supported
 
1094
                set of <SAMP
 
1095
CLASS="computeroutput"
 
1096
>Atom</SAMP
 
1097
> class descendants.
 
1098
              </P
 
1099
></DD
 
1100
><DT
 
1101
><B
 
1102
>expectedrows</B
 
1103
></DT
 
1104
><DD
 
1105
><P
 
1106
>In the case of
 
1107
                enlargeable arrays this represents an user estimate
 
1108
                about the number of row elements that will be added to
 
1109
                the growable dimension in the EArray object. If not
 
1110
                provided, the default value is 1000 rows. If you plan
 
1111
                to create both much smaller or much bigger EArrays try
 
1112
                providing a guess; this will optimize the HDF5 B-Tree
 
1113
                creation and management process time and the amount of
 
1114
                memory used.
 
1115
              </P
 
1116
></DD
 
1117
></DL
 
1118
></DIV
 
1119
><P
 
1120
>See <A
 
1121
HREF="x1533.html#createTableDescr"
 
1122
><SAMP
 
1123
CLASS="computeroutput"
 
1124
>createTable</SAMP
 
1125
>
 
1126
              description�4.2.2</A
 
1127
> for more information on the
 
1128
              <SPAN
 
1129
CLASS="emphasis"
 
1130
><I
 
1131
CLASS="emphasis"
 
1132
>where</I
 
1133
></SPAN
 
1134
>, <SPAN
 
1135
CLASS="emphasis"
 
1136
><I
 
1137
CLASS="emphasis"
 
1138
>name</I
 
1139
></SPAN
 
1140
>, <SPAN
 
1141
CLASS="emphasis"
 
1142
><I
 
1143
CLASS="emphasis"
 
1144
>title</I
 
1145
></SPAN
 
1146
>,
 
1147
              and <SPAN
 
1148
CLASS="emphasis"
 
1149
><I
 
1150
CLASS="emphasis"
 
1151
>filters</I
 
1152
></SPAN
 
1153
> parameters.
 
1154
            </P
 
1155
></DIV
 
1156
><DIV
 
1157
CLASS="sect3"
 
1158
><H3
 
1159
CLASS="sect3"
 
1160
><A
 
1161
NAME="subsubsection4.2.2.6"
 
1162
>4.2.2.6. createVLArray(where,
 
1163
              name, atom=None, title='', filters=None,
 
1164
              expectedsizeinMB=1.0)</A
 
1165
></H3
 
1166
><A
 
1167
NAME="createVLArrayDescr"
 
1168
></A
 
1169
><P
 
1170
>Create a new <SAMP
 
1171
CLASS="computeroutput"
 
1172
>VLArray</SAMP
 
1173
> instance with name
 
1174
              <SPAN
 
1175
CLASS="emphasis"
 
1176
><I
 
1177
CLASS="emphasis"
 
1178
>name</I
 
1179
></SPAN
 
1180
> in <SPAN
 
1181
CLASS="emphasis"
 
1182
><I
 
1183
CLASS="emphasis"
 
1184
>where</I
 
1185
></SPAN
 
1186
> location. See the <A
 
1187
HREF="x4133.html#VLArrayClassDescr"
 
1188
>section�4.13</A
 
1189
> for a
 
1190
              description of the <SAMP
 
1191
CLASS="computeroutput"
 
1192
>VLArray</SAMP
 
1193
> class.
 
1194
            </P
 
1195
><DIV
 
1196
CLASS="glosslist"
 
1197
><DL
 
1198
><DT
 
1199
><B
 
1200
>atom</B
 
1201
></DT
 
1202
><DD
 
1203
><P
 
1204
>An <SAMP
 
1205
CLASS="computeroutput"
 
1206
>Atom</SAMP
 
1207
> instance
 
1208
                representing the shape, type and flavor of the atomic
 
1209
                object to be saved. See <A
 
1210
HREF="x4389.html#AtomClassDescr"
 
1211
>section�4.16.3</A
 
1212
> for the supported set
 
1213
                of <SAMP
 
1214
CLASS="computeroutput"
 
1215
>Atom</SAMP
 
1216
> class descendants.
 
1217
              </P
 
1218
></DD
 
1219
><DT
 
1220
><B
 
1221
>expectedsizeinMB</B
 
1222
></DT
 
1223
><DD
 
1224
><P
 
1225
>An user estimate
 
1226
                about the size (in MB) in the final
 
1227
                <SAMP
 
1228
CLASS="computeroutput"
 
1229
>VLArray</SAMP
 
1230
> object. If not provided, the
 
1231
                default value is 1 MB.  If you plan to create both
 
1232
                much smaller or much bigger VLA's try providing a
 
1233
                guess; this will optimize the HDF5 B-Tree creation and
 
1234
                management process time and the amount of memory used.
 
1235
              </P
 
1236
></DD
 
1237
></DL
 
1238
></DIV
 
1239
><P
 
1240
>See <A
 
1241
HREF="x1533.html#createTableDescr"
 
1242
><SAMP
 
1243
CLASS="computeroutput"
 
1244
>createTable</SAMP
 
1245
>
 
1246
              description�4.2.2</A
 
1247
> for more information on the
 
1248
              <SPAN
 
1249
CLASS="emphasis"
 
1250
><I
 
1251
CLASS="emphasis"
 
1252
>where</I
 
1253
></SPAN
 
1254
>, <SPAN
 
1255
CLASS="emphasis"
 
1256
><I
 
1257
CLASS="emphasis"
 
1258
>name</I
 
1259
></SPAN
 
1260
>, <SPAN
 
1261
CLASS="emphasis"
 
1262
><I
 
1263
CLASS="emphasis"
 
1264
>title</I
 
1265
></SPAN
 
1266
>, and
 
1267
              <SPAN
 
1268
CLASS="emphasis"
 
1269
><I
 
1270
CLASS="emphasis"
 
1271
>filters</I
 
1272
></SPAN
 
1273
> parameters.
 
1274
            </P
 
1275
></DIV
 
1276
><DIV
 
1277
CLASS="sect3"
 
1278
><H3
 
1279
CLASS="sect3"
 
1280
><A
 
1281
NAME="subsubsection4.2.2.7"
 
1282
>4.2.2.7. getNode(where, name=None, classname=None)</A
 
1283
></H3
 
1284
><A
 
1285
NAME="File.getNode"
 
1286
></A
 
1287
><P
 
1288
>Get the node under <SPAN
 
1289
CLASS="emphasis"
 
1290
><I
 
1291
CLASS="emphasis"
 
1292
>where</I
 
1293
></SPAN
 
1294
> with the given <SPAN
 
1295
CLASS="emphasis"
 
1296
><I
 
1297
CLASS="emphasis"
 
1298
>name</I
 
1299
></SPAN
 
1300
>.</P
 
1301
><P
 
1302
><SPAN
 
1303
CLASS="emphasis"
 
1304
><I
 
1305
CLASS="emphasis"
 
1306
>where</I
 
1307
></SPAN
 
1308
> can be a <SAMP
 
1309
CLASS="computeroutput"
 
1310
>Node</SAMP
 
1311
> instance
 
1312
              or a path string leading to a node.
 
1313
              If no <SPAN
 
1314
CLASS="emphasis"
 
1315
><I
 
1316
CLASS="emphasis"
 
1317
>name</I
 
1318
></SPAN
 
1319
> is specified, that node is returned.
 
1320
            </P
 
1321
><P
 
1322
>If a <SPAN
 
1323
CLASS="emphasis"
 
1324
><I
 
1325
CLASS="emphasis"
 
1326
>name</I
 
1327
></SPAN
 
1328
> is specified, this must be a string
 
1329
              with the name of a node under <SPAN
 
1330
CLASS="emphasis"
 
1331
><I
 
1332
CLASS="emphasis"
 
1333
>where</I
 
1334
></SPAN
 
1335
>.
 
1336
              In this case the <SPAN
 
1337
CLASS="emphasis"
 
1338
><I
 
1339
CLASS="emphasis"
 
1340
>where</I
 
1341
></SPAN
 
1342
> argument can only lead to
 
1343
              a <SAMP
 
1344
CLASS="computeroutput"
 
1345
>Group</SAMP
 
1346
> instance
 
1347
              (else a <SAMP
 
1348
CLASS="computeroutput"
 
1349
>TypeError</SAMP
 
1350
> is raised).
 
1351
              The node called <SPAN
 
1352
CLASS="emphasis"
 
1353
><I
 
1354
CLASS="emphasis"
 
1355
>name</I
 
1356
></SPAN
 
1357
> under the group <SPAN
 
1358
CLASS="emphasis"
 
1359
><I
 
1360
CLASS="emphasis"
 
1361
>where</I
 
1362
></SPAN
 
1363
>
 
1364
              is returned.
 
1365
            </P
 
1366
><P
 
1367
>In both cases, if the node to be returned does not exist, a
 
1368
              <SAMP
 
1369
CLASS="computeroutput"
 
1370
>NoSuchNodeError</SAMP
 
1371
> is raised.
 
1372
              Please, note that hidden nodes are also considered.
 
1373
            </P
 
1374
><P
 
1375
>If the <SPAN
 
1376
CLASS="emphasis"
 
1377
><I
 
1378
CLASS="emphasis"
 
1379
>classname</I
 
1380
></SPAN
 
1381
> argument is specified,
 
1382
              it must be the name of a class derived from <SAMP
 
1383
CLASS="computeroutput"
 
1384
>Node</SAMP
 
1385
>.
 
1386
              If the node is found but it is not an instance of that class,
 
1387
              a <SAMP
 
1388
CLASS="computeroutput"
 
1389
>NoSuchNodeError</SAMP
 
1390
> is also raised.
 
1391
            </P
 
1392
></DIV
 
1393
><DIV
 
1394
CLASS="sect3"
 
1395
><H3
 
1396
CLASS="sect3"
 
1397
><A
 
1398
NAME="subsubsection4.2.2.8"
 
1399
>4.2.2.8. isVisibleNode(path)</A
 
1400
></H3
 
1401
><A
 
1402
NAME="File.isVisibleNode"
 
1403
></A
 
1404
><P
 
1405
>Is the node under <SAMP
 
1406
CLASS="computeroutput"
 
1407
>path</SAMP
 
1408
> visible?</P
 
1409
><P
 
1410
>If the node does not exist,
 
1411
              a <SAMP
 
1412
CLASS="computeroutput"
 
1413
>NoSuchNodeError</SAMP
 
1414
> is raised.</P
 
1415
></DIV
 
1416
><DIV
 
1417
CLASS="sect3"
 
1418
><H3
 
1419
CLASS="sect3"
 
1420
><A
 
1421
NAME="subsubsection4.2.2.9"
 
1422
>4.2.2.9. getNodeAttr(where, attrname, name=None)</A
 
1423
></H3
 
1424
><A
 
1425
NAME="File.getNodeAttr"
 
1426
></A
 
1427
><P
 
1428
>Returns the attribute <SPAN
 
1429
CLASS="emphasis"
 
1430
><I
 
1431
CLASS="emphasis"
 
1432
>attrname</I
 
1433
></SPAN
 
1434
> under
 
1435
              <SPAN
 
1436
CLASS="emphasis"
 
1437
><I
 
1438
CLASS="emphasis"
 
1439
>where.name</I
 
1440
></SPAN
 
1441
> location.
 
1442
            </P
 
1443
><DIV
 
1444
CLASS="glosslist"
 
1445
><DL
 
1446
><DT
 
1447
><B
 
1448
>where, name</B
 
1449
></DT
 
1450
><DD
 
1451
><P
 
1452
>These arguments work as in <SAMP
 
1453
CLASS="computeroutput"
 
1454
>getNode()</SAMP
 
1455
>
 
1456
                (see <A
 
1457
HREF="x1533.html#File.getNode"
 
1458
>[here]</A
 
1459
>),
 
1460
                referencing the node to be acted upon.
 
1461
              </P
 
1462
></DD
 
1463
><DT
 
1464
><B
 
1465
>attrname</B
 
1466
></DT
 
1467
><DD
 
1468
><P
 
1469
>The name of the attribute to get.</P
 
1470
></DD
 
1471
></DL
 
1472
></DIV
 
1473
></DIV
 
1474
><DIV
 
1475
CLASS="sect3"
 
1476
><H3
 
1477
CLASS="sect3"
 
1478
><A
 
1479
NAME="subsubsection4.2.2.10"
 
1480
>4.2.2.10. setNodeAttr(where, attrname, attrvalue, name=None)</A
 
1481
></H3
 
1482
><A
 
1483
NAME="File.setNodeAttr"
 
1484
></A
 
1485
><P
 
1486
>Sets the attribute <SPAN
 
1487
CLASS="emphasis"
 
1488
><I
 
1489
CLASS="emphasis"
 
1490
>attrname</I
 
1491
></SPAN
 
1492
> with value
 
1493
              <SPAN
 
1494
CLASS="emphasis"
 
1495
><I
 
1496
CLASS="emphasis"
 
1497
>attrvalue</I
 
1498
></SPAN
 
1499
> under <SPAN
 
1500
CLASS="emphasis"
 
1501
><I
 
1502
CLASS="emphasis"
 
1503
>where.name</I
 
1504
></SPAN
 
1505
> location.
 
1506
              If the node already has a large number of attributes,
 
1507
              a <SAMP
 
1508
CLASS="computeroutput"
 
1509
>PerformanceWarning</SAMP
 
1510
> will be issued.
 
1511
            </P
 
1512
><DIV
 
1513
CLASS="glosslist"
 
1514
><DL
 
1515
><DT
 
1516
><B
 
1517
>where, name</B
 
1518
></DT
 
1519
><DD
 
1520
><P
 
1521
>These arguments work as in <SAMP
 
1522
CLASS="computeroutput"
 
1523
>getNode()</SAMP
 
1524
>
 
1525
                (see <A
 
1526
HREF="x1533.html#File.getNode"
 
1527
>[here]</A
 
1528
>),
 
1529
                referencing the node to be acted upon.
 
1530
              </P
 
1531
></DD
 
1532
><DT
 
1533
><B
 
1534
>attrname</B
 
1535
></DT
 
1536
><DD
 
1537
><P
 
1538
>The name of the attribute to set on disk.</P
 
1539
></DD
 
1540
><DT
 
1541
><B
 
1542
>attrvalue</B
 
1543
></DT
 
1544
><DD
 
1545
><P
 
1546
>The value of the attribute
 
1547
                to set.  Any kind of python object (like string, ints,
 
1548
                floats, lists, tuples, dicts, small
 
1549
                Numeric/NumPy/numarray objects...) can be stored as an
 
1550
                attribute. However, if necessary,
 
1551
                <SAMP
 
1552
CLASS="computeroutput"
 
1553
>(c)Pickle</SAMP
 
1554
> is automatically used so as to
 
1555
                serialize objects that you might want to save (see
 
1556
                <A
 
1557
HREF="x4306.html#AttributeSetClassDescr"
 
1558
>4.15</A
 
1559
> for
 
1560
                details).
 
1561
              </P
 
1562
></DD
 
1563
></DL
 
1564
></DIV
 
1565
></DIV
 
1566
><DIV
 
1567
CLASS="sect3"
 
1568
><H3
 
1569
CLASS="sect3"
 
1570
><A
 
1571
NAME="subsubsection4.2.2.11"
 
1572
>4.2.2.11. delNodeAttr(where, attrname, name=None)</A
 
1573
></H3
 
1574
><A
 
1575
NAME="File.delNodeAttr"
 
1576
></A
 
1577
><P
 
1578
>Delete the attribute <SPAN
 
1579
CLASS="emphasis"
 
1580
><I
 
1581
CLASS="emphasis"
 
1582
>attrname</I
 
1583
></SPAN
 
1584
> in
 
1585
              <SPAN
 
1586
CLASS="emphasis"
 
1587
><I
 
1588
CLASS="emphasis"
 
1589
>where.name</I
 
1590
></SPAN
 
1591
> location.
 
1592
            </P
 
1593
><DIV
 
1594
CLASS="glosslist"
 
1595
><DL
 
1596
><DT
 
1597
><B
 
1598
>where, name</B
 
1599
></DT
 
1600
><DD
 
1601
><P
 
1602
>These arguments work as in <SAMP
 
1603
CLASS="computeroutput"
 
1604
>getNode()</SAMP
 
1605
>
 
1606
                (see <A
 
1607
HREF="x1533.html#File.getNode"
 
1608
>[here]</A
 
1609
>),
 
1610
                referencing the node to be acted upon.
 
1611
              </P
 
1612
></DD
 
1613
><DT
 
1614
><B
 
1615
>attrname</B
 
1616
></DT
 
1617
><DD
 
1618
><P
 
1619
>The name of the attribute to delete on disk.</P
 
1620
></DD
 
1621
></DL
 
1622
></DIV
 
1623
></DIV
 
1624
><DIV
 
1625
CLASS="sect3"
 
1626
><H3
 
1627
CLASS="sect3"
 
1628
><A
 
1629
NAME="subsubsection4.2.2.12"
 
1630
>4.2.2.12. copyNodeAttrs(where, dstnode, name=None)</A
 
1631
></H3
 
1632
><A
 
1633
NAME="File.copyNodeAttrs"
 
1634
></A
 
1635
><P
 
1636
>Copy the attributes from node <SPAN
 
1637
CLASS="emphasis"
 
1638
><I
 
1639
CLASS="emphasis"
 
1640
>where.name</I
 
1641
></SPAN
 
1642
> to
 
1643
              <SPAN
 
1644
CLASS="emphasis"
 
1645
><I
 
1646
CLASS="emphasis"
 
1647
>dstnode</I
 
1648
></SPAN
 
1649
>.
 
1650
            </P
 
1651
><DIV
 
1652
CLASS="glosslist"
 
1653
><DL
 
1654
><DT
 
1655
><B
 
1656
>where, name</B
 
1657
></DT
 
1658
><DD
 
1659
><P
 
1660
>These arguments work as in <SAMP
 
1661
CLASS="computeroutput"
 
1662
>getNode()</SAMP
 
1663
>
 
1664
                (see <A
 
1665
HREF="x1533.html#File.getNode"
 
1666
>[here]</A
 
1667
>),
 
1668
                referencing the node to be acted upon.
 
1669
              </P
 
1670
></DD
 
1671
><DT
 
1672
><B
 
1673
>dstnode</B
 
1674
></DT
 
1675
><DD
 
1676
><P
 
1677
>This is the destination node
 
1678
                where the attributes will be copied. It can be either
 
1679
                a path string or a <SAMP
 
1680
CLASS="computeroutput"
 
1681
>Node</SAMP
 
1682
> object.
 
1683
              </P
 
1684
></DD
 
1685
></DL
 
1686
></DIV
 
1687
></DIV
 
1688
><DIV
 
1689
CLASS="sect3"
 
1690
><H3
 
1691
CLASS="sect3"
 
1692
><A
 
1693
NAME="subsubsection4.2.2.13"
 
1694
>4.2.2.13. iterNodes(where, classname=None)</A
 
1695
></H3
 
1696
><A
 
1697
NAME="File.iterNodes"
 
1698
></A
 
1699
><P
 
1700
>Returns an <SPAN
 
1701
CLASS="emphasis"
 
1702
><I
 
1703
CLASS="emphasis"
 
1704
>iterator</I
 
1705
></SPAN
 
1706
> yielding children nodes
 
1707
              hanging from <SPAN
 
1708
CLASS="emphasis"
 
1709
><I
 
1710
CLASS="emphasis"
 
1711
>where</I
 
1712
></SPAN
 
1713
>.  These nodes are
 
1714
              alpha-numerically sorted by its node name.
 
1715
            </P
 
1716
><DIV
 
1717
CLASS="glosslist"
 
1718
><DL
 
1719
><DT
 
1720
><B
 
1721
>where</B
 
1722
></DT
 
1723
><DD
 
1724
><P
 
1725
>This argument works as in <SAMP
 
1726
CLASS="computeroutput"
 
1727
>getNode()</SAMP
 
1728
>
 
1729
                (see <A
 
1730
HREF="x1533.html#File.getNode"
 
1731
>[here]</A
 
1732
>),
 
1733
                referencing the node to be acted upon.
 
1734
              </P
 
1735
></DD
 
1736
><DT
 
1737
><B
 
1738
>classname</B
 
1739
></DT
 
1740
><DD
 
1741
><P
 
1742
>If the name of a class
 
1743
                derived from <SAMP
 
1744
CLASS="computeroutput"
 
1745
>Node</SAMP
 
1746
> is supplied in the
 
1747
                <SPAN
 
1748
CLASS="emphasis"
 
1749
><I
 
1750
CLASS="emphasis"
 
1751
>classname</I
 
1752
></SPAN
 
1753
> parameter, only instances of that
 
1754
                class (or subclasses of it) will be returned.
 
1755
              </P
 
1756
></DD
 
1757
></DL
 
1758
></DIV
 
1759
></DIV
 
1760
><DIV
 
1761
CLASS="sect3"
 
1762
><H3
 
1763
CLASS="sect3"
 
1764
><A
 
1765
NAME="subsubsection4.2.2.14"
 
1766
>4.2.2.14. listNodes(where, classname=None)</A
 
1767
></H3
 
1768
><A
 
1769
NAME="File.listNodes"
 
1770
></A
 
1771
><P
 
1772
>Returns a <SPAN
 
1773
CLASS="emphasis"
 
1774
><I
 
1775
CLASS="emphasis"
 
1776
>list</I
 
1777
></SPAN
 
1778
> with children nodes hanging
 
1779
              from <SPAN
 
1780
CLASS="emphasis"
 
1781
><I
 
1782
CLASS="emphasis"
 
1783
>where</I
 
1784
></SPAN
 
1785
>.  The list is alpha-numerically
 
1786
              sorted by node name.
 
1787
            </P
 
1788
><DIV
 
1789
CLASS="glosslist"
 
1790
><DL
 
1791
><DT
 
1792
><B
 
1793
>where</B
 
1794
></DT
 
1795
><DD
 
1796
><P
 
1797
>This argument works as in <SAMP
 
1798
CLASS="computeroutput"
 
1799
>getNode()</SAMP
 
1800
>
 
1801
                (see <A
 
1802
HREF="x1533.html#File.getNode"
 
1803
>[here]</A
 
1804
>),
 
1805
                referencing the node to be acted upon.
 
1806
              </P
 
1807
></DD
 
1808
><DT
 
1809
><B
 
1810
>classname</B
 
1811
></DT
 
1812
><DD
 
1813
><P
 
1814
>If the name of a class
 
1815
                derived from <SAMP
 
1816
CLASS="computeroutput"
 
1817
>Node</SAMP
 
1818
> is supplied in the
 
1819
                <SPAN
 
1820
CLASS="emphasis"
 
1821
><I
 
1822
CLASS="emphasis"
 
1823
>classname</I
 
1824
></SPAN
 
1825
> parameter, only instances of that
 
1826
                class (or subclasses of it) will be returned.
 
1827
              </P
 
1828
></DD
 
1829
></DL
 
1830
></DIV
 
1831
></DIV
 
1832
><DIV
 
1833
CLASS="sect3"
 
1834
><H3
 
1835
CLASS="sect3"
 
1836
><A
 
1837
NAME="subsubsection4.2.2.15"
 
1838
>4.2.2.15. removeNode(where, name=None, recursive=False)</A
 
1839
></H3
 
1840
><A
 
1841
NAME="File.removeNode"
 
1842
></A
 
1843
><P
 
1844
>Removes the object node
 
1845
              <SPAN
 
1846
CLASS="emphasis"
 
1847
><I
 
1848
CLASS="emphasis"
 
1849
>name</I
 
1850
></SPAN
 
1851
> under <SPAN
 
1852
CLASS="emphasis"
 
1853
><I
 
1854
CLASS="emphasis"
 
1855
>where</I
 
1856
></SPAN
 
1857
> location.
 
1858
            </P
 
1859
><DIV
 
1860
CLASS="glosslist"
 
1861
><DL
 
1862
><DT
 
1863
><B
 
1864
>where, name</B
 
1865
></DT
 
1866
><DD
 
1867
><P
 
1868
>These arguments work as in <SAMP
 
1869
CLASS="computeroutput"
 
1870
>getNode()</SAMP
 
1871
>
 
1872
                (see <A
 
1873
HREF="x1533.html#File.getNode"
 
1874
>[here]</A
 
1875
>),
 
1876
                referencing the node to be acted upon.
 
1877
              </P
 
1878
></DD
 
1879
><DT
 
1880
><B
 
1881
>recursive</B
 
1882
></DT
 
1883
><DD
 
1884
><P
 
1885
>If not supplied, the object will be removed
 
1886
                only if it has no children;
 
1887
                if it does, a <SAMP
 
1888
CLASS="computeroutput"
 
1889
>NodeError</SAMP
 
1890
> will be raised.
 
1891
                If supplied with a true value,
 
1892
                the object and all its descendants will be completely removed.
 
1893
              </P
 
1894
></DD
 
1895
></DL
 
1896
></DIV
 
1897
></DIV
 
1898
><DIV
 
1899
CLASS="sect3"
 
1900
><H3
 
1901
CLASS="sect3"
 
1902
><A
 
1903
NAME="subsubsection4.2.2.16"
 
1904
>4.2.2.16. copyNode(where, newparent=None, newname=None, name=None,
 
1905
              overwrite=False, recursive=False, **kwargs)</A
 
1906
></H3
 
1907
><A
 
1908
NAME="File.copyNode"
 
1909
></A
 
1910
><P
 
1911
>Copy the node specified by <SPAN
 
1912
CLASS="emphasis"
 
1913
><I
 
1914
CLASS="emphasis"
 
1915
>where</I
 
1916
></SPAN
 
1917
> and <SPAN
 
1918
CLASS="emphasis"
 
1919
><I
 
1920
CLASS="emphasis"
 
1921
>name</I
 
1922
></SPAN
 
1923
>
 
1924
              to <SPAN
 
1925
CLASS="emphasis"
 
1926
><I
 
1927
CLASS="emphasis"
 
1928
>newparent/newname</I
 
1929
></SPAN
 
1930
>.</P
 
1931
><DIV
 
1932
CLASS="glosslist"
 
1933
><DL
 
1934
><DT
 
1935
><B
 
1936
>where, name</B
 
1937
></DT
 
1938
><DD
 
1939
><P
 
1940
>These arguments work as in <SAMP
 
1941
CLASS="computeroutput"
 
1942
>getNode()</SAMP
 
1943
>
 
1944
                (see <A
 
1945
HREF="x1533.html#File.getNode"
 
1946
>[here]</A
 
1947
>),
 
1948
                referencing the node to be acted upon.
 
1949
              </P
 
1950
></DD
 
1951
><DT
 
1952
><B
 
1953
>newparent</B
 
1954
></DT
 
1955
><DD
 
1956
><P
 
1957
>The destination group that the node will be copied to
 
1958
                (a path name or a <SAMP
 
1959
CLASS="computeroutput"
 
1960
>Group</SAMP
 
1961
> instance).
 
1962
                If <SPAN
 
1963
CLASS="emphasis"
 
1964
><I
 
1965
CLASS="emphasis"
 
1966
>newparent</I
 
1967
></SPAN
 
1968
> is <SAMP
 
1969
CLASS="computeroutput"
 
1970
>None</SAMP
 
1971
>,
 
1972
                the parent of the source node is selected as the new parent.
 
1973
              </P
 
1974
></DD
 
1975
><DT
 
1976
><B
 
1977
>newname</B
 
1978
></DT
 
1979
><DD
 
1980
><P
 
1981
>The name to be assigned to
 
1982
              the new copy in its destination (a string).  If
 
1983
              <SPAN
 
1984
CLASS="emphasis"
 
1985
><I
 
1986
CLASS="emphasis"
 
1987
>newname</I
 
1988
></SPAN
 
1989
> is <SAMP
 
1990
CLASS="computeroutput"
 
1991
>None</SAMP
 
1992
> or not specified,
 
1993
              the name of the source node is used.
 
1994
              </P
 
1995
></DD
 
1996
><DT
 
1997
><B
 
1998
>overwrite</B
 
1999
></DT
 
2000
><DD
 
2001
><P
 
2002
>Whether the possibly
 
2003
              existing node <SPAN
 
2004
CLASS="emphasis"
 
2005
><I
 
2006
CLASS="emphasis"
 
2007
>newparent/newname</I
 
2008
></SPAN
 
2009
> should be
 
2010
              overwritten or not.  Note that trying to copy over an
 
2011
              existing node without overwriting it will issue a
 
2012
              <SAMP
 
2013
CLASS="computeroutput"
 
2014
>NodeError</SAMP
 
2015
>.
 
2016
              </P
 
2017
></DD
 
2018
><DT
 
2019
><B
 
2020
>recursive</B
 
2021
></DT
 
2022
><DD
 
2023
><P
 
2024
>Specifies whether the copy should recurse
 
2025
                into children of the copied node.
 
2026
                This argument is ignored for leaf nodes.
 
2027
                The default is not recurse.
 
2028
              </P
 
2029
></DD
 
2030
><DT
 
2031
><B
 
2032
>kwargs</B
 
2033
></DT
 
2034
><DD
 
2035
><P
 
2036
>&#13;          Additional keyword arguments may be passed to customize
 
2037
                the copying process.
 
2038
                The supported arguments depend on the kind of node being copied.
 
2039
                The following are some of them:
 
2040
              </P
 
2041
></DD
 
2042
><DT
 
2043
><B
 
2044
>title</B
 
2045
></DT
 
2046
><DD
 
2047
><P
 
2048
>The new title for the destination.
 
2049
                If <SAMP
 
2050
CLASS="computeroutput"
 
2051
>None</SAMP
 
2052
>, the original title is used.
 
2053
                This only applies to the topmost node for recursive copies.
 
2054
              </P
 
2055
></DD
 
2056
><DT
 
2057
><B
 
2058
>filters</B
 
2059
></DT
 
2060
><DD
 
2061
><P
 
2062
>Specifying this parameter overrides the original
 
2063
                filter properties in the source node.
 
2064
                If specified, it must be an instance of the <SAMP
 
2065
CLASS="computeroutput"
 
2066
>Filters</SAMP
 
2067
>
 
2068
                class (see section <A
 
2069
HREF="x4983.html#FiltersClassDescr"
 
2070
>4.17.1</A
 
2071
>).
 
2072
                The default is to copy the filter attribute
 
2073
                from the source node.
 
2074
              </P
 
2075
></DD
 
2076
><DT
 
2077
><B
 
2078
>copyuserattrs</B
 
2079
></DT
 
2080
><DD
 
2081
><P
 
2082
>You can prevent the user attributes from being copied
 
2083
                by setting this parameter to <SAMP
 
2084
CLASS="computeroutput"
 
2085
>False</SAMP
 
2086
>.
 
2087
                The default is to copy them.
 
2088
              </P
 
2089
></DD
 
2090
><DT
 
2091
><B
 
2092
>start, stop, step</B
 
2093
></DT
 
2094
><DD
 
2095
><P
 
2096
>Specify the range of rows in child leaves to be copied;
 
2097
                the default is to copy all the rows.
 
2098
              </P
 
2099
></DD
 
2100
><DT
 
2101
><B
 
2102
>stats</B
 
2103
></DT
 
2104
><DD
 
2105
><P
 
2106
>This argument may be used to collect statistics
 
2107
                on the copy process.  When used, it should be a dictionary
 
2108
                with keys <SAMP
 
2109
CLASS="computeroutput"
 
2110
>groups</SAMP
 
2111
>, <SAMP
 
2112
CLASS="computeroutput"
 
2113
>leaves</SAMP
 
2114
>
 
2115
                and <SAMP
 
2116
CLASS="computeroutput"
 
2117
>bytes</SAMP
 
2118
> having a numeric value.
 
2119
                Their values will be incremented to reflect the number of
 
2120
                groups, leaves and bytes, respectively,
 
2121
                that have been copied in the operation.
 
2122
              </P
 
2123
></DD
 
2124
></DL
 
2125
></DIV
 
2126
></DIV
 
2127
><DIV
 
2128
CLASS="sect3"
 
2129
><H3
 
2130
CLASS="sect3"
 
2131
><A
 
2132
NAME="subsubsection4.2.2.17"
 
2133
>4.2.2.17. renameNode(where, newname, name=None)</A
 
2134
></H3
 
2135
><A
 
2136
NAME="File.renameNode"
 
2137
></A
 
2138
><P
 
2139
>Change the name of the node specified by <SPAN
 
2140
CLASS="emphasis"
 
2141
><I
 
2142
CLASS="emphasis"
 
2143
>where</I
 
2144
></SPAN
 
2145
> and <SPAN
 
2146
CLASS="emphasis"
 
2147
><I
 
2148
CLASS="emphasis"
 
2149
>name</I
 
2150
></SPAN
 
2151
>
 
2152
              to <SPAN
 
2153
CLASS="emphasis"
 
2154
><I
 
2155
CLASS="emphasis"
 
2156
>newname</I
 
2157
></SPAN
 
2158
>.</P
 
2159
><DIV
 
2160
CLASS="glosslist"
 
2161
><DL
 
2162
><DT
 
2163
><B
 
2164
>where, name</B
 
2165
></DT
 
2166
><DD
 
2167
><P
 
2168
>These arguments work as in <SAMP
 
2169
CLASS="computeroutput"
 
2170
>getNode()</SAMP
 
2171
>
 
2172
                (see <A
 
2173
HREF="x1533.html#File.getNode"
 
2174
>[here]</A
 
2175
>),
 
2176
                referencing the node to be acted upon.
 
2177
              </P
 
2178
></DD
 
2179
><DT
 
2180
><B
 
2181
>newname</B
 
2182
></DT
 
2183
><DD
 
2184
><P
 
2185
>The new name to be assigned to the node (a string).
 
2186
              </P
 
2187
></DD
 
2188
></DL
 
2189
></DIV
 
2190
></DIV
 
2191
><DIV
 
2192
CLASS="sect3"
 
2193
><H3
 
2194
CLASS="sect3"
 
2195
><A
 
2196
NAME="subsubsection4.2.2.18"
 
2197
>4.2.2.18. moveNode(where, newparent=None, newname=None, name=None, overwrite=False)</A
 
2198
></H3
 
2199
><A
 
2200
NAME="File.moveNode"
 
2201
></A
 
2202
><P
 
2203
>Move the node specified by <SPAN
 
2204
CLASS="emphasis"
 
2205
><I
 
2206
CLASS="emphasis"
 
2207
>where</I
 
2208
></SPAN
 
2209
> and <SPAN
 
2210
CLASS="emphasis"
 
2211
><I
 
2212
CLASS="emphasis"
 
2213
>name</I
 
2214
></SPAN
 
2215
>
 
2216
              to <SPAN
 
2217
CLASS="emphasis"
 
2218
><I
 
2219
CLASS="emphasis"
 
2220
>newparent/newname</I
 
2221
></SPAN
 
2222
>.</P
 
2223
><DIV
 
2224
CLASS="glosslist"
 
2225
><DL
 
2226
><DT
 
2227
><B
 
2228
>where, name</B
 
2229
></DT
 
2230
><DD
 
2231
><P
 
2232
>These arguments work as in <SAMP
 
2233
CLASS="computeroutput"
 
2234
>getNode()</SAMP
 
2235
>
 
2236
                (see <A
 
2237
HREF="x1533.html#File.getNode"
 
2238
>[here]</A
 
2239
>),
 
2240
                referencing the node to be acted upon.
 
2241
              </P
 
2242
></DD
 
2243
><DT
 
2244
><B
 
2245
>newparent</B
 
2246
></DT
 
2247
><DD
 
2248
><P
 
2249
>The destination group the node will be moved to
 
2250
                (a path name or a <SAMP
 
2251
CLASS="computeroutput"
 
2252
>Group</SAMP
 
2253
> instance).
 
2254
                If <SPAN
 
2255
CLASS="emphasis"
 
2256
><I
 
2257
CLASS="emphasis"
 
2258
>newparent</I
 
2259
></SPAN
 
2260
> is <SAMP
 
2261
CLASS="computeroutput"
 
2262
>None</SAMP
 
2263
>,
 
2264
                the original node parent is selected as the new parent.
 
2265
              </P
 
2266
></DD
 
2267
><DT
 
2268
><B
 
2269
>newname</B
 
2270
></DT
 
2271
><DD
 
2272
><P
 
2273
>The new name to be assigned to the node in its destination (a string).
 
2274
                If <SPAN
 
2275
CLASS="emphasis"
 
2276
><I
 
2277
CLASS="emphasis"
 
2278
>newname</I
 
2279
></SPAN
 
2280
> is <SAMP
 
2281
CLASS="computeroutput"
 
2282
>None</SAMP
 
2283
> or not specified,
 
2284
                the original node name is used.
 
2285
              </P
 
2286
></DD
 
2287
></DL
 
2288
></DIV
 
2289
></DIV
 
2290
><DIV
 
2291
CLASS="sect3"
 
2292
><H3
 
2293
CLASS="sect3"
 
2294
><A
 
2295
NAME="subsubsection4.2.2.19"
 
2296
>4.2.2.19. walkGroups(where='/')</A
 
2297
></H3
 
2298
><A
 
2299
NAME="walkGroupsDescr"
 
2300
></A
 
2301
><P
 
2302
><SPAN
 
2303
CLASS="emphasis"
 
2304
><I
 
2305
CLASS="emphasis"
 
2306
>Iterator</I
 
2307
></SPAN
 
2308
> that returns the list of Groups (not
 
2309
              Leaves) hanging from (and including) <SPAN
 
2310
CLASS="emphasis"
 
2311
><I
 
2312
CLASS="emphasis"
 
2313
>where</I
 
2314
></SPAN
 
2315
>.
 
2316
              The <SPAN
 
2317
CLASS="emphasis"
 
2318
><I
 
2319
CLASS="emphasis"
 
2320
>where</I
 
2321
></SPAN
 
2322
> Group is listed first (pre-order),
 
2323
              then each of its child Groups (following an
 
2324
              alpha-numerical order) is also traversed, following the
 
2325
              same procedure.  If <SPAN
 
2326
CLASS="emphasis"
 
2327
><I
 
2328
CLASS="emphasis"
 
2329
>where</I
 
2330
></SPAN
 
2331
> is not supplied, the
 
2332
              root object is used.
 
2333
            </P
 
2334
><DIV
 
2335
CLASS="glosslist"
 
2336
><DL
 
2337
><DT
 
2338
><B
 
2339
>where</B
 
2340
></DT
 
2341
><DD
 
2342
><P
 
2343
>The origin group. Can be a
 
2344
                  path string or <SAMP
 
2345
CLASS="computeroutput"
 
2346
>Group</SAMP
 
2347
> instance.
 
2348
                </P
 
2349
></DD
 
2350
></DL
 
2351
></DIV
 
2352
></DIV
 
2353
><DIV
 
2354
CLASS="sect3"
 
2355
><H3
 
2356
CLASS="sect3"
 
2357
><A
 
2358
NAME="subsubsection4.2.2.20"
 
2359
>4.2.2.20. walkNodes(where="/", classname="")</A
 
2360
></H3
 
2361
><A
 
2362
NAME="File.walkNodes"
 
2363
></A
 
2364
><P
 
2365
>Recursively iterate over the nodes in the
 
2366
              <SAMP
 
2367
CLASS="computeroutput"
 
2368
>File</SAMP
 
2369
> instance. It takes two parameters:</P
 
2370
><DIV
 
2371
CLASS="glosslist"
 
2372
><DL
 
2373
><DT
 
2374
><B
 
2375
>where</B
 
2376
></DT
 
2377
><DD
 
2378
><P
 
2379
>If supplied, the iteration
 
2380
              starts from (and includes) this group.</P
 
2381
></DD
 
2382
><DT
 
2383
><B
 
2384
>classname</B
 
2385
></DT
 
2386
><DD
 
2387
><P
 
2388
><SPAN
 
2389
CLASS="emphasis"
 
2390
><I
 
2391
CLASS="emphasis"
 
2392
>(String)</I
 
2393
></SPAN
 
2394
> If
 
2395
              supplied, only instances of this class are
 
2396
              returned.</P
 
2397
></DD
 
2398
></DL
 
2399
></DIV
 
2400
><P
 
2401
>Example of use:</P
 
2402
><PRE
 
2403
CLASS="screen"
 
2404
>&#13;        # Recursively print all the nodes hanging from '/detector'
 
2405
              print "Nodes hanging from group '/detector':"
 
2406
              for node in h5file.walkNodes("/detector"):
 
2407
                  print node
 
2408
            </PRE
 
2409
></DIV
 
2410
><DIV
 
2411
CLASS="sect3"
 
2412
><H3
 
2413
CLASS="sect3"
 
2414
><A
 
2415
NAME="subsubsection4.2.2.21"
 
2416
>4.2.2.21. copyChildren(srcgroup, dstgroup,
 
2417
              overwrite=False, recursive=False, **kwargs)</A
 
2418
></H3
 
2419
><A
 
2420
NAME="File.copyChildren"
 
2421
></A
 
2422
><P
 
2423
>Copy the children of a group into another group.</P
 
2424
><P
 
2425
>This method copies the nodes hanging from the source group <SAMP
 
2426
CLASS="computeroutput"
 
2427
>srcgroup</SAMP
 
2428
>
 
2429
              into the destination group <SAMP
 
2430
CLASS="computeroutput"
 
2431
>dstgroup</SAMP
 
2432
>.
 
2433
              Existing destination nodes can be replaced by asserting
 
2434
              the <SAMP
 
2435
CLASS="computeroutput"
 
2436
>overwrite</SAMP
 
2437
> argument.
 
2438
              If the <SAMP
 
2439
CLASS="computeroutput"
 
2440
>recursive</SAMP
 
2441
> argument is true,
 
2442
              all descendant nodes of <SAMP
 
2443
CLASS="computeroutput"
 
2444
>srcnode</SAMP
 
2445
> are recursively copied.
 
2446
            </P
 
2447
><P
 
2448
><SAMP
 
2449
CLASS="computeroutput"
 
2450
>kwargs</SAMP
 
2451
> takes keyword arguments used to customize
 
2452
              the copying process.
 
2453
              See the documentation of <SAMP
 
2454
CLASS="computeroutput"
 
2455
>Group._f_copyChildren()</SAMP
 
2456
>
 
2457
              (see <A
 
2458
HREF="x2546.html#Group._f_copyChildren"
 
2459
>4.4.2</A
 
2460
>)
 
2461
              for a description of those arguments.
 
2462
            </P
 
2463
></DIV
 
2464
><DIV
 
2465
CLASS="sect3"
 
2466
><H3
 
2467
CLASS="sect3"
 
2468
><A
 
2469
NAME="subsubsection4.2.2.22"
 
2470
>4.2.2.22. copyFile(dstfilename, overwrite=False, **kwargs)</A
 
2471
></H3
 
2472
><A
 
2473
NAME="File.copyFile"
 
2474
></A
 
2475
><P
 
2476
>Copy the contents of this file to <SAMP
 
2477
CLASS="computeroutput"
 
2478
>dstfilename</SAMP
 
2479
>.</P
 
2480
><P
 
2481
><SAMP
 
2482
CLASS="computeroutput"
 
2483
>dstfilename</SAMP
 
2484
> must be a path string
 
2485
              indicating the name of the destination file.  If it
 
2486
              already exists, the copy will fail with an
 
2487
              <SAMP
 
2488
CLASS="computeroutput"
 
2489
>IOError</SAMP
 
2490
>, unless the <SAMP
 
2491
CLASS="computeroutput"
 
2492
>overwrite</SAMP
 
2493
>
 
2494
              argument is true, in which case the destination file
 
2495
              will be overwritten in place. In this last case, the
 
2496
              destination file should be closed or ugly errors will
 
2497
              happen.
 
2498
            </P
 
2499
><P
 
2500
>Additional keyword arguments may be passed to customize the copying process.
 
2501
              For instance, title and filters may be changed,
 
2502
              user attributes may be or may not be copied, data may be sub-sampled,
 
2503
              stats may be collected, etc.
 
2504
              Arguments unknown to nodes are simply ignored.
 
2505
              Check the documentation for copying operations of nodes
 
2506
              to see which options they support.
 
2507
            </P
 
2508
><P
 
2509
>Copying a file usually has the beneficial side effect
 
2510
              of creating a more compact and cleaner version of the original file.
 
2511
            </P
 
2512
></DIV
 
2513
><DIV
 
2514
CLASS="sect3"
 
2515
><H3
 
2516
CLASS="sect3"
 
2517
><A
 
2518
NAME="subsubsection4.2.2.23"
 
2519
>4.2.2.23. flush()</A
 
2520
></H3
 
2521
><P
 
2522
>Flush all the leaves in the object tree.
 
2523
            </P
 
2524
></DIV
 
2525
><DIV
 
2526
CLASS="sect3"
 
2527
><H3
 
2528
CLASS="sect3"
 
2529
><A
 
2530
NAME="subsubsection4.2.2.24"
 
2531
>4.2.2.24. close()</A
 
2532
></H3
 
2533
><P
 
2534
>Flush all the leaves in object tree and close the file.
 
2535
            </P
 
2536
></DIV
 
2537
><DIV
 
2538
CLASS="sect3"
 
2539
><H3
 
2540
CLASS="sect3"
 
2541
><A
 
2542
NAME="subsubsection4.2.2.25"
 
2543
>4.2.2.25. Undo/Redo support</A
 
2544
></H3
 
2545
><DIV
 
2546
CLASS="glosslist"
 
2547
><DL
 
2548
><DT
 
2549
><B
 
2550
>&#13;          isUndoEnabled()
 
2551
              </B
 
2552
></DT
 
2553
><DD
 
2554
><P
 
2555
>&#13;          </P
 
2556
><P
 
2557
>Is the Undo/Redo mechanism enabled?</P
 
2558
><P
 
2559
> </P
 
2560
><P
 
2561
>Returns
 
2562
                <SAMP
 
2563
CLASS="computeroutput"
 
2564
>True</SAMP
 
2565
> if the Undo/Redo mechanism has been
 
2566
                enabled for this file, <SAMP
 
2567
CLASS="computeroutput"
 
2568
>False</SAMP
 
2569
> otherwise.
 
2570
                Please, note that this mechanism is persistent, so a
 
2571
                newly opened PyTables file may already have Undo/Redo
 
2572
                support.
 
2573
                </P
 
2574
><P
 
2575
>&#13;        </P
 
2576
></DD
 
2577
><DT
 
2578
><B
 
2579
>&#13;          enableUndo(filters=Filters(complevel=1))
 
2580
              </B
 
2581
></DT
 
2582
><DD
 
2583
><P
 
2584
>&#13;          </P
 
2585
><P
 
2586
>Enable the Undo/Redo mechanism.</P
 
2587
><P
 
2588
>&#13;          </P
 
2589
><P
 
2590
>This operation prepares the database for undoing and redoing
 
2591
                  modifications in the node hierarchy.
 
2592
                  This allows <SAMP
 
2593
CLASS="computeroutput"
 
2594
>mark()</SAMP
 
2595
>, <SAMP
 
2596
CLASS="computeroutput"
 
2597
>undo()</SAMP
 
2598
>,
 
2599
                  <SAMP
 
2600
CLASS="computeroutput"
 
2601
>redo()</SAMP
 
2602
> and other methods to be called.
 
2603
                </P
 
2604
><P
 
2605
>&#13;          </P
 
2606
><P
 
2607
>The <SAMP
 
2608
CLASS="computeroutput"
 
2609
>filters</SAMP
 
2610
> argument, when specified,
 
2611
                  must be an instance of class <SAMP
 
2612
CLASS="computeroutput"
 
2613
>Filters</SAMP
 
2614
>
 
2615
                  (see <A
 
2616
HREF="x4983.html#FiltersClassDescr"
 
2617
>section�4.17.1</A
 
2618
>)
 
2619
                  and is meant for setting the compression values for
 
2620
                  the action log. The default is having compression
 
2621
                  enabled, as the gains in terms of space can be
 
2622
                  considerable. You may want to disable compression if
 
2623
                  you want maximum speed for Undo/Redo operations.
 
2624
                </P
 
2625
><P
 
2626
>&#13;          </P
 
2627
><P
 
2628
>Calling <SAMP
 
2629
CLASS="computeroutput"
 
2630
>enableUndo()</SAMP
 
2631
> when the
 
2632
                  Undo/Redo mechanism is already enabled raises an
 
2633
                  <SAMP
 
2634
CLASS="computeroutput"
 
2635
>UndoRedoError</SAMP
 
2636
>.</P
 
2637
><P
 
2638
>&#13;        </P
 
2639
></DD
 
2640
><DT
 
2641
><B
 
2642
>&#13;          disableUndo()
 
2643
              </B
 
2644
></DT
 
2645
><DD
 
2646
><P
 
2647
>&#13;          </P
 
2648
><P
 
2649
>Disable the Undo/Redo mechanism.</P
 
2650
><P
 
2651
>&#13;
 
2652
                </P
 
2653
><P
 
2654
>Disabling the Undo/Redo mechanism leaves the
 
2655
                  database in the current state and forgets past and
 
2656
                  future database states.  This makes
 
2657
                  <SAMP
 
2658
CLASS="computeroutput"
 
2659
>mark()</SAMP
 
2660
>, <SAMP
 
2661
CLASS="computeroutput"
 
2662
>undo()</SAMP
 
2663
>,
 
2664
                  <SAMP
 
2665
CLASS="computeroutput"
 
2666
>redo()</SAMP
 
2667
> and other methods fail with an
 
2668
                  <SAMP
 
2669
CLASS="computeroutput"
 
2670
>UndoRedoError</SAMP
 
2671
>.
 
2672
                </P
 
2673
><P
 
2674
>&#13;
 
2675
                </P
 
2676
><P
 
2677
>Calling <SAMP
 
2678
CLASS="computeroutput"
 
2679
>disableUndo()</SAMP
 
2680
> when the
 
2681
                  Undo/Redo mechanism is already disabled raises an
 
2682
                  <SAMP
 
2683
CLASS="computeroutput"
 
2684
>UndoRedoError</SAMP
 
2685
>.
 
2686
                </P
 
2687
><P
 
2688
>&#13;        </P
 
2689
></DD
 
2690
><DT
 
2691
><B
 
2692
>&#13;          mark(name=None)
 
2693
              </B
 
2694
></DT
 
2695
><DD
 
2696
><P
 
2697
>&#13;          </P
 
2698
><P
 
2699
>Mark the state of the database.</P
 
2700
><P
 
2701
>&#13;          </P
 
2702
><P
 
2703
>Creates a mark for the current state of the database.
 
2704
                  A unique (and immutable) identifier for the mark is returned.
 
2705
                  An optional <SAMP
 
2706
CLASS="computeroutput"
 
2707
>name</SAMP
 
2708
> (a string) can be assigned to the mark.
 
2709
                  Both the identifier of a mark and its name can be used
 
2710
                  in <SAMP
 
2711
CLASS="computeroutput"
 
2712
>undo()</SAMP
 
2713
> and <SAMP
 
2714
CLASS="computeroutput"
 
2715
>redo()</SAMP
 
2716
> operations.
 
2717
                  When the <SAMP
 
2718
CLASS="computeroutput"
 
2719
>name</SAMP
 
2720
> has already been used for another mark,
 
2721
                  an <SAMP
 
2722
CLASS="computeroutput"
 
2723
>UndoRedoError</SAMP
 
2724
> is raised.
 
2725
                </P
 
2726
><P
 
2727
>&#13;          </P
 
2728
><P
 
2729
>This method can only be called when the Undo/Redo mechanism
 
2730
                  has been enabled.
 
2731
                  Otherwise, an <SAMP
 
2732
CLASS="computeroutput"
 
2733
>UndoRedoError</SAMP
 
2734
> is raised.
 
2735
                </P
 
2736
><P
 
2737
>&#13;        </P
 
2738
></DD
 
2739
><DT
 
2740
><B
 
2741
>&#13;          getCurrentMark()
 
2742
              </B
 
2743
></DT
 
2744
><DD
 
2745
><P
 
2746
>&#13;          </P
 
2747
><P
 
2748
>Get the identifier of the current mark.</P
 
2749
><P
 
2750
>&#13;          </P
 
2751
><P
 
2752
>Returns the identifier of the current mark.
 
2753
                  This can be used to know the state of a database
 
2754
                  after an application crash,
 
2755
                  or to get the identifier of the initial implicit mark
 
2756
                  after a call to <SAMP
 
2757
CLASS="computeroutput"
 
2758
>enableUndo()</SAMP
 
2759
>.
 
2760
                </P
 
2761
><P
 
2762
>&#13;          </P
 
2763
><P
 
2764
>This method can only be called when the Undo/Redo mechanism
 
2765
                  has been enabled.
 
2766
                  Otherwise, an <SAMP
 
2767
CLASS="computeroutput"
 
2768
>UndoRedoError</SAMP
 
2769
> is raised.
 
2770
                </P
 
2771
><P
 
2772
>&#13;        </P
 
2773
></DD
 
2774
><DT
 
2775
><B
 
2776
>&#13;          undo(mark=None)
 
2777
              </B
 
2778
></DT
 
2779
><DD
 
2780
><P
 
2781
>&#13;          </P
 
2782
><P
 
2783
>Go to a past state of the database.</P
 
2784
><P
 
2785
>&#13;          </P
 
2786
><P
 
2787
>Returns the database to the state associated with
 
2788
                  the specified <SAMP
 
2789
CLASS="computeroutput"
 
2790
>mark</SAMP
 
2791
>.
 
2792
                  Both the identifier of a mark and its name can be used.
 
2793
                  If the <SAMP
 
2794
CLASS="computeroutput"
 
2795
>mark</SAMP
 
2796
> is omitted, the last created mark is used.
 
2797
                  If there are no past marks, or the specified <SAMP
 
2798
CLASS="computeroutput"
 
2799
>mark</SAMP
 
2800
>
 
2801
                  is not older than the current one,
 
2802
                  an <SAMP
 
2803
CLASS="computeroutput"
 
2804
>UndoRedoError</SAMP
 
2805
> is raised.
 
2806
                </P
 
2807
><P
 
2808
>&#13;          </P
 
2809
><P
 
2810
>This method can only be called when the Undo/Redo mechanism
 
2811
                  has been enabled.
 
2812
                  Otherwise, an <SAMP
 
2813
CLASS="computeroutput"
 
2814
>UndoRedoError</SAMP
 
2815
> is raised.
 
2816
                </P
 
2817
><P
 
2818
>&#13;        </P
 
2819
></DD
 
2820
><DT
 
2821
><B
 
2822
>&#13;          redo(mark=None)
 
2823
              </B
 
2824
></DT
 
2825
><DD
 
2826
><P
 
2827
>&#13;          </P
 
2828
><P
 
2829
>Go to a future state of the database.</P
 
2830
><P
 
2831
>&#13;          </P
 
2832
><P
 
2833
>Returns the database to the state associated with
 
2834
                  the specified <SAMP
 
2835
CLASS="computeroutput"
 
2836
>mark</SAMP
 
2837
>.
 
2838
                  Both the identifier of a mark and its name can be used.
 
2839
                  If the <SAMP
 
2840
CLASS="computeroutput"
 
2841
>mark</SAMP
 
2842
> is omitted, the next created mark is used.
 
2843
                  If there are no future marks, or the specified <SAMP
 
2844
CLASS="computeroutput"
 
2845
>mark</SAMP
 
2846
>
 
2847
                  is not newer than the current one,
 
2848
                  an <SAMP
 
2849
CLASS="computeroutput"
 
2850
>UndoRedoError</SAMP
 
2851
> is raised.
 
2852
                </P
 
2853
><P
 
2854
>&#13;          </P
 
2855
><P
 
2856
>This method can only be called when the Undo/Redo mechanism
 
2857
                  has been enabled.
 
2858
                  Otherwise, an <SAMP
 
2859
CLASS="computeroutput"
 
2860
>UndoRedoError</SAMP
 
2861
> is raised.
 
2862
                </P
 
2863
><P
 
2864
>&#13;        </P
 
2865
></DD
 
2866
><DT
 
2867
><B
 
2868
>&#13;          goto(mark)
 
2869
              </B
 
2870
></DT
 
2871
><DD
 
2872
><P
 
2873
>&#13;          </P
 
2874
><P
 
2875
>Go to a specific mark of the database.</P
 
2876
><P
 
2877
>&#13;          </P
 
2878
><P
 
2879
>Returns the database to the state associated with
 
2880
                  the specified <SAMP
 
2881
CLASS="computeroutput"
 
2882
>mark</SAMP
 
2883
>.
 
2884
                  Both the identifier of a mark and its name can be used.
 
2885
                </P
 
2886
><P
 
2887
>&#13;          </P
 
2888
><P
 
2889
>This method can only be called when the Undo/Redo mechanism
 
2890
                  has been enabled.
 
2891
                  Otherwise, an <SAMP
 
2892
CLASS="computeroutput"
 
2893
>UndoRedoError</SAMP
 
2894
> is raised.
 
2895
                </P
 
2896
><P
 
2897
>&#13;        </P
 
2898
></DD
 
2899
></DL
 
2900
></DIV
 
2901
></DIV
 
2902
></DIV
 
2903
><DIV
 
2904
CLASS="sect2"
 
2905
><H2
 
2906
CLASS="sect2"
 
2907
><A
 
2908
NAME="subsection4.2.3"
 
2909
>4.2.3. <SPAN
 
2910
CLASS="markup"
 
2911
>File</SPAN
 
2912
> special
 
2913
              methods</A
 
2914
></H2
 
2915
><P
 
2916
>Following are described the methods that automatically
 
2917
            trigger actions when a <SAMP
 
2918
CLASS="computeroutput"
 
2919
>File</SAMP
 
2920
> instance is
 
2921
            accessed in a special way.
 
2922
          </P
 
2923
><DIV
 
2924
CLASS="sect3"
 
2925
><H3
 
2926
CLASS="sect3"
 
2927
><A
 
2928
NAME="subsubsection4.2.3.1"
 
2929
>4.2.3.1. __contains__(path)</A
 
2930
></H3
 
2931
><A
 
2932
NAME="File.__contains__"
 
2933
></A
 
2934
><P
 
2935
>Is there a node with that <SPAN
 
2936
CLASS="emphasis"
 
2937
><I
 
2938
CLASS="emphasis"
 
2939
>path</I
 
2940
></SPAN
 
2941
>?</P
 
2942
><P
 
2943
>Returns <SAMP
 
2944
CLASS="computeroutput"
 
2945
>True</SAMP
 
2946
> if the file has a node
 
2947
              with the given <SPAN
 
2948
CLASS="emphasis"
 
2949
><I
 
2950
CLASS="emphasis"
 
2951
>path</I
 
2952
></SPAN
 
2953
> (a string),
 
2954
              <SAMP
 
2955
CLASS="computeroutput"
 
2956
>False</SAMP
 
2957
> otherwise.
 
2958
            </P
 
2959
></DIV
 
2960
><DIV
 
2961
CLASS="sect3"
 
2962
><H3
 
2963
CLASS="sect3"
 
2964
><A
 
2965
NAME="subsubsection4.2.3.2"
 
2966
>4.2.3.2. __iter__()</A
 
2967
></H3
 
2968
><A
 
2969
NAME="File.__iter__"
 
2970
></A
 
2971
><P
 
2972
>Iterate over the children on the <SAMP
 
2973
CLASS="computeroutput"
 
2974
>File</SAMP
 
2975
>
 
2976
              instance. However, this does not accept parameters. This
 
2977
              iterator <SPAN
 
2978
CLASS="emphasis"
 
2979
><I
 
2980
CLASS="emphasis"
 
2981
>is recursive</I
 
2982
></SPAN
 
2983
>.</P
 
2984
><P
 
2985
>Example of use:</P
 
2986
><PRE
 
2987
CLASS="screen"
 
2988
>&#13;        # Recursively list all the nodes in the object tree
 
2989
              h5file = tables.openFile("vlarray1.h5")
 
2990
              print "All nodes in the object tree:"
 
2991
              for node in h5file:
 
2992
                  print node
 
2993
            </PRE
 
2994
></DIV
 
2995
><DIV
 
2996
CLASS="sect3"
 
2997
><H3
 
2998
CLASS="sect3"
 
2999
><A
 
3000
NAME="subsubsection4.2.3.3"
 
3001
>4.2.3.3. __str__()</A
 
3002
></H3
 
3003
><A
 
3004
NAME="File.__str__"
 
3005
></A
 
3006
><P
 
3007
>Prints a short description of the <SAMP
 
3008
CLASS="computeroutput"
 
3009
>File</SAMP
 
3010
>
 
3011
              object.</P
 
3012
><P
 
3013
>Example of use:</P
 
3014
><PRE
 
3015
CLASS="screen"
 
3016
>&#13;&#62;&#62;&#62; f=tables.openFile("data/test.h5")
 
3017
&#62;&#62;&#62; print f
 
3018
data/test.h5 (File) 'Table Benchmark'
 
3019
Last modif.: 'Mon Sep 20 12:40:47 2004'
 
3020
Object Tree:
 
3021
/ (Group) 'Table Benchmark'
 
3022
/tuple0 (Table(100L,)) 'This is the table title'
 
3023
/group0 (Group) ''
 
3024
/group0/tuple1 (Table(100L,)) 'This is the table title'
 
3025
/group0/group1 (Group) ''
 
3026
/group0/group1/tuple2 (Table(100L,)) 'This is the table title'
 
3027
/group0/group1/group2 (Group) ''
 
3028
            </PRE
 
3029
></DIV
 
3030
><DIV
 
3031
CLASS="sect3"
 
3032
><H3
 
3033
CLASS="sect3"
 
3034
><A
 
3035
NAME="subsubsection4.2.3.4"
 
3036
>4.2.3.4. __repr__()</A
 
3037
></H3
 
3038
><A
 
3039
NAME="File.__repr__"
 
3040
></A
 
3041
><P
 
3042
>Prints a detailed description of the <SAMP
 
3043
CLASS="computeroutput"
 
3044
>File</SAMP
 
3045
>
 
3046
              object.</P
 
3047
></DIV
 
3048
></DIV
 
3049
></DIV
 
3050
><DIV
 
3051
CLASS="NAVFOOTER"
 
3052
><HR
 
3053
ALIGN="LEFT"
 
3054
WIDTH="100%"><TABLE
 
3055
SUMMARY="Footer navigation table"
 
3056
WIDTH="100%"
 
3057
BORDER="0"
 
3058
CELLPADDING="0"
 
3059
CELLSPACING="0"
 
3060
><TR
 
3061
><TD
 
3062
WIDTH="33%"
 
3063
ALIGN="left"
 
3064
VALIGN="top"
 
3065
><A
 
3066
HREF="c1381.html"
 
3067
ACCESSKEY="P"
 
3068
>Prev</A
 
3069
></TD
 
3070
><TD
 
3071
WIDTH="34%"
 
3072
ALIGN="center"
 
3073
VALIGN="top"
 
3074
><A
 
3075
HREF="index.html"
 
3076
ACCESSKEY="H"
 
3077
>Home</A
 
3078
></TD
 
3079
><TD
 
3080
WIDTH="33%"
 
3081
ALIGN="right"
 
3082
VALIGN="top"
 
3083
><A
 
3084
HREF="x2341.html"
 
3085
ACCESSKEY="N"
 
3086
>Next</A
 
3087
></TD
 
3088
></TR
 
3089
><TR
 
3090
><TD
 
3091
WIDTH="33%"
 
3092
ALIGN="left"
 
3093
VALIGN="top"
 
3094
>Library Reference</TD
 
3095
><TD
 
3096
WIDTH="34%"
 
3097
ALIGN="center"
 
3098
VALIGN="top"
 
3099
><A
 
3100
HREF="c1381.html"
 
3101
ACCESSKEY="U"
 
3102
>Up</A
 
3103
></TD
 
3104
><TD
 
3105
WIDTH="33%"
 
3106
ALIGN="right"
 
3107
VALIGN="top"
 
3108
>The <SPAN
 
3109
CLASS="markup"
 
3110
>Node</SPAN
 
3111
> class</TD
 
3112
></TR
 
3113
></TABLE
 
3114
></DIV
 
3115
></BODY
 
3116
></HTML
 
3117
>
 
 
b'\\ No newline at end of file'