Skip to content

Commit

Permalink
✨ Isort + black
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisFederico committed Feb 3, 2023
1 parent bd44919 commit a5ebb62
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/hebg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

from hebg.behavior import Behavior
from hebg.heb_graph import HEBGraph
from hebg.node import Action, EmptyNode, FeatureCondition, Node, StochasticAction
from hebg.behavior import Behavior
from hebg.requirements_graph import build_requirement_graph
7 changes: 3 additions & 4 deletions src/hebg/codegen.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""Module for code generation from HEBGraph."""

from re import sub
from typing import TYPE_CHECKING, Dict, List, Set, Tuple

from typing import TYPE_CHECKING, List, Dict, Set, Tuple

from hebg.node import Node, Action, FeatureCondition
from hebg.behavior import Behavior
from hebg.unrolling import BEHAVIOR_SEPARATOR
from hebg.graph import get_roots, get_successors_with_index
from hebg.metrics.histograms import cumulated_hebgraph_histogram
from hebg.node import Action, FeatureCondition, Node
from hebg.unrolling import BEHAVIOR_SEPARATOR

if TYPE_CHECKING:
from hebg.heb_graph import HEBGraph
Expand Down
18 changes: 8 additions & 10 deletions src/hebg/draw.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import math
from typing import TYPE_CHECKING, Dict, Optional, Tuple

import numpy as np
from scipy.spatial import ConvexHull # pylint: disable=no-name-in-module

import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.legend_handler import HandlerPatch
from matplotlib.legend import Legend
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.axes import Axes

from matplotlib.legend import Legend
from matplotlib.legend_handler import HandlerPatch
from networkx import draw_networkx_edges
from scipy.spatial import ConvexHull # pylint: disable=no-name-in-module

from hebg.unrolling import group_behaviors_points
from hebg.layouts import staircase_layout
from hebg.graph import draw_networkx_nodes_images
from hebg.layouts import staircase_layout
from hebg.unrolling import group_behaviors_points

if TYPE_CHECKING:
from hebg.node import Node
from hebg.heb_graph import HEBGraph
from hebg.node import Node


def draw_hebgraph(
Expand Down
11 changes: 4 additions & 7 deletions src/hebg/heb_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@

from __future__ import annotations

from typing import Any, Dict, List, Tuple, Optional
from typing import Any, Dict, List, Optional, Tuple

import numpy as np
from matplotlib.axes import Axes

from networkx import DiGraph


from hebg.graph import get_roots, get_successors_with_index
from hebg.behavior import Behavior
from hebg.codegen import get_hebg_source
from hebg.unrolling import unroll_graph
from hebg.draw import draw_hebgraph

from hebg.graph import get_roots, get_successors_with_index
from hebg.node import Node
from hebg.behavior import Behavior
from hebg.unrolling import unroll_graph


class HEBGraph(DiGraph):
Expand Down
2 changes: 1 addition & 1 deletion src/hebg/metrics/complexity/complexities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from typing import TYPE_CHECKING, Dict, Tuple

from hebg.behavior import Behavior
from hebg.metrics.complexity.utils import update_sum_dict
from hebg.node import Action
from hebg.behavior import Behavior

if TYPE_CHECKING:
from hebg.node import Node
Expand Down
3 changes: 1 addition & 2 deletions src/hebg/metrics/histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

import numpy as np


from hebg.metrics.complexity.utils import update_sum_dict
from hebg.behavior import Behavior
from hebg.metrics.complexity.utils import update_sum_dict
from hebg.node import Action, FeatureCondition

if TYPE_CHECKING:
Expand Down
6 changes: 3 additions & 3 deletions src/hebg/requirements_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from __future__ import annotations

from copy import deepcopy
from typing import List, Dict
from typing import Dict, List

from networkx import DiGraph, descendants

from hebg.heb_graph import HEBGraph
from hebg.behavior import Behavior
from hebg.graph import compute_levels
from hebg.heb_graph import HEBGraph
from hebg.node import EmptyNode
from hebg.behavior import Behavior


def build_requirement_graph(behaviors: List[Behavior]) -> DiGraph:
Expand Down
2 changes: 1 addition & 1 deletion src/hebg/unrolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

from networkx import relabel_nodes

from hebg.node import Node
from hebg.behavior import Behavior
from hebg.graph import compute_levels
from hebg.node import Node

BEHAVIOR_SEPARATOR = ">"

Expand Down

0 comments on commit a5ebb62

Please sign in to comment.