Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Materializing nodesets with integer attributes. #377

Open
1uc opened this issue Nov 11, 2024 · 0 comments
Open

Materializing nodesets with integer attributes. #377

1uc opened this issue Nov 11, 2024 · 0 comments

Comments

@1uc
Copy link
Collaborator

1uc commented Nov 11, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant