BlueBrain/libsonata

Materializing nodesets with integer attributes.

Opened this issue · 0 comments

1uc commented

The unit-test data contains a file with an integer attribute attr-Y. This is then used as follows:

            auto node_sets = R"({ "NodeSet0": {"attr-Y": {"$gt": 23}} })";
            NodeSets ns(node_sets);
            Selection sel = ns.materialize("NodeSet0", population);
            CHECK(sel == Selection({{3, 6}}));

which raises the warning:

/home/lucg/git/bbp/libsonata/extlib/HighFive/include/highfive/bits/H5ReadWrite_misc.hpp: 148 [WARN] /nodes/nodes-A/0/attr-Y": data and hdf5 dataset have different types: Float64 -> Integer64

This can then be track down to:

libsonata/src/node_sets.cpp

Lines 365 to 374 in a9650ad

case Op::gt:
return np.filterAttribute<double>(name_, [this](const double v) { return v > value_; });
case Op::lt:
return np.filterAttribute<double>(name_, [this](const double v) { return v < value_; });
case Op::gte:
return np.filterAttribute<double>(name_,
[this](const double v) { return v >= value_; });
case Op::lte:
return np.filterAttribute<double>(name_,
[this](const double v) { return v <= value_; });

Is this intentional?