Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
susuhahnml committed Aug 7, 2024
1 parent 015dc65 commit 4832b30
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion clinguin/server/application/backends/clingo_backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable=R0801
# pylint: disable=too-many-lines
"""
Module that contains the ClingoMultishotBackend.
"""
Expand Down Expand Up @@ -160,7 +161,7 @@ def _assumption_list(self) -> list:
"""
A list of assumptions in the format of form (a, True) or (a, False)
"""
return [a for a in self._assumptions]
return self._assumptions

# ---------------------------------------------
# Initialization
Expand Down
9 changes: 5 additions & 4 deletions clinguin/server/application/backends/explanation_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _assumption_list(self):
Overwrites :meth:`ClingoBackend._assumption_list`
"""
return [a for a in self._assumptions.union(self._assumptions_from_signature)]
return self._assumptions.union(self._assumptions_from_signature)

# ---------------------------------------------
# Initialization
Expand Down Expand Up @@ -104,14 +104,15 @@ def _load_file(self, f):
# Solving
# ---------------------------------------------
@extends(ClingoMultishotBackend)
def _ground(self, program="base"):
def _ground(self, program="base", arguments=None):
"""
Sets the list of assumptions that were taken from the input files using the assumption_signature.
Attributes:
_assumptions_from_signature (Set[Tuple(clingo.Symbol,bool)]): The set of assumptions from the assumption signatures
_assumptions_from_signature (Set[Tuple(str,bool)]): The set of assumptions from the assumption signatures
arguments (list, optional): The list of arguments to ground the program. Defaults to an empty list.
"""
super()._ground(program)
super()._ground(program, arguments)
# pylint: disable= attribute-defined-outside-init
transformer_assumptions = self._assumption_transformer.get_assumption_symbols(
self._ctl, arguments=self._ctl_arguments_list
Expand Down
7 changes: 6 additions & 1 deletion clinguin/server/data/clinguin_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Clinguin Context passed to the clingo control object with helper python functions
"""

from clingo.symbol import String, SymbolType


Expand Down Expand Up @@ -37,7 +41,8 @@ def format(self, s, *args):
Args:
s (str): The string to format, for example "{0} and {1}"
args: All symbols that can be accessed by the position starting in 0. If there is a single tuple as an argument, then its arguments are considered one by one.
args: All symbols that can be accessed by the position starting in 0.
If there is a single tuple as an argument, then its arguments are considered one by one.
Returns:
The string obtained by formatting the string with the given arguments
"""
Expand Down
2 changes: 1 addition & 1 deletion clinguin/server/data/ui_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import clorm
from clingo import Control, parse_term
from clingo.symbol import Function, Number, String
from clinguin.server.data.clinguin_context import ClinguinContext
from clorm import Raw

from clinguin.server.data.clinguin_context import ClinguinContext
from clinguin.utils import StandardTextProcessing, image_to_b64

from ...utils.logger import uictl_log
Expand Down

0 comments on commit 4832b30

Please sign in to comment.