Skip to content

Commit 0a5e03a

Browse files
Advueu963mmschlk
authored andcommitted
fix: Remove defense checks
1 parent 7b7c7f2 commit 0a5e03a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/shapiq/interaction_values.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,9 +1200,6 @@ def _validate_and_return_interactions(
12001200
TypeError: If the values or interaction_lookup are not of the expected types.
12011201
"""
12021202
interactions: dict[tuple[int, ...], float] = {}
1203-
if values is None:
1204-
msg = "Values must be provided."
1205-
raise TypeError(msg)
12061203
if interaction_lookup is None:
12071204
interaction_lookup = generate_interaction_lookup(
12081205
players=n_players,
@@ -1215,13 +1212,10 @@ def _validate_and_return_interactions(
12151212

12161213
if isinstance(values, dict):
12171214
interactions = copy.deepcopy(values)
1218-
elif isinstance(values, np.ndarray):
1215+
else:
12191216
interactions = {
12201217
interaction: values[index].item() for interaction, index in interaction_lookup.items()
12211218
}
1222-
else:
1223-
msg = f"Values must be a numpy array or dictionary. Got {type(values)}."
1224-
raise TypeError(msg)
12251219

12261220
if min_order == 0 and () not in interactions:
12271221
interactions[()] = float(baseline_value)

0 commit comments

Comments
 (0)