Skip to content

Cardinal basis#332

Open
kburns wants to merge 2 commits intomasterfrom
cardinal
Open

Cardinal basis#332
kburns wants to merge 2 commits intomasterfrom
cardinal

Conversation

@kburns
Copy link
Member

@kburns kburns commented Feb 24, 2026

This PR adds a CardinalBasis class, which is a 1D basis of independent points with no differentiability. This may be useful for doing simulations with parameter dimensions, etc. The only supported operators are ConvertConstant, Interpolate (to extract a particular index), Integrate (discrete sum over entries), and Average (average over entries). I have tested it with an implementation of 2D RBC for running separate initial conditions simultaneously, but haven't put in any unit tests.

@jsoishi
Copy link
Member

jsoishi commented Feb 24, 2026

If I read this right (haven't tested), interpolate will throw an IndexError unless you feed it an integer. This seems reasonable, but maybe we could catch it and return a more specific error. Or we could convert to int and warn?

@jsoishi jsoishi marked this pull request as ready for review February 24, 2026 21:43
@jsoishi
Copy link
Member

jsoishi commented Feb 24, 2026

This looks great!

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.

2 participants