Skip to content

Commit

Permalink
Rename IdToSizeFunctionPartitioner to IdToSizeFncPartitioner
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-narozniak committed Sep 11, 2024
1 parent 87323fa commit 5b48311
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions datasets/flwr_datasets/partitioner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .distribution_partitioner import DistributionPartitioner
from .exponential_partitioner import ExponentialPartitioner
from .grouped_natural_id_partitioner import GroupedNaturalIdPartitioner
from .id_to_size_function_partitioner import IdToSizeFunctionPartitioner
from .id_to_size_fnc_partitioner import IdToSizeFncPartitioner
from .iid_partitioner import IidPartitioner
from .inner_dirichlet_partitioner import InnerDirichletPartitioner
from .linear_partitioner import LinearPartitioner
Expand All @@ -34,7 +34,7 @@
"DistributionPartitioner",
"ExponentialPartitioner",
"GroupedNaturalIdPartitioner",
"IdToSizeFunctionPartitioner",
"IdToSizeFncPartitioner",
"IidPartitioner",
"InnerDirichletPartitioner",
"LinearPartitioner",
Expand Down
6 changes: 2 additions & 4 deletions datasets/flwr_datasets/partitioner/exponential_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@

import numpy as np

from flwr_datasets.partitioner.id_to_size_function_partitioner import (
IdToSizeFunctionPartitioner,
)
from flwr_datasets.partitioner.id_to_size_fnc_partitioner import IdToSizeFncPartitioner


class ExponentialPartitioner(IdToSizeFunctionPartitioner):
class ExponentialPartitioner(IdToSizeFncPartitioner):
"""Partitioner creates partitions of size that are correlated with exp(id).
The amount of data each client gets is correlated with the exponent of partition ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""IdToSizeFuncitonPartitioner class."""
"""IdToSizeFncPartitioner class."""


from typing import Callable, Dict, List, Union
Expand All @@ -23,7 +23,7 @@
from flwr_datasets.partitioner.partitioner import Partitioner


class IdToSizeFunctionPartitioner(Partitioner):
class IdToSizeFncPartitioner(Partitioner):
"""Base class for the deterministic size partitioning based on the `partition_id`.
The client with `partition_id` has the following relationship regarding the number
Expand Down
6 changes: 2 additions & 4 deletions datasets/flwr_datasets/partitioner/linear_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
"""LinearPartitioner class."""


from flwr_datasets.partitioner.id_to_size_function_partitioner import (
IdToSizeFunctionPartitioner,
)
from flwr_datasets.partitioner.id_to_size_fnc_partitioner import IdToSizeFncPartitioner


class LinearPartitioner(IdToSizeFunctionPartitioner):
class LinearPartitioner(IdToSizeFncPartitioner):
"""Partitioner creates partitions of size that are linearly correlated with id.
The amount of data each client gets is linearly correlated with the partition ID.
Expand Down
6 changes: 2 additions & 4 deletions datasets/flwr_datasets/partitioner/square_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@

import numpy as np

from flwr_datasets.partitioner.id_to_size_function_partitioner import (
IdToSizeFunctionPartitioner,
)
from flwr_datasets.partitioner.id_to_size_fnc_partitioner import IdToSizeFncPartitioner


class SquarePartitioner(IdToSizeFunctionPartitioner):
class SquarePartitioner(IdToSizeFncPartitioner):
"""Partitioner creates partitions of size that are correlated with squared id.
The amount of data each client gets is correlated with the squared partition ID.
Expand Down

0 comments on commit 5b48311

Please sign in to comment.