Skip to content

Commit

Permalink
Adding error
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Dec 5, 2023
1 parent 3a00e1d commit a81f265
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/GooseEYE/GooseEYE.h
Original file line number Diff line number Diff line change
Expand Up @@ -1282,8 +1282,8 @@ array_type::array<int> clusters(const T& f, bool periodic = true)
* @return The image, with labels inserted (overwritten) at the positions.
*/
template <typename T, typename U, typename V>
[[deprecated("Will not be supported in the future. See Python warning for new API.")]]
inline T pos2img(const T& img, const U& positions, const V& labels)
[[deprecated("Will not be supported in the future. See Python warning for new API.")]] inline T
pos2img(const T& img, const U& positions, const V& labels)
{
GOOSEEYE_WARNING_PYTHON("pos2img(img, positions, labels) deprecated, use: "
"i = ravel_multi_index(positions.T, img.shape); img.flat[i] = labels")
Expand Down Expand Up @@ -1330,6 +1330,9 @@ template <class T, class W = decltype(nullptr)>
array_type::tensor<double, 2>
labels_centers(const T& labels, const W& weights = nullptr, bool periodic = true)
{
if (weights != nullptr) {
throw std::runtime_error("Please open a PR to use ``weights``.");
}
static_assert(std::is_integral<typename T::value_type>::value, "Integral labels required.");

GOOSEEYE_ASSERT(labels.dimension() > 0, std::out_of_range);
Expand Down

0 comments on commit a81f265

Please sign in to comment.