Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

stratify gives strange results if heights run in opposite directions

Open
#50 11 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

Type: Enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SciTools/python-stratify

All issues in SciTools/python-stratify

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.