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

Deal with scipy unceremoniously removing wrap_function #184

Merged
merged 3 commits into from
Jul 19, 2021

Conversation

mpharrigan
Copy link
Collaborator

@mpharrigan mpharrigan commented Jul 13, 2021

No description provided.

@mpharrigan
Copy link
Collaborator Author

This fixes the issue seen in #183 and #183 fixes the issue seen in this

@madcpf
Copy link
Collaborator

madcpf commented Jul 14, 2021

Thanks for fixing this!

Change-Id: I9072119de859a36bfa19ccf0e3e75674090d7244
Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM

For the record, it is a verbatim copy from https://github.com/scipy/scipy/blob/maintenance/1.6.x/scipy/optimize/optimize.py#L454.

Consider adding the https://github.com/scipy/scipy/blob/maintenance/1.6.x/LICENSE.txt to the top of this file referring to wrap_function.

Change-Id: I09bc51a8f5b05e474cc201574807c8a112669bc0
@mpharrigan
Copy link
Collaborator Author

added

# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


def wrap_function(function, args):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I generally don't think it's a great idea to put code in init files. Is there a reason we can't put this in its own file and import it into the package?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done, moved

def wrap_function(function, args):
# This function existed in scipy prior to 1.7
# It must not have been considered part of the public API, as it has
# disappeared without a trace.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be a docstring instead of line comments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Change-Id: I6b0c01943089170177ed133eafc310de4328ef70
@mpharrigan mpharrigan merged commit 75e7b82 into quantumlib:master Jul 19, 2021
@mpharrigan mpharrigan deleted the 2021-07-scipy-fix branch July 19, 2021 16:17
madcpf pushed a commit to madcpf/ReCirq that referenced this pull request Sep 5, 2021
)

* Deal with scipy unceremoniously removing `wrap_function`

Change-Id: I9072119de859a36bfa19ccf0e3e75674090d7244

* License

Change-Id: I09bc51a8f5b05e474cc201574807c8a112669bc0

* Move to own file, docstring

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

Successfully merging this pull request may close these issues.

None yet

4 participants