Skip to content

Commit

Permalink
possible fix for the cyclic import problem for interpreters
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-sharma committed Nov 21, 2020
1 parent 70b690e commit 644c946
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dowhy/causal_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions dowhy/causal_refuter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import random

from dowhy.utils.api import parse_state
import dowhy.interpreters as interpreters

class CausalRefuter:

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 644c946

Please sign in to comment.