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

DOC+MAINT: optimize: lb and ub in the Bounds constructor are not optional #13804

Merged
merged 2 commits into from Apr 5, 2021

Conversation

WarrenWeckesser
Copy link
Member

Also fix a really long line.

Fix a really long line, and while I'm at it, change from
using the .format() method to f-strings.
@WarrenWeckesser WarrenWeckesser added scipy.optimize Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org maintenance Items related to regular maintenance tasks labels Apr 4, 2021
@WarrenWeckesser WarrenWeckesser changed the title DOC: optimize: lb and ub in the Bounds constructor are not optional DOC+MAINT: optimize: lb and ub in the Bounds constructor are not optional Apr 4, 2021
@mdhaber
Copy link
Contributor

mdhaber commented Apr 4, 2021

Do you want to add a test comparing the repr against the expected string?

@WarrenWeckesser
Copy link
Member Author

The repr can change over time (e.g. it changed when lb and ub were passed through np.asarray before being saved as attributes), so I don't know if an exact match of the repr to a string is what we want. How about evaling the repr and checking that we get back what we put in? Something like

b = Bounds([1, 2], 100)
s = repr(b)
b2 = eval(s)
assert_array_equal(b.lb, b2.lb)
assert_array_equal(b.ub, b2.ub)
assert_array_equal(b.keep_feasible, b2.keep_feasible)

(and another with an explicit keep_feasible argument).

@mdhaber
Copy link
Contributor

mdhaber commented Apr 4, 2021

Sure. Sounds good.

@WarrenWeckesser
Copy link
Member Author

That was easy... it turns out the tests are already there:

def test_bounds_repr():

@mdhaber
Copy link
Contributor

mdhaber commented Apr 4, 2021

OK I'll merge when the last test finishes.

@mdhaber
Copy link
Contributor

mdhaber commented Apr 5, 2021

I don't know if the last test is going to finish.

@WarrenWeckesser
Copy link
Member Author

I restarted the stalled job. They're all green now.

@mdhaber mdhaber merged commit 04e9644 into scipy:master Apr 5, 2021
@WarrenWeckesser WarrenWeckesser added this to the 1.7.0 milestone Apr 5, 2021
@WarrenWeckesser WarrenWeckesser deleted the doc-bounds branch April 5, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org maintenance Items related to regular maintenance tasks scipy.optimize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants