Discussion:
[Pdl-porters] PDL::IO::HDF5 Test suite
Richard Balint
2014-08-21 01:06:20 UTC
Permalink
First, I would like to apologize for my double message earlier. You'd think
I'd never used a mailing list before. :(

Second, is our standard for indentation 2 spaces? Or tabs? What about
cuddled braces and other syntactical nuances for the PDL projects?

Thirdly (and most importantly), I believe there to be errors in two of the
test scripts/data that the current distribution uses.

1) vlenString.t
Test code looks good, but it doesn't test
###### Now check variable-length string attribute scalar ###
because the varlen.hdf5 supplied has "attr2" as a null-terminated string
rather than a variable-length string, like the array of varstring
attributes on Attr1.

* Suggested resolution: fix the varlen.hdf5 to use all var-len strings.

2) ztotal_index.t
a) _buildAttrIndex() only indexes attributes on groups, not on datasets.
* Suggested resolution: traverse root, all groups, and all datasets for
complete caching. Possibly change behaviour via an optional %options? (say
to only do groups or only datasets)

b) The indexing on master is showing results for attributes on groups that
don't have such attributes.

Example 1: the attrIndex "expected" is:
my $baseline =
q!{
/ => {
attr1 => dudeman23,
attr2 => What??,
}
/dude2 => {
attr1 => dudeman23,
attr2 => What??,
}
/mygroup => {
attr1 => dudeman23,
attr2 => What??,
}
/mygroup/subgroup => {
attr1 => dudeman23,
attr2 => What??,
}
}
!;

But if you look in the HDF5 file with h5ls -drv total.hdf5:
/ has attr1,attr2 [correct]
/charData dataset has no attributes [correct]
/dude2 has no attributes [TEST wrong]
/mygroup has attr1,attr2 [correct]
/mygroup/subgroup has no attributes [TEST wrong]
/mygroup/subgroup/my dataset2 has attr1,attr2 [NOT LISTED in test]
/rootdataset has no attributes [correct]

Example 2: the allAttrValues "expected" is:
my $baseline =
q![
dudeman23,
dudeman23,
dudeman23,
dudeman23,
]
!;
When there are only two "attr1" values attached to groups. The one
attached to the dataset is missing as well.

...
...
And pretty much wrong across the board, even though all tests pass on
master (incorrectly).


May I have permission to re-write and re-work the caching and tests?
(Since I have to re-implement that properly anyway). My biggest question
is do we only cache attributes on groups, or on all elements, or control
with %options? If options, what is the default?

Loading...