WrightTools.collection.Collection
- class WrightTools.collection.Collection(*args, **kwargs)[source]
Nestable Collection of Data objects.
- __init__(file=None, parent=None, name=None, **kwargs)
Create a new Group object by binding to a low-level GroupID.
Methods
__init__
([file, parent, name])Create a new Group object by binding to a low-level GroupID.
build_virtual_dataset
(name, shape, dtype[, ...])Assemble a virtual dataset in this group.
clear
()close
()Close the file that contains the Group.
convert
(units[, convert_variables, verbose])Convert units of a collection.
copy
([parent, name, verbose])Create a copy under parent.
create_collection
([name, position])Create a new child colleciton.
create_data
([name, position])Create a new child data.
create_dataset
(name[, shape, dtype, data])Create a new HDF5 dataset
create_dataset_like
(name, other, **kwupdate)Create a dataset similar to other.
create_group
(name[, track_order])Create and return a new subgroup.
create_virtual_dataset
(name, layout[, fillvalue])Create a new virtual dataset in this group.
flush
()Ensure contents are written to file.
get
(name[, default, getclass, getlink])Retrieve an item or other information.
index
()Index.
items
()Get a view object on member items
keys
()Get a view object on member names
move
(source, dest)Move a link to a new location in the file.
pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
()as a 2-tuple; but raise KeyError if D is empty.
print_tree
([depth, verbose])Print a ascii-formatted tree representation of the collection contents.
require_dataset
(name, shape, dtype[, exact])Open a dataset, creating it if it doesn't exist.
require_group
(name)Return a group, creating it if it doesn't exist.
save
([filepath, overwrite, verbose])Save as root of a new file.
setdefault
(k[,d])update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
()Get a view object on member objects
visit
(func)Recursively visit all names in this group and subgroups.
visit_links
(func)Recursively visit all names in this group and subgroups.
visititems
(func)Recursively visit names and objects in this group.
visititems_links
(func)Recursively visit links in this group.
Attributes
Attributes attached to this object
Return a File instance associated with this object
file and internal structure.
id
Low-level identifier appropriate for this object
Item names.
Return the full name of this object.
Natural name.
Parent.
ref
An (opaque) HDF5 reference to this object
regionref
Create a region reference (Datasets only).