Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Materializing nodesets with integer attributes. #377

@1uc

Description

@1uc

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions