scipy: DOC: -np.inf as default argument not rendering correctly in DIRECT docstring

There is a minor annoyance in the docstring of the recently added direct algorithm: image

sphinx cannot correctly parse -np.inf . I tried to google the issue but could not find an immediate fix. Maybe a more experienced sphinx user has an idea?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (18 by maintainers)

Most upvoted comments

-inf instead of -np.inf might not be too bad but what if a default argument is some complex class like scipy.stats.rv_continuous ?

Well this should not really happen as it would be a bad design. Default arguments should always be simple things like string, scalars, booleans, None. Anything else would break (e.g. using an empty dict which leads to bugs) and is an anti pattern.

I confirmed the spacing issue will be resolved with Sphinx 5.1.0 (see https://github.com/sphinx-doc/sphinx/pull/10551#issuecomment-1156332539).