scipy-lectures / scientific-python-lectures

Tutorial material on the scientific Python ecosystem
https://lectures.scientific-python.org
Other
3.09k stars 1.19k forks source link

Update scipy.interpolate section #730

Closed jarrodmillman closed 4 months ago

jarrodmillman commented 5 months ago

In #727, @mdhaber made

a fairly minimal update to the interpolate section. Important points are that the example no longer uses the legacy function interp1d, and it highlights the distinction between the two main uses of splines: smoothing and interpolation.

One thing I could consider doing including in this PR is to simplify variable names. I maintained the existing style, but I would find the code easier to read with simpler variable names like t and x. LMK what you think.

In follow-up PRs, I could:

- Show how to take the derivative and antiderivative of a spline in the text.
- Show how to get the roots of a spline in the text.
- Create a separate example that shows how to create an inverse of a function.

I am merging the PR and moving the discussion to an issue so I don't lose track of this.

jarrodmillman commented 5 months ago

Before changing the variable names, we (i.e., me and whoever else is interested) should review the existing choices and decide on a general policy for variable naming. Then add a section to the contributor guide. It would be useful to have some standard variable conventions. I suspect it would use simpler variable names for standard things like time (t), weight (w), number (n), x, y, etc.

It would be great if you have time to

Thanks!!