Skip to content

Commit

Permalink
Fix inconsistent use of enumerate in loops
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Foley <[email protected]>
  • Loading branch information
psfoley committed Jan 5, 2024
1 parent f3f3bca commit 023a449
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/github/experimental/testflow_exclude.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def end(self):
# Setup collaborators
collaborator_names = ["Portland", "Chandler", "Bangalore", "Delhi"]
collaborators = []
for collaborator_name in enumerate(collaborator_names):
for collaborator_name in collaborator_names:
collaborators.append(Collaborator(name=collaborator_name))

local_runtime = LocalRuntime(aggregator=aggregator, collaborators=collaborators)
Expand Down
2 changes: 1 addition & 1 deletion tests/github/experimental/testflow_include_exclude.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def end(self):
# Setup collaborators
collaborator_names = ["Portland", "Chandler", "Bangalore", "Delhi"]
collaborators = []
for collaborator_name in enumerate(collaborator_names):
for idx, collaborator_name in enumerate(collaborator_names):
collaborators.append(
Collaborator(
name=collaborator_name,
Expand Down
2 changes: 1 addition & 1 deletion tests/github/experimental/testflow_internalloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def display_validate_errors(validate_flow_error):
"New York",
]
collaborators = []
for collaborator_name in enumerate(collaborator_names):
for collaborator_name in collaborator_names:
collaborators.append(Collaborator(name=collaborator_name))

local_runtime = LocalRuntime(aggregator=aggregator, collaborators=collaborators)
Expand Down
7 changes: 3 additions & 4 deletions tests/github/experimental/testflow_privateattributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ def join(self, inputs):
+ f" not accessible {bcolors.ENDC}"
)

for input in enumerate(inputs):
collab = input[1].input
for idx, collab in enumerate(inputs):
if (
hasattr(input, "train_loader") is True
or hasattr(input, "test_loader") is True
hasattr(collab, "train_loader") is True
or hasattr(collab, "test_loader") is True
):
# Error - we are able to access collaborator attributes
TestFlowPrivateAttributes.error_list.append(
Expand Down

0 comments on commit 023a449

Please sign in to comment.