Skip to content

Conversation

lisavdlinde
Copy link

No description provided.

@JordiManyer JordiManyer self-requested a review April 9, 2025 08:34
Copy link
Member

@JordiManyer JordiManyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lisavdlinde , thanks for the contribution! I do have some comments on the changes though.

  • I've added some comments to the code.
  • Also, please add @notimplementedif searchmethod.accept_points_outside to all functions that potentially allow the user to use the kwarg but which do not take it into consideration. For instance, the evaluation with an array of points.


end

if searchmethod.accept_points_outside == true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the == true.

end

if searchmethod.accept_points_outside == true
return nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad... We are turning a function that always returned an Int into something that sometimes returns a nothing, potentially making the whole thing slower.

I would change it to return 0.


cell = _point_to_cell!(cache1, x)
if cell == nothing
return nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. We are going from a function that returns something consistent to a returning sometimes nothing. I would change to

if iszero(cell)
  return zero(return_type(testitem(cell_f),x))
end

@JordiManyer
Copy link
Member

On top of this:

  • Please pull from master, I just merged some other stuff.
  • Please update the NEWS.md file with the changes
    Thanks!

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

Successfully merging this pull request may close these issues.

3 participants