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

Add diff API #293

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Add diff API #293

merged 1 commit into from
Dec 13, 2023

Conversation

peytondmurray
Copy link
Collaborator

@peytondmurray peytondmurray commented Nov 20, 2023

Changes

This PR adds an API for calculating the diff between two versions of a dataset; closes #264.

Tests are provided which check

  • The diff between a version and itself is nothing
  • The diff between two versions of a dataset gives the expected slices and data, including for nested datasets

An intersphinx mapping was added for numpy as well in order to handle docstrings for this new function.

Testing

I wrote a small benchmark to check how fast this implementation was. In the benchmark, I compared calling get_diff to iterating over two versions of a dataset and comparing the chunks using np.assert_equal. For very small datasets, direct comparison with numpy is fastest. As datasets get larger, directly iterating over the data becomes impractical:

comparison

@rahasurana Can you take a look at this?

@peytondmurray peytondmurray marked this pull request as ready for review November 21, 2023 19:00
@peytondmurray peytondmurray self-assigned this Nov 30, 2023
@peytondmurray peytondmurray merged commit 5c3b6d5 into deshaw:master Dec 13, 2023
7 checks passed
@peytondmurray peytondmurray deleted the add-diff-api branch December 13, 2023 00:34
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.

Change-only version selection (PyInf#10524)
1 participant