Skip to content

Commit 6bf05ae

Browse files
committed
SharedComputeValue: Add variable attribut
Compute values usually have a reference to the original variable so SharedComputeValue should have it too.
1 parent 54d8498 commit 6bf05ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Orange/data/util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ class SharedComputeValue:
4444
A callable that performs computation that is shared between
4545
multiple variables. Variables sharing computation need to set
4646
the same instance.
47+
variable: Orange.data.Variable
48+
The original variable on which this compute value is set.
4749
"""
4850

49-
def __init__(self, compute_shared):
51+
def __init__(self, compute_shared, variable=None):
5052
self.compute_shared = compute_shared
53+
self.variable = variable
5154

5255
def __call__(self, data, shared_data=None):
5356
"""Fallback if common parts are not passed."""

0 commit comments

Comments
 (0)