Skip to content

Commit

Permalink
Fixed heat map generation Python bindings to have default values for …
Browse files Browse the repository at this point in the history
…hue low and high score
  • Loading branch information
marip8 committed Oct 16, 2023
1 parent 5a3e4ca commit 5f27aa6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/python/python_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ np::ndarray computeHeatMapColorsPython2(const bp::list& scores, float hue_low_sc
return fromEigen<float, Eigen::Dynamic, 3>(computeHeatMapColors(scores_v, hue_low_score, hue_high_score));
}

BOOST_PYTHON_FUNCTION_OVERLOADS(compute_heat_map_colors_python1_overloads, computeHeatMapColorsPython1, 2, 4)
BOOST_PYTHON_FUNCTION_OVERLOADS(compute_heat_map_colors_python2_overloads, computeHeatMapColorsPython2, 1, 3)

BOOST_PYTHON_MODULE(MODULE_NAME)
{
Py_Initialize();
Expand Down Expand Up @@ -295,8 +298,13 @@ BOOST_PYTHON_MODULE(MODULE_NAME)
bp::def("load", &load);
bp::def("calculateResults", &calculateResults);
bp::def("normalizeScores", &normalizeScoresPython);
bp::def("computeHeatMapColors", &computeHeatMapColorsPython1);
bp::def("computeHeatMapColors", &computeHeatMapColorsPython2);
bp::def(
"computeHeatMapColors", &computeHeatMapColorsPython1,
compute_heat_map_colors_python1_overloads((bp::arg("results"), bp::arg("use_full_color_range"),
bp::arg("hue_low_score") = 270.0, bp::arg("hue_high_score") = 0.0)));
bp::def("computeHeatMapColors", &computeHeatMapColorsPython2,
compute_heat_map_colors_python2_overloads(
(bp::arg("scores"), bp::arg("hue_low_score") = 270.0, bp::arg("hue_high_score") = 0.0)));
}

// Register shared_ptrs
Expand Down

0 comments on commit 5f27aa6

Please sign in to comment.