Merge pull request #1073 from jtramm/hdf5_legacy_fix

Hdf5 legacy fix
This commit is contained in:
Paul Romano 2018-09-15 10:12:14 -05:00 committed by GitHub
commit 763eca37c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,15 @@ Reaction::Reaction(hid_t group, const std::vector<int>& temperatures)
int tmp;
read_attribute(group, "center_of_mass", tmp);
scatter_in_cm_ = (tmp == 1);
read_attribute(group, "redundant", tmp);
redundant_ = (tmp == 1);
// Checks if redudant attribute exists before loading
// (for compatibiltiy with legacy .h5 libraries)
if (attribute_exists(group, "redundant")) {
read_attribute(group, "redundant", tmp);
redundant_ = (tmp == 1);
} else {
redundant_ = false;
}
// Read cross section and threshold_idx data
for (auto t : temperatures) {