Skip to content

Commit

Permalink
✨ Apply ruff lint and formating on src
Browse files Browse the repository at this point in the history
Remove pylintrc
  • Loading branch information
MathisFederico committed Jan 16, 2024
1 parent 76b3861 commit af061f4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 514 deletions.
511 changes: 0 additions & 511 deletions .pylintrc

This file was deleted.

11 changes: 11 additions & 0 deletions src/hebg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@
from hebg.heb_graph import HEBGraph
from hebg.node import Action, EmptyNode, FeatureCondition, Node, StochasticAction
from hebg.requirements_graph import build_requirement_graph

__all__ = [
"HEBGraph",
"Behavior",
"Action",
"EmptyNode",
"FeatureCondition",
"Node",
"StochasticAction",
"build_requirement_graph",
]
2 changes: 2 additions & 0 deletions src/hebg/layouts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@

from hebg.layouts.deterministic import staircase_layout
from hebg.layouts.metabased import leveled_layout_energy

__all__ = ["staircase_layout", "leveled_layout_energy"]
2 changes: 1 addition & 1 deletion src/hebg/layouts/deterministic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def staircase_layout(graph: nx.DiGraph, center=None):
"""

def place_successors(pos, pos_by_level, node, level) -> int:
if not level in pos_by_level:
if level not in pos_by_level:
pos_by_level[level] = pos_by_level[level - 1]
pos_by_level[level] = max(pos[node][0], pos_by_level[level])
succs = list(graph.successors(node))
Expand Down
1 change: 0 additions & 1 deletion src/hebg/layouts/metaheuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def simulated_annealing(
max_iters_without_new: int = np.inf,
verbose: bool = 1,
):

"""Perform simulated annealing metaheuristic on an energy using a neighboring.
See https://en.wikipedia.org/wiki/Simulated_annealing for more details.
Expand Down
2 changes: 2 additions & 0 deletions src/hebg/metrics/complexity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
""" Module for complexity computation methods. """

from hebg.metrics.complexity.complexities import general_complexity, learning_complexity

__all__ = ["general_complexity", "learning_complexity"]
2 changes: 2 additions & 0 deletions src/hebg/metrics/utility/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
""" Module for utility computation methods. """

from hebg.metrics.utility.binary_utility import binary_graphbased_utility

__all__ = ["binary_graphbased_utility"]
1 change: 0 additions & 1 deletion src/hebg/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def bytecode_complexity(obj):


class Node:

NODE_TYPES = ("action", "feature_condition", "behavior", "empty")

def __init__(
Expand Down

0 comments on commit af061f4

Please sign in to comment.