JuliaMath / JuliaMath/Interpolations.jl

ConstantInterpolation fails with Unitful arrays

Open
#505 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Julia
Stars
575
Forks
117
PR merge metrics
No merged PRs in 30d

Description

`ConstantInterpolation` fails when argument is Unitful array, but works when it's `StepRangeLen`. For `LinearInterpolation` it works in both cases.

```
using Unitful, Interpolations

x0 = (0:0.5:2)u"s";
y0 = (0:0.5:2)u"m";

# this works
ConstantInterpolation(x0, y0)(1u"s")

# this fails
ConstantInterpolation(collect(x0), y0)(1u"s")

# these both work
LinearInterpolation(x0, y0)(1u"s")
LinearInterpolation(collect(x0), y0)(1u"s")
```

Using Julia v.1.7.3, Interpolations v.0.14.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.