Skip to content

Commit 94eaaf4

Browse files
committed
[skip ci] Update error message
1 parent 018dd9b commit 94eaaf4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pydvl/valuation/samplers/classwise.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,16 @@ def batches_from_data(self, data: Dataset) -> BatchGenerator:
255255
break
256256

257257
def generate_batches(self, indices: IndexSetT) -> BatchGenerator:
258-
raise AttributeError("Cannot sample from indices directly. Call `from_data()`.")
258+
raise AttributeError(
259+
"Cannot sample from indices directly. Call `batches_from_data()`."
260+
)
259261

260262
def generate(self, indices: IndexSetT) -> SampleGenerator:
261263
"""This is not needed because this sampler is used by calling the `from_data`
262264
method instead of the `generate_batches` method."""
263-
raise AttributeError("Cannot sample from indices directly.")
265+
raise AttributeError(
266+
"Cannot sample from indices directly. Call `samples_from_data()`."
267+
)
264268

265269
def log_weight(self, n: int, subset_len: int) -> float:
266270
"""CW-Shapley uses the evaluation strategy from the in-class sampler, so this

0 commit comments

Comments
 (0)