Skip to content

Suggestion: Replace scipy.zeros() and scipy.ones() with numpy equivalents #37

Description

@SaFE-APIOpt

lbound = scipy.zeros(self.nparams)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions