Skip to content

Commit

Permalink
Update component module functions docstrings for fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelhsantana committed Jul 4, 2024
1 parent 2fc449d commit eff0924
Show file tree
Hide file tree
Showing 13 changed files with 477 additions and 430 deletions.
22 changes: 7 additions & 15 deletions openfl/component/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
# Copyright (C) 2020-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""openfl.component package."""

from .aggregator import Aggregator
from .assigner import Assigner
from .assigner import RandomGroupedAssigner
from .assigner import StaticGroupedAssigner
from .assigner import Assigner, RandomGroupedAssigner, StaticGroupedAssigner
from .collaborator import Collaborator
from .straggler_handling_functions import StragglerHandlingFunction
from .straggler_handling_functions import CutoffTimeBasedStragglerHandling
from .straggler_handling_functions import PercentageBasedStragglerHandling
from .straggler_handling_functions import (CutoffTimeBasedStragglerHandling,
PercentageBasedStragglerHandling,
StragglerHandlingFunction)

__all__ = [
'Assigner',
'RandomGroupedAssigner',
'StaticGroupedAssigner',
'Aggregator',
'Collaborator',
'StragglerHandlingFunction',
'CutoffTimeBasedStragglerHandling',
'PercentageBasedStragglerHandling'
'Assigner', 'RandomGroupedAssigner', 'StaticGroupedAssigner', 'Aggregator',
'Collaborator', 'StragglerHandlingFunction',
'CutoffTimeBasedStragglerHandling', 'PercentageBasedStragglerHandling'
]
12 changes: 5 additions & 7 deletions openfl/component/assigner/random_grouped_assigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ def define_task_assignments(self):
Returns:
None
"""
assert (
np.abs(1.0 -
np.sum([group['percentage'] for group in self.task_groups]))
< 0.01), ('Task group percentages must sum to 100%')
assert (np.abs(1.0 - np.sum([group['percentage']
for group in self.task_groups])) < 0.01), (
'Task group percentages must sum to 100%')

# Start by finding all of the tasks in all specified groups
self.all_tasks_in_groups = list(
Expand All @@ -83,9 +82,8 @@ def define_task_assignments(self):
for group in self.task_groups:
num_col_in_group = int(group['percentage'] * col_list_size)
rand_col_group_list = [
self.authorized_cols[i]
for i in randomized_col_idx[col_idx:col_idx +
num_col_in_group]
self.authorized_cols[i] for i in
randomized_col_idx[col_idx:col_idx + num_col_in_group]
]
self.task_group_collaborators[
group['name']] = rand_col_group_list
Expand Down
1 change: 0 additions & 1 deletion openfl/component/collaborator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (C) 2020-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""Collaborator package."""

from .collaborator import Collaborator
Expand Down
217 changes: 103 additions & 114 deletions openfl/component/collaborator/collaborator.py

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions openfl/component/director/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Copyright (C) 2020-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""Director package."""

from .director import Director


__all__ = [
'Director',
]
Loading

0 comments on commit eff0924

Please sign in to comment.