Skip to content

Commit

Permalink
Fix misspellings
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Nov 10, 2023
1 parent 18e941d commit c94c465
Show file tree
Hide file tree
Showing 119 changed files with 485 additions and 535 deletions.
6 changes: 3 additions & 3 deletions capsul/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _is_nipype_interface_subclass(obj):
class Capsul:
"""User entry point to Capsul features.
This objects reads Capsul configuration in site and user environments.
It allows configuration customization and instanciation of a
It allows configuration customization and instantiation of a
CapsulEngine instance to reach an execution environment.
If database_path is given, it replaces
Expand Down Expand Up @@ -255,13 +255,13 @@ def executable(definition, **kwargs):
except ImportError as e:
raise TypeError(
f"Class {definition} cannot be used to create a Process "
"beacause its module cannot be imported : {e}"
"because its module cannot be imported : {e}"
)
cls = getattr(module, object_name, None)
if cls is not definition:
raise TypeError(
f"Class {definition} cannot be used to create a Process "
f"beacause variable {object_name} of module {module_name} "
f"because variable {object_name} of module {module_name} "
f"contains {cls}"
)
result = definition(definition=f"{module_name}.{object_name}")
Expand Down
2 changes: 1 addition & 1 deletion capsul/config/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class EngineConfiguration(Controller):
)

def add_module(self, module_name, allow_existing=False):
"""Loads a modle and adds it in the engine configuration.
"""Loads a module and adds it in the engine configuration.
This operation is performed automatically, thus should not need to be
called manually.
Expand Down
4 changes: 2 additions & 2 deletions capsul/database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def worker_ended(self, engine_id, worker_id):

def persistent(self, engine_id):
"""
Return wether an engine is persistent or not.
Return whether an engine is persistent or not.
"""
raise NotImplementedError

Expand All @@ -512,7 +512,7 @@ def set_persistent(self, engine_id, persistent):
def dispose_engine(self, engine_id):
"""
Tell Capsul that this engine will not be used anymore by any client.
The ressource it uses must be freed as soon as possible. If no
The resource it uses must be freed as soon as possible. If no
execution is running, engine is destroyed. Otherwise, workers will
process ongoing executions and cleanup when done.
"""
Expand Down
2 changes: 1 addition & 1 deletion capsul/database/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def dispose_engine(self, engine_id):
# Removes association between label and engine_id
self.redis.hdel("capsul:engine", label)
self.redis.hdel(f"capsul:{engine_id}", "label")
# Check if some executions had been submited or are ongoing
# Check if some executions had been submitted or are ongoing
# An empty list modified with Redis Lua scripts may be encoded as empty dict
executions = json.loads(
self.redis.hget(f"capsul:{engine_id}", "executions")
Expand Down
2 changes: 1 addition & 1 deletion capsul/database/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def job_finished_json(

sql = "SELECT ready, ongoing, failed, waiting, done FROM capsul_execution WHERE engine_id=? AND execution_id=?"
row = sqlite.execute(sql, [engine_id, execution_id]).fetchone()
ready, ongoing, failed, waiting, done = [json.loads(i) for i in row]
ready, ongoing, failed, waiting, done = (json.loads(i) for i in row)
ongoing.remove(job_id)
if return_code != 0:
failed.append(job_id)
Expand Down
6 changes: 3 additions & 3 deletions capsul/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Dataset(Controller):
Dataset representation.
You don't need to define or instantiate this class yourself, it will be done automatically and internally in the path generation system.
Instead, users need to define datsets in the Capsul config. See :func:`generate_paths`.
Instead, users need to define datasets in the Capsul config. See :func:`generate_paths`.
"""

