Skip to content

Refactor array-loading methods, add tests#361

Merged
mwtoews merged 1 commit intoToblerity:mainfrom
mwtoews:refactor_v_meths
Mar 28, 2025
Merged

Refactor array-loading methods, add tests#361
mwtoews merged 1 commit intoToblerity:mainfrom
mwtoews:refactor_v_meths

Conversation

@mwtoews
Copy link
Copy Markdown
Member

@mwtoews mwtoews commented Mar 24, 2025

This refactors the newly added intersection_v and nearest_v functions, and adds some tests.

  • Allow functions to take lists as inputs, using NumPy's atleast_1d and atleast_2d functions to sanitise inputs for ctypes
  • Replace assert checks with more verbose checks that raise ValueError, checking dimensions, shape and strides
  • Change the function signature of nearest_v to enforce keyword-only from num_results; this function is new, so I don't anticipate this change will be disruptive. Note that nearest does not enforce keyword-only from num_results, but this could change in a future release through a deprecation process.
  • Add some basic tests

@mwtoews mwtoews added this to the 1.4.1 milestone Mar 25, 2025
@mwtoews mwtoews merged commit c180a80 into Toblerity:main Mar 28, 2025
17 checks passed
@mwtoews mwtoews deleted the refactor_v_meths branch March 28, 2025 23:55
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.

1 participant