Skip to content

Commit

Permalink
FIX Work around weird numpy scalar behaviour (0-dimension arrays)
Browse files Browse the repository at this point in the history
Seeing test-suite failures where a numpy scalar is getting into the
handler and it's not being treated as a one-element array, but as
a *0* element array, so everything goes to heck in a handbasket
and dogs and cats are friends, mass hysteria, you know the drill

This patch means that if you pass in a scalar we'll actually create
a new 1-element numpy array and fill that array with the scalar
rather than treating the scalar as a number-like thing that can
pass through the rest of the machinery.

I don't *see* how this changed in the numpy API, so I'm suspicious
this is some weird behaviour that either never got noticed before
or it was a side-effect of e.g. having two numpy libraries on a
machine.
  • Loading branch information
mcfletch committed Jan 3, 2020
1 parent d625f8b commit eb9a6b4
Show file tree
Hide file tree
Showing 2 changed files with 586 additions and 409 deletions.
Loading

0 comments on commit eb9a6b4

Please # to comment.