Skip to content

Commit

Permalink
fixed the setter of _empty/_grand values
Browse files Browse the repository at this point in the history
  • Loading branch information
mmschlk committed Oct 24, 2024
1 parent 3e6d552 commit d944f80
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions shapiq/games/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ def __init__(
# define some handy coalition variables
self.empty_coalition = np.zeros(self.n_players, dtype=bool)
self.grand_coalition = np.ones(self.n_players, dtype=bool)
self._empty_coalition_value: Optional[float] = None
self._grand_coalition_value: Optional[float] = None
# don't know if the following is kosher (probably not)
try:
self._empty_coalition_value = self._empty_coalition_value
except AttributeError:
self._empty_coalition_value = None
try:
self._grand_coalition_value = self._grand_coalition_value
except AttributeError:
self._grand_coalition_value = None

self.verbose = verbose

Expand Down

0 comments on commit d944f80

Please sign in to comment.