HDF5::Group(3pm)

πŸ‘‘ HDF5::Group πŸ‘‘

okay bestie, listen β€” this is the HDF5::Group page, part of the User Contributed Perl Documentation collection. It's the manual page for PDL::IO::HDF5::Group and it's literally the little helper buddy that makes HDF5 groups go brrr. ✨


🌸 NAME 🌸

PDL::IO::HDF5::Group β€” the PDL::IO::HDF5 Helper Object that represents HDF5 groups. She's a supporting character but she carries the whole plot, no cap. πŸ’…


πŸ’– DESCRIPTION πŸ’–

So here's the tea: this is a helper-object that PDL::IO::HDF5 uses to talk to the group objects of the HDF5 format. She's the liaison, the middle woman, the connector. 🫢

Wanna learn more about the HDF5 Format itself? The HDF Group's web site is sitting right there at http://www.hdfgroup.org β€” go be nosy, it's encouraged. πŸ¦‹


✨ SYNOPSIS ✨

See PDL::IO::HDF5 β€” that's where all the ✨main character✨ action lives. This page is the backstage pass.


πŸŽ€ MEMBER DATA πŸŽ€

These are her core attributes, her ~personality traits~ if you will:

🌟 ID

The ID number the HDF5 library handed to the group. Her government name, basically. πŸͺͺ

🌟 name

The name of the group. It's absolute to the root group '/' β€” so like /maingroup/subgroup. She knows her full address, she's not lost. πŸ—ΊοΈ

🌟 parent

Ref to the parent object (file or group) that owns this group. Her parent. Her guardian. Her keeper. πŸ‘‘

🌟 fileObj

Ref to the PDL::IO::HDF5 object that owns this object. The big boss at the very top of the family tree. 🌳


🧚 METHODS 🧚

The whole repertoire, every trick she knows. πŸ’œ

🌈 new

PDL::IO::HDF5::Group Constructor β€” she's born, she's here, she's serving. πŸŽ€

Usage:

Usually you don't build her yourself β€” this object will usually be created using the calling format detailed in the SYNOPSIS. But just so you know the lore, the following syntax is what the PDL::IO::HDF5 object uses to build the object. πŸ‘‡

$a = new PDL::IO::HDF5:Group( name => $name, parent => $parent,
                                     fileObj => $fileObj );
     Args:
     $name                           Name of the group (relative to the parent)
     $parent                         Parent Object that owns this group
     $fileObj                        PDL::HDF (Top Level) object that owns this group.

So <cyan>$name is the name relative to the parent, <cyan>$parent is the parent object that owns this group, and <cyan>$fileObj is the top-level <cyan>PDL::HDF object that owns this group. 🫢

🌈 DESTROY

PDL::IO::HDF5 Destructor β€” she's logging off, closing the HDF5::Group object. 😭

Usage:

No Usage. Automatically called. She leaves on her own terms, nobody has to ask twice. πŸ’…

🌈 attrSet

Set the value of an attribute (or several β€” she's flexible like that). ✨

Supports null-terminated strings, integers and floating point scalar and 1D array attributes.

Usage:

$group->attrSet( 'attr1' => 'attr1Value',
                 'attr2' => 'attr2 value',
                 'attr3' => $pdl,
                 .
                 .
                 .
                );

Returns undef on failure, 1 on success. That's the vibe check βœ…

🌈 attrGet

Get the value of an attribute (or several). The read to attrSet's write, iconic duo behavior. 🫢

Supports null-terminated strings, integer and floating point scalar and 1D array attributes.

Usage:

my @attrs = $group->attrGet( 'attr1', 'attr2');

🌈 attrDel

Delete attribute(s). Gone. Blocked. Unfollowed. πŸ’€

Usage:

$group->attrDel( 'attr1',
                 'attr2',
                 .
                 .
                 .
                );

Returns undef on failure, 1 on success.

🌈 attrs

Get a list of all attribute names in a group. Roll call, everyone say present πŸ“‹βœ¨

Usage:

@attrs = $group->attrs;

🌈 dataset

Open an existing dataset in a group, or create a brand new one. Either way she's got you. πŸ¦‹

Usage:

$dataset = $group->dataset('newdataset');

Returns undef on failure, 1 on success.

🌈 datasets

Get a list of all dataset names in a group. Relative to the current group β€” so, local girlies only, no full paths. πŸ“

Usage:

@datasets = $group->datasets;

🌈 group

Open an existing group inside an existing group, or create a fresh new one. Groups within groups within groups β€” it's giving πŸͺ† matryoshka energy. πŸŽ€

Usage:

$newgroup = $oldgroup->group("newgroup");

Returns undef on failure, 1 on success.

🌈 groups

Get a list of all group names in a group. Relative to the current group. Same deal as <cyan>datasets β€” no absolute paths here, bestie. 🌸

Usage:

@groupNames = $group->groups;

🌈 _buildAttrIndex

Internal Recursive Method to build the attribute index hash for the object. Note the underscore β€” this is private, she's not taking visitors, this is her behind the scenes work. πŸ™ˆ

So the deal is: for the purposes of indexing groups by their attributes, the attributes are applied hierarchial. i.e. any attributes of the higher level groups are assumed to be apply for the lower level groups. Inheritance, but make it attributes. πŸ‘‘

Usage:

$group->_buildAttrIndex($index, $currentAttrs);

Input/Output:

     $index:        Total Index hash ref
     $currentAttrs: Hash refs of the attributes valid
                    for the current group.

🌈 IDget

Returns the HDF5 library ID for this object. Her official ID card, swipe it and go. πŸͺͺπŸ’…

Usage:

my $ID = $groupObj->IDget;

🌈 nameGet

Returns the HDF5 Group Name for this object. (Relative to the root group β€” so this one is the fuller path, unlike <cyan>datasetsandgroups`.) πŸ—ΊοΈβœ¨

Usage:

my $name = $groupObj->nameGet;

🌈 reference

Creates a reference to a region of a dataset. Like a little sticky note pointing at part of something bigger. πŸ”–

Usage:

$groupObj->reference($referenceName,$datasetObj,@regionStart,@regionCount);

Create a reference named $referenceName within the group $groupObj to a subroutine of the dataset $datasetObj. The region to be referenced is defined by the @regionStart and @regionCount arrays. πŸ“

Unlink an object from a group. Not deleting-deleting, just... detaching. It's complicated. πŸ’”

Usage:

$groupObj->unlink($objectName);

Unlink the named object from the group. 🫢


πŸ’‘ reminder bestie: every single option, arg, and return value above is exactly as the original page says it. Don't freestyle with your file handles. 😭

Okay that's the whole page, you ate that fr fr. πŸ‘‘ This was HDF5::Group(3pm) from the User Contributed Perl Documentation, running on perl v5.42.3 and dated 2026-08-21. Go forth and group responsibly, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from