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

Developer guide #30

Closed
sglyon opened this issue Mar 29, 2015 · 3 comments · Fixed by #40
Closed

Developer guide #30

sglyon opened this issue Mar 29, 2015 · 3 comments · Fixed by #40

Comments

@sglyon
Copy link
Member

sglyon commented Mar 29, 2015

I've been following developments here and Grid.jl for quite some time now (grid for a couple years, this since its inception).

I am going to be working on writing some routines for Chebyshev interpolation and cubic B-splines and would like to contribute them to this package as I feel this is where that code should ultimately belong. The only problem is that I don't have enough time to really dig in and learn all the meta-magic works in this package.

Is there a brief developer guide that explains how the system works and how it can be extended? If there isn't one, might I submit a request that one be written? Thanks!

@timholy
Copy link
Member

timholy commented Mar 29, 2015

That sounds great. There's been a longstanding request to document stagedfunction, and while no one has jumped at it yet clearly that's something important to do. Documentation specific to this package would also be handy, I agree. @tlycken has also published a number of notebooks in the course of developing this, perhaps some links to those would also help.

For myself, the problem is I'm pretty swamped with my own work and JuliaLang/julia#10525 (comment) (which is taking me into parts of julia I've never explored before, so is really slow). I'll see if I can do something, but it could be a few weeks.

@tomasaschan
Copy link
Contributor

@spencerlyon2 That sounds like great contributions to the package!

I have some very large API changes in the pipeline, in order to make room in the API for other types of interpolation than the B-splines we're currently using - that would make it easier to get somewhere with #28, as well as to include your Chebyshev interpolation routines. These changes will probably have quite a large effect on how best to contribute to B-spline functionality, but it should be quite simple to get started on the Chebyshev parts; I already know where I want to go, so you could probably do some work in parallel and then we'll sync up when we're both ready.

Basically, create code for the following functionality:

  1. A method on the interpolate function that creates an interpolation object

    # type_spec is an argument that specifies *how* we should interpolate
    itp = interpolate(A, type_spec)

    For Chebyshev interpolation, you probably want to create one type Chebyshev, which is configures the interpolation degree etc, and one type ChebyshevInterpolation which is the type of the resulting interpolation objects. You might end up with something like this:

    itp = interpolate(A, Chebyshev)
    # if you need some parameters, e.g. a boundary condition:
    itp = interpolate(A, Chebyshev(Flat))

    where itp is now of type ChebyshevInterpolation (maybe with some type parameters).

  2. Define indexing on that interpolation object.

    getindex(itp::ChebyshevInterpolation, idxs...) = ...

    This is where the stagefunctions in the B-spline interpolations are used, to produce specialized, fast indexing methods that work slightly differently depending on the type of B-spline.

Note that you don't have to use meta-programming tricks anywhere to get this functionality going; we're just doing it for B-splines to maximize performance.

I hope this was helpful - if so, I might make a dev guide out of it eventually :) (And if not - of course - keep asking questions!)

@sglyon
Copy link
Member Author

sglyon commented Apr 8, 2015

Hi @tlycken thanks for the response. It was definitely helpful.

Some of the functionality has been fleshed out in TempInterp.jl. I'm simply treating this repository an intermediate loading zone until we can coordinate and get the functionality into this package.

Right now the code is quite messy as I was exploring different ideas with the type system. When we do eventually merge the Chebyshev components into this package, it will be much cleaner as I can simply fit into your type system, rather than define my own.

I will be pretty busy for the next couple weeks, so I don't anticipate this happening immediately, but I hope to find some time to write up a version of that code that fits into this package soon.

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 a pull request may close this issue.

3 participants