Suggestion: Replace scipy.zeros() and scipy.ones() with numpy equivalents
Open
- Dominant language
- Python
- Stars
- 62
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/dvc94ch/pycircuit/blob/4b44ec395227a6f0a4ee2130514bbc81901b9f67/pycircuit/optimize.py#L38
In this section:
`lbound = scipy.zeros(self.nparams)
ubound = scipy.ones(self.nparams)
`
You can improve clarity and performance by using:
`lbound = numpy.zeros(self.nparams)
ubound = numpy.ones(self.nparams)
`
These scipy functions are just thin wrappers around numpy.zeros() and numpy.ones(), adding unnecessary overhead and reducing code readability. It’s better to use the native NumPy functions directly, which are the standard across modern Python numerical computing codebases.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.