Skip to content

Commit

Permalink
fixed linting and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
hweichelt committed Jun 4, 2024
1 parent d060cf5 commit 49eee4e
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 299 deletions.
2 changes: 0 additions & 2 deletions src/clingexplaid/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

import sys

import clingo
from clingo.application import clingo_main

from .cli.clingo_app import ClingoExplaidApp
from .cli.textual_gui import textual_main
from .propagators import SolverDecisionPropagator

RUN_TEXTUAL_GUI = False

Expand Down
18 changes: 3 additions & 15 deletions src/clingexplaid/cli/clingo_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from clingo.application import Application, Flag

from ..mus import CoreComputer
from ..propagators import DecisionOrderPropagator
from ..transformers import AssumptionTransformer, OptimizationRemover
from ..unsat_constraints import UnsatConstraintComputer
from ..utils import get_constants_from_arguments
Expand Down Expand Up @@ -202,7 +201,6 @@ def _method_mus(
files=files,
assumption_string=mus_string,
output_prefix_active=f"{COLORS['RED']}├──{COLORS['NORMAL']}",
output_prefix_passive=f"{COLORS['RED']}{COLORS['NORMAL']}",
)

# Case: Finding multiple MUS
Expand All @@ -225,7 +223,6 @@ def _method_mus(
files=files,
assumption_string=mus_string,
output_prefix_active=f"{COLORS['RED']}├──{COLORS['NORMAL']}",
output_prefix_passive=f"{COLORS['RED']}{COLORS['NORMAL']}",
)
if not n_mus:
print(
Expand Down Expand Up @@ -274,14 +271,7 @@ def _method_unsat_constraints(
files: List[str],
assumption_string: Optional[str] = None,
output_prefix_active: str = "",
output_prefix_passive: str = "",
) -> None:
# register DecisionOrderPropagator if flag is enabled
if self.method_flags["show-decisions"]:
decision_signatures = set(self._show_decisions_decision_signatures.items())
dop = DecisionOrderPropagator(signatures=decision_signatures, prefix=output_prefix_passive)
control.register_propagator(dop) # type: ignore

ucc = UnsatConstraintComputer(control=control)
ucc.parse_files(files)
unsat_constraints = ucc.get_unsat_constraints(assumption_string=assumption_string)
Expand Down Expand Up @@ -309,11 +299,9 @@ def _method_show_decisions(
control: clingo.Control,
files: List[str],
) -> None:
app = ClingexplaidTextualApp(
files=files,
constants={},
signatures=set(),
)
print(control) # only for pylint

app = ClingexplaidTextualApp(files=files, constants={})
app.run()

def print_model(self, model: clingo.Model, _) -> None: # type: ignore
Expand Down
Loading

0 comments on commit 49eee4e

Please sign in to comment.