Skip to content

Commit

Permalink
Add and run isort
Browse files Browse the repository at this point in the history
  • Loading branch information
m-naumann committed Jan 16, 2024
1 parent 0f2ce12 commit a5473c0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: run black
run: black --check .

- name: run isort
run: isort .

- name: run pylint for mdp folder
run: pylint src/behavior_generation_lecture_python/mdp --errors-only

Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ dev = [
"pytest",
"pytest-cov>=3.0.0",
"pylint",
"mypy"
"mypy",
"isort"
]
docs = [
"mkdocs-material",
Expand All @@ -45,3 +46,6 @@ docs = [
[build-system]
requires = ["setuptools>=64.0.0", "wheel", "pip>=21.3.0"]
build-backend = "setuptools.build_meta"

[tool.isort]
profile = "black"
2 changes: 1 addition & 1 deletion scripts/run_a_star.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from behavior_generation_lecture_python.graph_search.a_star import Node, Graph
from behavior_generation_lecture_python.graph_search.a_star import Graph, Node


def main():
Expand Down
4 changes: 2 additions & 2 deletions src/behavior_generation_lecture_python/graph_search/a_star.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from __future__ import annotations

from typing import Dict, List, Set

import matplotlib.pyplot as plt
import numpy as np

from typing import Dict, List, Set


class Node:
def __init__(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import defaultdict

import matplotlib.pyplot as plt
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion tests/test_a_star.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib
import numpy as np

from behavior_generation_lecture_python.graph_search.a_star import Node, Graph
from behavior_generation_lecture_python.graph_search.a_star import Graph, Node


def test_example_graph():
Expand Down
6 changes: 3 additions & 3 deletions tests/test_mdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
MDP,
SIMPLE_MDP_DICT,
GridMDP,
best_action_from_q_table,
derive_policy,
expected_utility_of_action,
value_iteration,
best_action_from_q_table,
random_action,
greedy_value_estimate_for_state,
q_learning,
random_action,
value_iteration,
)


Expand Down
8 changes: 4 additions & 4 deletions tests/utils/test_grid_plotting.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import matplotlib

from behavior_generation_lecture_python.utils.grid_plotting import (
make_plot_grid_step_function,
make_plot_policy_step_function,
)
from behavior_generation_lecture_python.mdp.mdp import (
GRID_MDP_DICT,
GridMDP,
derive_policy,
)
from behavior_generation_lecture_python.utils.grid_plotting import (
make_plot_grid_step_function,
make_plot_policy_step_function,
)

TRUE_UTILITY_GRID_MDP = {
(0, 0): 0.705,
Expand Down

0 comments on commit a5473c0

Please sign in to comment.