Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Apply suggestions

Co-authored-by: Daniel J. Beutel <[email protected]>
  • Loading branch information
adam-narozniak and danieljanes authored Oct 13, 2023
1 parent 261fe4c commit b625ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions datasets/flwr_datasets/federated_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FederatedDataset:
dataset: str
The name of the dataset in the Hugging Face Hub.
resplitter: Optional[Union[Resplitter, Dict[Tuple[str, ...], str]]]
Resplit strategy or custom Callable that transforms the dataset.
Resplit strategy or custom `Callable` that transforms splits in the `DatasetDict`.
partitioners: Dict[str, Union[Partitioner, int]]
A dictionary mapping the Dataset split (a `str`) to a `Partitioner` or an `int`
(representing the number of IID partitions that this split should be partitioned
Expand Down Expand Up @@ -165,9 +165,8 @@ def _assign_dataset_to_partitioner(self, split: str) -> None:
self._partitioners[split].dataset = self._dataset[split]

def _resplit_dataset_if_needed(self) -> None:
# this can't be called many times
# either a new attribute is needed e.g. resplit_dataset
# or a bool flag that the resplit happened
# The actual re-splitting can't be done more than once.
# The attribute `_resplit` indicates that the resplit happened.

# Resplit only once
if self._resplit:
Expand Down
2 changes: 1 addition & 1 deletion datasets/flwr_datasets/merge_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datasets import Dataset, DatasetDict


class MergeSplitter:
class MergeResplitter:
"""Create a new dataset splits according to the `resplit_strategy`.
The dataset comes with some predefined splits e.g. "train", "valid" and "test". This
Expand Down

0 comments on commit b625ae8

Please sign in to comment.