Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datasets:skip) Fix ShardPartitioner typo #3909

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datasets/flwr_datasets/mock_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def _load_mocked_dataset_by_partial_download(
The streaming mode has a specific type of accessing the data, the first tuple
value is how many samples to skip, the second is how many samples to take. Due
to this mechanism, diverse samples can be taken (especially if the dataset is
sorted by the natual_id for NaturalIdPartitioner).
sorted by the natural_id for NaturalIdPartitioner).
subset_name: Optional[str]
Name of the subset (passed to load_dataset) e.g. "v0.01" for speech_commands.

Expand Down
8 changes: 4 additions & 4 deletions datasets/flwr_datasets/partitioner/shard_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ def __init__( # pylint: disable=R0913
) -> None:
super().__init__()
# Attributes based on the constructor
_check_if_natual_number(num_partitions, "num_partitions")
_check_if_natural_number(num_partitions, "num_partitions")
self._num_partitions = num_partitions
self._partition_by = partition_by
_check_if_natual_number(
_check_if_natural_number(
num_shards_per_partition, "num_shards_per_partition", True
)
self._num_shards_per_partition = num_shards_per_partition
self._num_shards_used: Optional[int] = None
_check_if_natual_number(shard_size, "shard_size", True)
_check_if_natural_number(shard_size, "shard_size", True)
self._shard_size = shard_size
self._keep_incomplete_shard = keep_incomplete_shard
self._shuffle = shuffle
Expand Down Expand Up @@ -360,7 +360,7 @@ def _check_possibility_of_partitions_creation(self) -> None:
)


def _check_if_natual_number(
def _check_if_natural_number(
number: Optional[int], parameter_name: str, none_acceptable: bool = False
) -> None:
if none_acceptable and number is None:
Expand Down