question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

refguide-check fails on master

See original GitHub issue

Recent PRs fail the refguide-check CI run, e.g. https://travis-ci.org/scipy/scipy/jobs/422178274

Most failures are due to some changes in the amount of whitespace numpy decides to use when printing arrays. Usually, plain doctests are annoying to work with precisely because they tend to fret on whitespace. To counter that, our refguide-check tries to detect floating-point comparisons and delegate them to numpy. It seems that the detection fails in several classes of cases:

  • printing n-dim arrays. We added some logic for detection of the result of printing an array in gh-9178, but it does not handle ndim>1.

For example:

File "build/testenv/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 1788, in inconsistent
Failed example:
    print(Z)
Expected:
    [[ 5.          6.          0.          2.        ]
     [ 2.          7.          0.          2.        ]
     [ 0.          4.          1.          2.        ]
     [ 1.          8.          1.15470054  3.        ]
     [ 9.         10.          2.12132034  4.        ]
     [ 3.         12.          4.11096096  5.        ]
     [11.         13.         14.07183949  8.        ]]
Got:
    [[  5.           6.           0.           2.        ]
     [  2.           7.           0.           2.        ]
     [  0.           4.           1.           2.        ]
     [  1.           8.           1.15470054   3.        ]
     [  9.          10.           2.12132034   4.        ]
     [  3.          12.           4.11096096   5.        ]
     [ 11.          13.          14.07183949   8.        ]] 

The simplest way of fixing these is probably to change in the examples, >>> print(Z) to just >>> Z Otherwise, the relevant logic is https://github.com/scipy/scipy/blob/master/tools/refguide_check.py#L570

  • Somewhat trickier: numpy arrays hidden in textual output. Note the whitespace in the slack and x arrays.
scipy.optimize.linprog
----------------------
File "build/testenv/lib/python3.6/site-packages/scipy/optimize/_linprog.py", line 1059, in linprog
Failed example:
    print(res)
Expected:
         fun: -22.0
     message: 'Optimization terminated successfully.'
         nit: 1
       slack: array([39.,  0.])
      status: 0
     success: True
           x: array([10., -3.])
Got:
         fun: -22.0
     message: 'Optimization terminated successfully.'
         nit: 1
       slack: array([ 39.,   0.])
      status: 0
     success: True
           x: array([ 10.,  -3.]) 

Maybe it’s best to just change doctest output. Alternatively, one can teach the doctester to search for array([<whatever>]).

  • namedtuples and similar objects:
File "build/testenv/lib/python3.6/site-packages/scipy/stats/morestats.py", line 97, in bayes_mvs
Failed example:
    std
Expected:
    Std_dev(statistic=2.9724954732045084, minmax=(1.7823367265645143, 4.945614605014631))
Got:
    Std_dev(statistic=2.9724954732045084, minmax=(1.7823367265645143, 4.9456146050146312))

Again, there’s some rudimentary logic for handling these sorts of issues, https://github.com/scipy/scipy/blob/master/tools/refguide_check.py#L587 but it is also too simplistic.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
pvcommented, Sep 1, 2018

We fixed the printing to latest numpy format in gh-8279, so I think we only need to tell CI to use latest numpy: gh-9202

1reaction
pvcommented, Aug 29, 2018

I think we aim to target the refguide to the numpy output as it is in the latest version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git push error '[remote rejected] master - Stack Overflow
The error message error: refusing to update checked out branch: refs/heads/master is emitted by the remote repository and it means you're trying to...
Read more >
How to avoid broken master with Pipelines for Merged Results ...
GitLab creates a pipeline on the merge commit, but this pipeline fails because the latest master changed a lint rule.
Read more >
SciPy 1.9.0 Release Notes — SciPy v1.9.3 Manual
SciPy 1.9.0 is the culmination of 6 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better...
Read more >
[JENKINS-Experimental-GC] Lucene-Solr-master-Linux (64bit ...
A fatal error has been detected by the Java Runtime Environment: ... /home/jenkins/workspace/Lucene-Solr-master-Linux/solr/core/build/tmp/ ...
Read more >
Lucene-Solr-Check-master - Build # 697 - The Mail Archive
Build: https://ci-builds.apache.org/job/Lucene/job/Lucene-Solr-Check-master/697/ 1 tests failed. FAILED: org.apache.solr.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found