From 644c946133ec0456052b849bf1998bddce612701 Mon Sep 17 00:00:00 2001 From: Amit Sharma Date: Sat, 21 Nov 2020 21:18:42 +0530 Subject: [PATCH] possible fix for the cyclic import problem for interpreters --- dowhy/causal_model.py | 2 +- dowhy/causal_refuter.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dowhy/causal_model.py b/dowhy/causal_model.py index 1ce8dc95e8..805bac48e1 100755 --- a/dowhy/causal_model.py +++ b/dowhy/causal_model.py @@ -11,7 +11,6 @@ from dowhy.causal_estimator import CausalEstimate from dowhy.causal_graph import CausalGraph from dowhy.causal_identifier import CausalIdentifier -import dowhy.interpreters as interpreters from dowhy.utils.api import parse_state init_printing() # To display symbolic math symbols @@ -346,6 +345,7 @@ def interpret(self, method_name=None, **kwargs): return method_name_arr = parse_state(method_name) + import dowhy.interpreters as interpreters for method in method_name_arr: interpreter = interpreters.get_class_object(method) interpreter(self, **kwargs).interpret() diff --git a/dowhy/causal_refuter.py b/dowhy/causal_refuter.py index 082da3e806..d225b8a6a3 100644 --- a/dowhy/causal_refuter.py +++ b/dowhy/causal_refuter.py @@ -4,7 +4,6 @@ import random from dowhy.utils.api import parse_state -import dowhy.interpreters as interpreters class CausalRefuter: @@ -246,7 +245,7 @@ def interpret(self, method_name=None, **kwargs): if method_name is None: method_name = self.refuter.interpret_method method_name_arr = parse_state(method_name) - + import dowhy.interpreters as interpreters for method in method_name_arr: interpreter = interpreters.get_class_object(method) interpreter(self, **kwargs).interpret()