levisc8/ipmr_esa

more concise `define_impl()` idea

Closed this issue · 3 comments

Aariq commented

I have an idea to make the input to define_impl() more concise. Here's some pseudo code

What if the arguments were like so:

define_impl(proto_ipm, int_rule, state_start, state_end) 

If you supply a vector of length 1 with no names, then it applies it to all sub-kernels. E.g. int_rule = "midpoint" will use the midpoint rule for all sub-kernels. If you want to specify different values for each kernel, you supply a named vector. E.g. state_start = c("P" = "z", "F" = "x"). Most of the time (with simple IPMs) I imagine people will use the same rules and states for each kernel.

Just an idea!

Aariq commented

Oops, I meant to put this in the ipmr repo. Not good enough at multitasking

no worries - make_impl_args_list() is a function I made a while back. The problem is that isn't very useful for complicated models, where the positional matching gets hard to track, and then for simple models, you don't really need it because the lists aren't very difficult to construct anyway.

My current thought is that state_start and state_end should move to define_kernel(), as those are actually a part of the symbolic representations of the kernels (i.e. they're the "z', z" in P(z',z)). Then drop define_domains() altogether and move that stuff into define_impl() (or vice versa).

Aariq commented

That makes sense to me!