Skip to content

Commit

Permalink
Use directly a set comprehension...
Browse files Browse the repository at this point in the history
... instead of a list comprehension to initialise a set.
  • Loading branch information
DimitriPapadopoulos committed Nov 19, 2023
1 parent 4f62bd3 commit 55f1149
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
10 changes: 4 additions & 6 deletions capsul/pipeline/test/test_custom_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,10 @@ def pipeline_definition(self):
self.add_iterative_process(
"test_it",
"capsul.pipeline.test.test_custom_nodes.CVtest",
non_iterative_plugs=set(
[
"model",
"base",
]
),
non_iterative_plugs={
"model",
"base",
},
make_optional=["out1"],
)
self.add_custom_node(
Expand Down
2 changes: 1 addition & 1 deletion capsul/pipeline/test/test_iterative_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_iterative_big_pipeline_workflow(self):
subject = workflow.parameters_values[proxy[1]]
subjects.add(subject)
self.assertIn(subject, ["toto", "tutu", "tata", "titi", "tete"])
self.assertEqual(subjects, set(["toto", "tutu", "tata", "titi", "tete"]))
self.assertEqual(subjects, {"toto", "tutu", "tata", "titi", "tete"})

def test_iterative_pipeline_workflow_run(self):
self.small_pipeline.output_image = [
Expand Down
18 changes: 8 additions & 10 deletions capsul/qt_gui/widgets/settings_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ def update_gui(self):
self.tab_wid.clear()
self.module_tabs = {}
resource = self.resource_combo.currentText()
non_modules = set(
[
"dataset",
"config_modules",
"python_modules",
"database",
"persistent",
"start_workers",
]
)
non_modules = {
"dataset",
"config_modules",
"python_modules",
"database",
"persistent",
"start_workers",
}
mod_map = [
f.name
for f in getattr(self.config, resource).fields()
Expand Down
2 changes: 1 addition & 1 deletion capsul/sphinxext/capsul_pipeline_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
):
# From the modules full path 'm1.m2.pipeline/process' get the module
# name 'm2'
module_names = set([x.split(".")[1] for x in modules])
module_names = {x.split(".")[1] for x in modules}

# Sort each item according to its module name.
# The result is a dict of the form 'd[m2] = [pipeline/process1, ...]'.
Expand Down
2 changes: 1 addition & 1 deletion capsul/sphinxext/capsul_usecases_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

# Sort all the pilots
# > from the pilots full path 'm1.m2.pipeline' get the module name 'm2'
module_names = set([x.split(".")[1] for x in pilots])
module_names = {x.split(".")[1] for x in pilots}
# > sort each pilot according to its module name.
# > the result is a dict of the form 'd[m2] = [pilot1, ...]'
sorted_pilots = {}
Expand Down

0 comments on commit 55f1149

Please sign in to comment.