path: Directory
Expand Down Expand Up @@ -676,7 +676,7 @@ def apply(self, metadata, process, parameter, initial_meta):
continue
if callable(v):
if debug:
print("call modifier funciton for", k)
print("call modifier function for", k)
print(
":",
v(
Expand All @@ -700,7 +700,7 @@ def apply(self, metadata, process, parameter, initial_meta):
setattr(metadata, k, v)
else:
if debug:
print("call modifier funciton")
print("call modifier function")
modifier(metadata, process, parameter, initial_meta=initial_meta)


Expand Down
2 changes: 1 addition & 1 deletion capsul/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def execution_context(engine_label, engine_config, executable):
# {'spm': {'spm12-standalone': {...}, 'spm8': {...}}
# whereas EXecutionContext expects an execution-side single, filtered
# config: {'spm': {...}}
# Thie filtering is done here in this function, but later after the context
# This filtering is done here in this function, but later after the context
# is built.
# So for now, give it only the dataset and config_modules part, removing
# all modules config.
Expand Down
23 changes: 11 additions & 12 deletions capsul/info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import os.path
import sys

Expand All @@ -19,7 +18,7 @@
_version_extra = version_extra

# Expected by setup.py: string of form "X.Y.Z"
__version__ = "{0}.{1}.{2}".format(version_major, version_minor, version_micro)
__version__ = "{}.{}.{}".format(version_major, version_minor, version_micro)

brainvisa_dependencies = [
"soma-base",
Expand Down Expand Up @@ -84,25 +83,25 @@
PROVIDES = ["capsul"]
REQUIRES = [
"redis <4.5.0",
"pydantic >={0}".format(PYDANTIC_MIN_VERSION),
"soma-base >={0}".format(SOMA_MIN_VERSION),
"soma-workflow >={0}".format(SOMA_WORKFLOW_MIN_VERSION),
"populse-db >={0}".format(POPULSE_DB_MIN_VERSION),
"pydantic >={}".format(PYDANTIC_MIN_VERSION),
"soma-base >={}".format(SOMA_MIN_VERSION),
"soma-workflow >={}".format(SOMA_WORKFLOW_MIN_VERSION),
"populse-db >={}".format(POPULSE_DB_MIN_VERSION),
"PyYAML",
]
EXTRA_REQUIRES = {
"test": ["pytest", "jupyter"],
"doc": [
"sphinx >=1.0",
"numpy >={0}".format(NUMPY_MIN_VERSION),
"numpy >={}".format(NUMPY_MIN_VERSION),
],
"nipype": [
"traits >={}".format(TRAITS_MIN_VERSION),
"numpy >={0}".format(NUMPY_MIN_VERSION),
"scipy >={0}".format(SCIPY_MIN_VERSION),
"nibabel >={0}".format(NIBABEL_MIN_VERSION),
"networkx >={0}".format(NETWORKX_MIN_VERSION),
"nipype =={0}".format(NIPYPE_VERSION),
"numpy >={}".format(NUMPY_MIN_VERSION),
"scipy >={}".format(SCIPY_MIN_VERSION),
"nibabel >={}".format(NIBABEL_MIN_VERSION),
"networkx >={}".format(NETWORKX_MIN_VERSION),
"nipype =={}".format(NIPYPE_VERSION),
],
}

Expand Down
2 changes: 1 addition & 1 deletion capsul/pipeline/custom_nodes/cv_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, pipeline, name, input_type=None):
in_fields.append({"name": tr, "optional": True})
for tr in out_fieldsl:
out_fields.append({"name": tr, "optional": True})
super(CrossValidationFoldNode, self).__init__(
super().__init__(
None, pipeline, name, in_fields, out_fields
)
if input_type:
Expand Down
3 changes: 1 addition & 2 deletions capsul/pipeline/custom_nodes/loo_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""


from __future__ import absolute_import
from capsul.process.node import Node
from soma.controller import Controller, Any, type_from_str

Expand Down Expand Up @@ -47,7 +46,7 @@ def __init__(
in_fields.append({"name": tr, "optional": True})
for tr in out_fieldsl:
out_fields.append({"name": tr, "optional": True})
super(LeaveOneOutNode, self).__init__(
super().__init__(
None, pipeline, name, in_fields, out_fields
)
if input_type:
Expand Down
3 changes: 1 addition & 2 deletions capsul/pipeline/custom_nodes/map_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""


from __future__ import absolute_import
from capsul.process.node import Node, Plug
from soma.controller import Controller, File, undefined, field, type_from_str

Expand Down Expand Up @@ -54,7 +53,7 @@ def __init__(

for tr in input_names:
in_fields.append({"name": tr, "optional": False})
super(MapNode, self).__init__(None, pipeline, name, in_fields, out_fields)
super().__init__(None, pipeline, name, in_fields, out_fields)

for tr, ptype in zip(input_names, ptypes):
self.add_field(tr, list[ptype], output=False, default_factory=list)
Expand Down
2 changes: 1 addition & 1 deletion capsul/pipeline/custom_nodes/reduce_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(

for tr in output_names:
out_fields.append({"name": tr, "optional": False})
super(ReduceNode, self).__init__(None, pipeline, name, in_fields, out_fields)
super().__init__(None, pipeline, name, in_fields, out_fields)

for tr, ptype in zip(output_names, ptypes):
self.add_field(
Expand Down
3 changes: 1 addition & 2 deletions capsul/pipeline/custom_nodes/strcat_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
-------------------
"""

from __future__ import absolute_import
from capsul.process.node import Node
from soma.controller import Controller, Any, type_from_str

Expand Down Expand Up @@ -62,7 +61,7 @@ def __init__(
node_inputs.append(
{"name": concat_plug, "optional": concat_plug in make_optional}
)
super(StrCatNode, self).__init__(
super().__init__(
None, pipeline, name, node_inputs, node_outputs
)
self._concat_sequence = params
Expand Down
2 changes: 1 addition & 1 deletion capsul/pipeline/custom_nodes/strconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, pipeline, name, input_type=None):
in_fields.append({"name": tr, "optional": True})
for tr in out_fieldsl:
out_fields.append({"name": tr, "optional": True})
super(StrConvNode, self).__init__(None, pipeline, name, in_fields, out_fields)
super().__init__(None, pipeline, name, in_fields, out_fields)
if input_type:
ptype = input_type
else:
Expand Down
Loading

0 comments on commit c94c465

Please sign in to comment.