Skip to content

Commit a5ebb62

Browse files
✨ Isort + black
1 parent bd44919 commit a5ebb62

8 files changed

Lines changed: 22 additions & 29 deletions

File tree

src/hebg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
""" A structure for explainable hierarchical reinforcement learning """
55

6+
from hebg.behavior import Behavior
67
from hebg.heb_graph import HEBGraph
78
from hebg.node import Action, EmptyNode, FeatureCondition, Node, StochasticAction
8-
from hebg.behavior import Behavior
99
from hebg.requirements_graph import build_requirement_graph

src/hebg/codegen.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"""Module for code generation from HEBGraph."""
22

33
from re import sub
4+
from typing import TYPE_CHECKING, Dict, List, Set, Tuple
45

5-
from typing import TYPE_CHECKING, List, Dict, Set, Tuple
6-
7-
from hebg.node import Node, Action, FeatureCondition
86
from hebg.behavior import Behavior
9-
from hebg.unrolling import BEHAVIOR_SEPARATOR
107
from hebg.graph import get_roots, get_successors_with_index
118
from hebg.metrics.histograms import cumulated_hebgraph_histogram
9+
from hebg.node import Action, FeatureCondition, Node
10+
from hebg.unrolling import BEHAVIOR_SEPARATOR
1211

1312
if TYPE_CHECKING:
1413
from hebg.heb_graph import HEBGraph

src/hebg/draw.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
import math
22
from typing import TYPE_CHECKING, Dict, Optional, Tuple
33

4-
import numpy as np
5-
from scipy.spatial import ConvexHull # pylint: disable=no-name-in-module
6-
7-
import matplotlib.pyplot as plt
84
import matplotlib.patches as mpatches
9-
from matplotlib.legend_handler import HandlerPatch
10-
from matplotlib.legend import Legend
5+
import matplotlib.pyplot as plt
6+
import numpy as np
117
from matplotlib.axes import Axes
12-
8+
from matplotlib.legend import Legend
9+
from matplotlib.legend_handler import HandlerPatch
1310
from networkx import draw_networkx_edges
11+
from scipy.spatial import ConvexHull # pylint: disable=no-name-in-module
1412

15-
from hebg.unrolling import group_behaviors_points
16-
from hebg.layouts import staircase_layout
1713
from hebg.graph import draw_networkx_nodes_images
14+
from hebg.layouts import staircase_layout
15+
from hebg.unrolling import group_behaviors_points
1816

1917
if TYPE_CHECKING:
20-
from hebg.node import Node
2118
from hebg.heb_graph import HEBGraph
19+
from hebg.node import Node
2220

2321

2422
def draw_hebgraph(

src/hebg/heb_graph.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@
66

77
from __future__ import annotations
88

9-
from typing import Any, Dict, List, Tuple, Optional
9+
from typing import Any, Dict, List, Optional, Tuple
1010

1111
import numpy as np
1212
from matplotlib.axes import Axes
13-
1413
from networkx import DiGraph
1514

16-
17-
from hebg.graph import get_roots, get_successors_with_index
15+
from hebg.behavior import Behavior
1816
from hebg.codegen import get_hebg_source
19-
from hebg.unrolling import unroll_graph
2017
from hebg.draw import draw_hebgraph
21-
18+
from hebg.graph import get_roots, get_successors_with_index
2219
from hebg.node import Node
23-
from hebg.behavior import Behavior
20+
from hebg.unrolling import unroll_graph
2421

2522

2623
class HEBGraph(DiGraph):

src/hebg/metrics/complexity/complexities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
from typing import TYPE_CHECKING, Dict, Tuple
88

9+
from hebg.behavior import Behavior
910
from hebg.metrics.complexity.utils import update_sum_dict
1011
from hebg.node import Action
11-
from hebg.behavior import Behavior
1212

1313
if TYPE_CHECKING:
1414
from hebg.node import Node

src/hebg/metrics/histograms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
import numpy as np
1010

11-
12-
from hebg.metrics.complexity.utils import update_sum_dict
1311
from hebg.behavior import Behavior
12+
from hebg.metrics.complexity.utils import update_sum_dict
1413
from hebg.node import Action, FeatureCondition
1514

1615
if TYPE_CHECKING:

src/hebg/requirements_graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from __future__ import annotations
88

99
from copy import deepcopy
10-
from typing import List, Dict
10+
from typing import Dict, List
1111

1212
from networkx import DiGraph, descendants
1313

14-
from hebg.heb_graph import HEBGraph
14+
from hebg.behavior import Behavior
1515
from hebg.graph import compute_levels
16+
from hebg.heb_graph import HEBGraph
1617
from hebg.node import EmptyNode
17-
from hebg.behavior import Behavior
1818

1919

2020
def build_requirement_graph(behaviors: List[Behavior]) -> DiGraph:

src/hebg/unrolling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
from networkx import relabel_nodes
1111

12-
from hebg.node import Node
1312
from hebg.behavior import Behavior
1413
from hebg.graph import compute_levels
14+
from hebg.node import Node
1515

1616
BEHAVIOR_SEPARATOR = ">"
1717

0 commit comments

Comments
 (0)