Skip to content

Make finitediff capable of handling irregularly-spaced data #203

Open

Description

@pavelkomarov

gradient only does 2nd order, but it even works with irregularly-spaced points by solving little 3x3 inverse problems, just as I suggested in the Taxonomy paper. https://numpy.org/doc/2.1/reference/generated/numpy.gradient.html

This is pretty low priority. We'd gain an ability to handle nonuniform spacing for one param setting but not others, which is a bit confusing. Just wanted to note down it's a possible improvement.

Activity

  1. pavelkomarov commented on Sep 2, 2026

    @pavelkomarov
    CollaboratorAuthor

    Looks like we could also just take on a dependency to findiff, which can do irregular grids, although we wouldn't be able to cherry pick just the derivative calculation stuff, so we'd end up with an indirect dependency on Jax. There must be other alternatives out there too. Then again, do we want to take on such a dependency for just this one method, when we could set up and solve the inverse problems ourselves in bare numpy? Taking on a heavy thing like cvxpy is one thing, because no way are we going to implement that ourselves. And even something like the nonuniform Fourier transform might be worth an extra dependency due to the difficulty of implementing it ourselves, although it only supports one method (maybe two, wavelets?). But for something relatively simple? We've got the wrinkle of repeated applications in here too, which behaves as a characterizable IIR filter when dt is constant. How would that affect this?

  2. added this to the v0.3.1 milestone on Sep 2, 2026
  3. changed the title [-]2nd order finitediff could call np.gradient[/-] [+]Make `finitediff` capable of handling irregularly-spaced data[/+] on Sep 2, 2026
  4. removed this from the v0.3.1 milestone on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions