Skip to content

Commit 3906a8d

Browse files
committed
reformat
1 parent 20d825c commit 3906a8d

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

LearningWithExpertKnowledge/estimator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import logging
2+
from collections import deque
13
from itertools import permutations
2-
from LearningWithExpertKnowledge.expert import *
3-
from LearningWithExpertKnowledge.graph import DAG
4+
45
import networkx as nx
56
import numpy as np
67
from tqdm import trange
7-
from collections import deque
8-
import logging
8+
9+
from LearningWithExpertKnowledge.expert import *
10+
from LearningWithExpertKnowledge.graph import DAG
911

1012

1113
class Estimator:

LearningWithExpertKnowledge/graph.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import networkx as nx
21
import matplotlib.pyplot as plt
2+
import networkx as nx
33

44

55
class DAG(nx.DiGraph):
@@ -11,11 +11,6 @@ def __init__(self, edges=None):
1111
cycles = list(nx.find_cycle(self))
1212
except nx.NetworkXNoCycle:
1313
pass
14-
else:
15-
out_str = "Cycles are not allowed in a DAG."
16-
out_str += "\nEdges indicating the path taken for a loop: "
17-
out_str += "".join([f"({u},{v}) " for (u, v) in cycles])
18-
raise ValueError(out_str)
1914

2015
def get_parents(self, node):
2116
"""

LearningWithExpertKnowledge/run/run0.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from LearningWithExpertKnowledge.estimator import *
22
from LearningWithExpertKnowledge.expert import *
3-
from LearningWithExpertKnowledge.graph import *
4-
import pandas as pd
53

64
if __name__ == '__main__':
75
"""

0 commit comments

Comments
 (0)