Skip to content

Commit

Permalink
Fix ruff/flake8-bugbear (B020) issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Mar 4, 2024
1 parent 44b091e commit 9a695e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions capsul/execution_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,15 +772,15 @@ def find_temporary_to_generate(executable):
field.generate_temporary = False
if isinstance(node, ProcessIteration):
node.process.field(field.name).generate_temporary = field.generate_temporary
for node, parameter in executable.get_linked_items(
for snode, parameter in executable.get_linked_items(
node, field.name, direction="links_from", in_outer_pipelines=True
):
if isinstance(node, ProcessIteration):
stack.append((node.process, node.process.field(parameter)))
# print('!temporaries! + ', node.process.full_name, ':', parameter)
stack.append((snode.process, snode.process.field(parameter)))
# print('!temporaries! + ', snode.process.full_name, ':', parameter)
else:
stack.append((node, node.field(parameter)))
# print('!temporaries! + ', node.full_name, ':', parameter)
stack.append((snode, snode.field(parameter)))
# print('!temporaries! + ', snode.full_name, ':', parameter)

# print('!temporaries! parameters with temporary')
# for n, p in temporaries:
Expand Down
8 changes: 4 additions & 4 deletions capsul/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2460,10 +2460,10 @@ def __setitem__(self, path, value):
def dispatch_value(self, node, name, value):
"""Propagate the value from a pipeline plug through links"""
# print(f"!dispatch! {node.name}.{name} = {value}")
for node, plug in self.dispatch_plugs(node, name):
# print(f"!dispatch! -> {node.name}.{plug}")
if getattr(node, plug, undefined) != value:
setattr(node, plug, value)
for snode, plug in self.dispatch_plugs(node, name):
# print(f"!dispatch! -> {snode.name}.{plug}")
if getattr(snode, plug, undefined) != value:
setattr(snode, plug, value)

def dispatch_plugs(self, node, name):
"""generator through linked plugs"""
Expand Down
2 changes: 1 addition & 1 deletion capsul/pipeline/python_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _write_process(process, pyf, name, enabled, skip_invalid):

if isinstance(snode, Pipeline):
sself_str = '%s.nodes["%s"]' % (self_str, "%s")
for node_name, snode in snode.nodes.items():
for node_name, _ in snode.nodes.items():
scnode = cnode.nodes[node_name]

if node_name == "":
Expand Down

0 comments on commit 9a695e2

Please sign in to comment.