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

Use 1D array in scipy.optimize.minimize #111

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

JulioAPeraza
Copy link
Collaborator

Closes #109.

In the latest scipy release, the use of minimize with x0.ndim != 1 is being deprecated.

Currently, the output of ub_start = 2 * DerSimonianLaird().fit(y, v, X).params_["tau2"] is already a 1D array so the use of minimize with [ub_start] gives x0.ndim = 2, which then gets converted to an array of dimension 0 by np.squeeze(x0), resulting in an error here:
https://github.com/scipy/scipy/blob/903bc39809af20a1447ed702e84592397c3de509/scipy/optimize/_minimize.py#L947

Changes proposed in this pull request:

  • Remove square brackets from ub_start in minimize.

@JulioAPeraza JulioAPeraza added the bug Something isn't working label Aug 9, 2022
@JulioAPeraza JulioAPeraza requested a review from tsalo August 9, 2022 21:19
@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2022

Codecov Report

Merging #111 (d2a999b) into master (19af399) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #111   +/-   ##
=======================================
  Coverage   87.88%   87.88%           
=======================================
  Files          13       13           
  Lines         883      883           
=======================================
  Hits          776      776           
  Misses        107      107           
Impacted Files Coverage Δ
pymare/stats.py 67.21% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tsalo
Copy link
Member

tsalo commented Aug 10, 2022

It's working! Thanks!

@tsalo tsalo merged commit 001f5d6 into neurostuff:master Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing tests
3 participants