Open biogeo opened 8 years ago
Generalizing this would make sense. It unfortunately will mean that the code tries to write into immutable AbstractArray
objects (e.g. Range
), but the increase in generic programming probably makes up for the decrease in useful compile-time errors.
Hm, interesting point. Julia doesn't offer something like a AbstractMutableArray
type?
No, that would require traits or multiple inheritance -- neither of which exist at the moment.
I attempted to use
curve_fit
fromLsqFit.jl
on data stored in aDataFrame
column, as incurve_fit(model, df[:x], df[:y], p0)
. This produced the following error:Of course this is easily resolved by explicitly converting the inputs to
Array
s, but it's a bit cumbersome. I'm pretty new to Julia and its type system, but from looking at the code there's no obvious reason to me whyfinite_difference_jacobian!
couldn't work with its signature changed to useAbstractArray
andAbstractVector
, relieving the need to convertDataArray
s. Is this reasonable? If there's no reason not to do it, I can try to test it out and make a pull request when I have time.