Closed tBuLi closed 4 years ago
It is probably lines like this in the numpy.assert_almost_equal
code which cause this:
isinstance(actual, (ndarray, tuple, list))
Therefore, we should somehow fake being one of those, but inheriting from collections.Sequence
is not strong enough to trick this line.
Yes, self.keys()
already comes from an OrderedDict. And in the docstring of ModelOutput it is specified that identical ordering is assumed, in case of later use. I did not want to make it initiate from an ordereddict though, because I noticed that looked more clumsy.
A PR to solve #267 by removing the
variabletuple
and replacing it with an objectModelOutput
, which has the same API.So far this seems to work almost everywhere, except that numpy's
assert_almost_equal
does not like these objects, despite the fact that they are iterable and therefore I don't see why this is different from the oldtuple
subclass.