Fix param.pprint
for Array
parameters by replacing all_equal
with Comparator.is_equal
in values()
#795
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batc
2DC9
h that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #606
Fixes #179
Supersedes #437
I chose to replace
all_equals
in.param.values
byComparator.is_equal
, which then needed to be extended to deal with objects that have the_infinitely_iterable
attribute (Time
). I've had to change the code inis_equal
a little to fix the support forpredicate: equality
.As a reminder (#179 (comment)),
all_equal
has this weird behavior thatall_equal('aaaa', 'aa')
is True. That behavior is relied upon (intentionally I guess) by.param.values(> so that the Parameterized instance auto-generated name is filtered out of the returned values. I copied code from #437 to make sure that this behavior is preserved. Because it's no longer used, I have deprecated
all_equals
.#437 was discussing a bit more some API to decide whether you want to auto-suppress
name
or not. I have decided not to deal with that in this PR that is focused on fixing the linked issues.#437 also discussed how to deal with comparing numpy arrays. As indeed if
.param.pprint()
now works withArray
Parameters it will always include the default array, as the comparator doesn't handle this object type. I actually started to work on that and later realized this is a can of worms :)