Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft JOSS article about SciPy elementwise iterative methods #116

Closed
wants to merge 0 commits into from

Conversation

mdhaber
Copy link
Owner

@mdhaber mdhaber commented Jan 3, 2025

Draft JOSS article about SciPy elementwise iterative methods

Copy link

@tupui tupui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matt for putting this together 😃 A few minor things from my side.

paper.md Outdated Show resolved Hide resolved
paper.md Outdated
- `scipy.integrate.nsum` for summation of real-valued finite or infinite series,
- `scipy.optimize.elementwise` for finding roots and minimization of a single-input, single output function.

Although the details of the algorithms are inherently distinct, of these features rely on a common framework for elementwise iterative methods and share similar interfaces. For example, `scipy.differentiate.derivative` accepts the scalar function to be differentiated as a Python callable, the points at which to evaluate the derivative as an N-dimensional array, and any other parameters of the callable as N-dimensional arrays. `derivative` passes abscissae and parameters to the callable as N-dimensional arrays, adaptively approximating the derivative(s) to achieve specified tolerances. Furthermore, arrays need not be NumPy arrays: the same implementation works with several Python Array API Standard compatible arrays, such as PyTorch tensors and CuPy arrays. These features will dramatically improve performance of end-user applications, and together, they form the backbone of SciPy's new random variable infrastructure.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Although the details of the algorithms are inherently distinct, of these features rely on a common framework for elementwise iterative methods and share similar interfaces. For example, `scipy.differentiate.derivative` accepts the scalar function to be differentiated as a Python callable, the points at which to evaluate the derivative as an N-dimensional array, and any other parameters of the callable as N-dimensional arrays. `derivative` passes abscissae and parameters to the callable as N-dimensional arrays, adaptively approximating the derivative(s) to achieve specified tolerances. Furthermore, arrays need not be NumPy arrays: the same implementation works with several Python Array API Standard compatible arrays, such as PyTorch tensors and CuPy arrays. These features will dramatically improve performance of end-user applications, and together, they form the backbone of SciPy's new random variable infrastructure.
Although the details of the algorithms are inherently distinct, these features rely on a common framework for elementwise iterative methods and share similar interfaces. For example, `scipy.differentiate.derivative` accepts the scalar function to be differentiated as a Python callable, the points at which to evaluate the derivative as an N-dimensional array, and any other parameters of the callable as N-dimensional arrays. `derivative` passes abscissae and parameters to the callable as N-dimensional arrays, adaptively approximating the derivative(s) to achieve specified tolerances. Furthermore, arrays need not be NumPy arrays: the same implementation works with several Python Array API Standard compatible arrays, such as PyTorch tensors and CuPy arrays. These features will dramatically improve performance of end-user applications, and together, they form the backbone of SciPy's new random variable infrastructure.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise I am not sure I would go into the description of the API. The text can be difficult to read so consider adding the general API you are describing (e.g. f(a, b, c).)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Array API, maybe we should point to the standard as a ref.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed "of" and added reference to array API standard.

I would consider removing:

For example, scipy.differentiate.derivative accepts the scalar function to be differentiated as a Python callable, the points at which to evaluate the derivative as an N-dimensional array, and any other parameters of the callable as N-dimensional arrays. derivative passes abscissae and parameters to the callable as N-dimensional arrays, adaptively approximating the derivative(s) to achieve specified tolerances.

Let's see what @steppi thinks.

paper.md Outdated
- Speed: the features take full advantage of vectorized user callables, avoiding slow Python loops and the excessive overhead of repeatedly calling compiled code.
- Prevalence: SciPy is one of the most popular scientific Python packages. If a scientific Python user needs these features, chances are that they already have SciPy installed, eliminating the need to find and learn a new package.
- Easy-of-use: the function API reference is thorough, and the interfaces share common features and operate smoothly with other SciPy functions.
- Dependability: as with all SciPy code, these features were designed and implemented following good software development practices. They have been carefully peer-reviewed, and extensive unit tests protect against backward incompatible changes and regressions.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a note on the scientific accuracy. Here it might read that the code is good and correct on the software engineering side, not necessarily that the math is sound.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are supposed to be features that set SciPy apart from one or more of the other options. I assume all of them are mathematically correct. One could argue that ease-of-use and dependability are common to all, to some extent, so I think I'd be more likely to remove those than to add mathematical accuracy as a "unique" advantage.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair 👍

@mdhaber mdhaber force-pushed the joss_eim_draft branch 3 times, most recently from 8b04539 to f509f2b Compare January 3, 2025 17:02
@mdhaber mdhaber closed this Jan 6, 2025
@mdhaber
Copy link
Owner Author

mdhaber commented Jan 6, 2025

Oops. I accidentally reset to HEAD~1 and force-pushed without re-committing, so this closed itself. I'll take the opportunity to rebase everything on SciPy 1.15.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants