<commit_before>#include "H5Array.hh"
#include <boost/make_shared.hpp>
#include <algorithm>
// Scidb
#include "array/Metadata.h"
// Package
#include "arrayCommon.hh"

class dimConvert {
public:
    scidb::DimensionDesc operator()(ScidbDimLite const& dim) {
        return scidb::DimensionDesc(dim.name, dim.min, dim.start, 
                                    dim.end, dim.max,
                                    dim.chunkInterval, dim.chunkOverlap, 
                                    dim.typeId, dim.arrayName);
    }
};

class attConvert {
public:
    scidb::AttributeDesc operator()(ScidbAttrLite const& att) {
        return scidb::AttributeDesc(0, // Blank attribute id.
                                    att.name, att.typeId,
                                    0, // Flags
                                    0 // default compression method
                                    );
    }
};

void convertInto(scidb::Attributes& sAtts, SalVector const& atts) {
    sAtts.clear();
    std::transform(atts.begin(), atts.end(), sAtts.begin(), attConvert());
}

void convertInto(scidb::Dimensions& sDims, SdlVector const& dims) {
    sDims.clear();
    std::transform(dims.begin(), dims.end(), sDims.begin(), dimConvert());
}

boost::shared_ptr<scidb::ArrayDesc> 
H5Array::ScidbIface::getArrayDesc(H5Array const& h) {
    std::string name("Unknown");
    scidb::Attributes sAtts;
    scidb::Dimensions sDims;
    convertInto(sAtts, *h.getScidbAttrs());
    convertInto(sDims, *h.getScidbDims());
    return boost::make_shared<scidb::ArrayDesc>(name,sAtts,sDims); 
}
<commit_msg>Fix bad transform syntax for arraydesc plumbing.<commit_after>#include "H5Array.hh"
#include <boost/make_shared.hpp>
#include <algorithm>
// Scidb
#include "array/Metadata.h"
// Package
#include "arrayCommon.hh"

class dimConvert {
public:
    scidb::DimensionDesc operator()(ScidbDimLite const& dim) {
        return scidb::DimensionDesc(dim.name, dim.min, dim.start, 
                                    dim.end, dim.max,
                                    dim.chunkInterval, dim.chunkOverlap, 
                                    dim.typeId, dim.arrayName);
    }
};

class attConvert {
public:
    scidb::AttributeDesc operator()(ScidbAttrLite const& att) {
        return scidb::AttributeDesc(0, // Blank attribute id.
                                    att.name, att.typeId,
                                    0, // Flags
                                    0 // default compression method
                                    );
    }
};

void convertInto(scidb::Attributes& sAtts, SalVector const& atts) {
    sAtts.clear();
    sAtts.reserve(atts.size());
    std::transform(atts.begin(), atts.end(), 
                   std::back_inserter(sAtts), attConvert());
}

void convertInto(scidb::Dimensions& sDims, SdlVector const& dims) {
    sDims.clear();
    sDims.reserve(dims.size());
    std::transform(dims.begin(), dims.end(), 
                   std::back_inserter(sDims), dimConvert());
}

boost::shared_ptr<scidb::ArrayDesc> 
H5Array::ScidbIface::getArrayDesc(H5Array const& h) {
    std::string name("Unknown");
    scidb::Attributes sAtts;
    scidb::Dimensions sDims;
    convertInto(sAtts, *h.getScidbAttrs());
    convertInto(sDims, *h.getScidbDims());
    return boost::make_shared<scidb::ArrayDesc>(name,sAtts,sDims); 
}

{'fraction_non_alphanumeric': 0.13315299068229636, 'fraction_numerical': 0.0036068530207394047, 'mean_word_length': 2.2755905511811023, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6471034', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1056, 'n_words': 182}