Open gbordyugov opened 7 years ago
Can you explain a bit more about what is the problem with passing data to _delta() from sga?
It's about encapsulation. _delta()
is a (private) method of the Experiment
class, it's supposed to perform operations on its fields instead of taking arbitrary (and possibly not verified) data frames from the outside world.
Which one do you like better:
class Complex(object):
def __init__(self, x, y):
self.x, self.y = x, y
def abs(self):
return sqrt(self.x*self.x + self.y*self.y)
or
class Complex(object):
def __init__(self, x, y):
self.x, self.y = x, y
def abs(self, x, y):
return sqrt(x*x + y*y)
?
thanks for clarifying! It makes sense, just didn't get it from the first sight.
The current way of doing it revolves around passing an external data frame to the (apparently private)
_delta()
method, which goes a bit against the idea of encapsulationhttps://github.com/zalando/expan/blob/dev/expan/core/experiment.py#L102