Skip to content

Commit

Permalink
refactor(datasets) Rename SizePartitioner to IdToSizeFncPartitioner (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-narozniak authored Sep 11, 2024
1 parent 1adc02d commit fa79c2d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 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,28 +19,28 @@
from .distribution_partitioner import DistributionPartitioner
from .exponential_partitioner import ExponentialPartitioner
from .grouped_natural_id_partitioner import GroupedNaturalIdPartitioner
from .id_to_size_fnc_partitioner import IdToSizeFncPartitioner
from .iid_partitioner import IidPartitioner
from .inner_dirichlet_partitioner import InnerDirichletPartitioner
from .linear_partitioner import LinearPartitioner
from .natural_id_partitioner import NaturalIdPartitioner
from .partitioner import Partitioner
from .pathological_partitioner import PathologicalPartitioner
from .shard_partitioner import ShardPartitioner
from .size_partitioner import SizePartitioner
from .square_partitioner import SquarePartitioner

__all__ = [
"DirichletPartitioner",
"DistributionPartitioner",
"ExponentialPartitioner",
"GroupedNaturalIdPartitioner",
"IdToSizeFncPartitioner",
"IidPartitioner",
"InnerDirichletPartitioner",
"LinearPartitioner",
"NaturalIdPartitioner",
"Partitioner",
"PathologicalPartitioner",
"ShardPartitioner",
"SizePartitioner",
"SquarePartitioner",
]
4 changes: 2 additions & 2 deletions datasets/flwr_datasets/partitioner/exponential_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import numpy as np

from flwr_datasets.partitioner.size_partitioner import SizePartitioner
from flwr_datasets.partitioner.id_to_size_fnc_partitioner import IdToSizeFncPartitioner


class ExponentialPartitioner(SizePartitioner):
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.
# ==============================================================================
"""SizePartitioner class."""
"""IdToSizeFncPartitioner class."""


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


class SizePartitioner(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
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.
# ==============================================================================
"""SizePartitioner tests."""
"""IdToSizeFuncitonPartitioner tests."""


import unittest
Expand Down
4 changes: 2 additions & 2 deletions datasets/flwr_datasets/partitioner/linear_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"""LinearPartitioner class."""


from flwr_datasets.partitioner.size_partitioner import SizePartitioner
from flwr_datasets.partitioner.id_to_size_fnc_partitioner import IdToSizeFncPartitioner


class LinearPartitioner(SizePartitioner):
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
4 changes: 2 additions & 2 deletions datasets/flwr_datasets/partitioner/square_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import numpy as np

from flwr_datasets.partitioner.size_partitioner import SizePartitioner
from flwr_datasets.partitioner.id_to_size_fnc_partitioner import IdToSizeFncPartitioner


class SquarePartitioner(SizePartitioner):
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 fa79c2d

Please sign in to comment.