Skip to content
Snippets Groups Projects
Commit 81a14c28 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Fix repr of ImmutableCuttingRecord to actually cut the underscore fields

parent b4c1beab
No related branches found
No related tags found
No related merge requests found
......@@ -127,9 +127,6 @@ class AccumulationOutput(SumfactKernelInterfaceBase, ImmutableCuttingRecord):
_permuted_matrix_sequence=matrix_sequence,
)
def __repr__(self):
return ImmutableCuttingRecord.__repr__(self)
def get_keyword_arguments(self):
"""Get dictionary of keyword arguments needed to initialize this class
......
......@@ -264,12 +264,6 @@ class LFSSumfactKernelInput(SumfactKernelInterfaceBase, ImmutableCuttingRecord):
_permuted_matrix_sequence=matrix_sequence,
)
def __repr__(self):
return ImmutableCuttingRecord.__repr__(self)
def __str__(self):
return repr(self)
def get_keyword_arguments(self):
"""Get dictionary of keyword arguments needed to initialize this class
......
......@@ -369,12 +369,6 @@ class GeoCornersInput(SumfactKernelInterfaceBase, ImmutableCuttingRecord):
_permuted_matrix_sequence=matrix_sequence,
)
def __repr__(self):
return ImmutableCuttingRecord.__repr__(self)
def __str__(self):
return repr(self)
def get_keyword_arguments(self):
"""Get dictionary of keyword arguments needed to initialize this class
......
......@@ -12,6 +12,9 @@ class ImmutableCuttingRecord(pytools.ImmutableRecord):
A record implementation that drops fields starting with an underscore
from hash and equality computation
"""
def __repr__(self):
return "{}({})".format(type(self), ",".join(repr(getattr(self, f)) for f in self.__class__.fields if not f.startswith("_")))
def __hash__(self):
return hash((type(self),) + tuple(getattr(self, field) for field in self.__class__.fields if not field.startswith("_")))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment