stratify gives strange results if heights run in opposite directions
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
z_targ = np.array([0.0, 1.0, 2.0, 3.0, 4.0])
z_source = np.array([0., 0.5, 1.5, 2.5, 3.5, 4.5])
data_source = z_source.copy()
out = stratify.interpolate(z_targ, z_source, data_source)
print(out)
# now flip data to be interpolated
z_source = np.flip(z_source)
data_source = np.flip(data_source)
out = stratify.interpolate(z_targ, z_source, data_source)
print(out)
Gives:
[0. 1. 2. 3. 4.]
[ 0. nan nan nan nan]
Either the reversed heights should raise a ValuError or (better) the input heights should be flipped internally before doing the interpolation
- Dominant language
- Jupyter Notebook
- Stars
- 30
- Forks
- 19
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SciTools/python-stratify
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
SciTools/python-stratify#437 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SciTools/python-stratify#435 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SciTools/python-stratify#430 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SciTools/python-stratify#427 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
SciTools/python-stratify#277 ·