Fix single graph handling
This commit is contained in:
committed by
Dario Coscia
parent
53cc203db8
commit
05d6913e04
@@ -104,10 +104,6 @@ class Collector:
|
||||
# get data
|
||||
keys = condition.__slots__
|
||||
values = [getattr(condition, name) for name in keys]
|
||||
values = [
|
||||
value.data if isinstance(value, Graph) else value
|
||||
for value in values
|
||||
]
|
||||
self.data_collections[condition_name] = dict(zip(keys, values))
|
||||
# condition now is ready
|
||||
self._is_conditions_ready[condition_name] = True
|
||||
|
||||
@@ -115,3 +115,9 @@ class ConditionInterface(metaclass=ABCMeta):
|
||||
raise ValueError(
|
||||
"LabelTensor must have the same labels"
|
||||
)
|
||||
|
||||
def __getattribute__(self, name):
|
||||
to_return = super().__getattribute__(name)
|
||||
if isinstance(to_return, (Graph, Data)):
|
||||
to_return = [to_return]
|
||||
return to_return
|
||||
|
||||
Reference in New Issue
Block a user