Skip to content

Commit 18d9a82

Browse files
author
Alan Christie
committed
docs: Code typos corrected
1 parent a3f76ed commit 18d9a82

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

workflow/decoder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from dataclasses import dataclass
2121
from typing import Any
2222

23-
import decoder.decoder as job_defintion_decoder
23+
import decoder.decoder as job_definition_decoder
2424
import jsonschema
2525
import yaml
2626

@@ -40,7 +40,7 @@
4040

4141
@dataclass
4242
class Connector:
43-
"""A connection - connexts a plumbing source variable ("in_")
43+
"""A connection - connects a plumbing source variable ("in_")
4444
to destination variable ("out")."""
4545

4646
in_: str
@@ -98,9 +98,9 @@ def get_description(definition: dict[str, Any]) -> str | None:
9898

9999
def is_workflow_output_variable(definition: dict[str, Any], variable_name: str) -> bool:
100100
"""True if the variable name is in the workflow variables outputs list."""
101-
# We can safely pass on the workflow defitnion as its
102-
# root-level 'variables' block complies with job-defintion variables.
103-
return variable_name in job_defintion_decoder.get_outputs(definition)
101+
# We can safely pass on the workflow definition as its
102+
# root-level 'variables' block complies with job-definition variables.
103+
return variable_name in job_definition_decoder.get_outputs(definition)
104104

105105

106106
def get_workflow_variable_names(definition: dict[str, Any]) -> set[str]:

workflow/workflow-schema.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ definitions:
170170
type: string
171171
description: A description of the step
172172
specification:
173-
# The step Job specififcation.
173+
# The step Job specification.
174174
# This MUST define `collection`, a 'job', and a 'version'.
175175
# 'variables' (a map of name and value)can also be provided.
176-
# The format of this is essentially idenical to the specification
176+
# The format of this is essentially identical to the specification
177177
# used when a Job is launched via the DM API.
178178
$ref: '#/definitions/step-specification'
179179
plumbing:

workflow/workflow_abc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,26 @@ class LaunchParameters:
9393
step_name: str | None = None
9494
# The step replication number.
9595
# A numeric vale expected to be in the range 0 to total_number_of_replicas - 1.
96-
# If a step is laucnhed 5 times the values used when laucnhing each instance
96+
# If a step is launched 5 times the values used when launching each instance
9797
# must be 0, 1, 2, 3, and 4.
9898
step_replication_number: int = 0
99-
# The total number of replicas of this instance that are expected to be laucnhed.
99+
# The total number of replicas of this instance that are expected to be launched.
100100
# This cannot be less than 1 and must be grater than any value of
101101
# 'step_replication_number' that will be used for the same step.
102102
total_number_of_replicas: int = 1
103-
# A set of dependent (prior step) instance directroies that are expected to be
103+
# A set of dependent (prior step) instance directories that are expected to be
104104
# hard-linked into the instance directory the launcher will create.
105105
# These are required so that the step can access the dependent step's files.
106106
# It is a set of instance UUIDs.
107107
step_dependent_instances: set[str] | None = None
108108
# A set of dependent project files that are expected to be hard-linked
109109
# into the instance directory the launcher will create.
110110
# These are required so that the step can access project files.
111-
# It is a set project-relative filenames (or directroies).
111+
# It is a set project-relative filenames (or directories).
112112
step_project_inputs: set[str] | None = None
113113
# A set of step instance files that are expected to be hard-linked
114114
# into the surrounding Project directory.
115-
# It is a set instance-relative filenames (or directroies).
115+
# It is a set instance-relative filenames (or directories).
116116
step_project_outputs: set[str] | None = None
117117
# The application ID (a custom resource name)
118118
# used to identify the 'type' of Instance to create.

workflow/workflow_engine.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from dataclasses import dataclass
7474
from typing import Any, Optional
7575

76-
import decoder.decoder as job_defintion_decoder
76+
import decoder.decoder as job_definition_decoder
7777
from decoder.decoder import TextEncoding
7878
from google.protobuf.message import Message
7979
from informaticsmatters.protobuf.datamanager.pod_message_pb2 import PodMessage
@@ -134,7 +134,7 @@ def __init__(
134134
instance_launcher: InstanceLauncher,
135135
instance_link_glob: str = ".instance-*",
136136
):
137-
"""Initialiser, given a Workflow API adapter, Instance laucnher,
137+
"""Initialiser, given a Workflow API adapter, Instance launcher,
138138
and a step (directory) link 'glob' (a convenient directory glob to
139139
locate the DM hard-link directories of prior instances inserted into a
140140
step's instance directory, typically '.instance-*')"""
@@ -326,8 +326,8 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
326326
self._set_step_error(step_name, r_wfid, r_wfsid, exit_code, "Job failed")
327327
return
328328

329-
# If we get here the prior step completed successfullyso we
330-
# mark the Step as DONE (successfully).
329+
# If we get here the prior step completed successfully
330+
# so we mark the Step as DONE (successfully).
331331
wfid = rwf_response["workflow"]["id"]
332332
assert wfid
333333
wf_response, _ = self._wapi_adapter.get_workflow(workflow_id=wfid)
@@ -358,9 +358,9 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
358358
# For this simple logic it is the next step.
359359
next_step = wf_response["steps"][step_index + 1]
360360

361-
# A mojor piece of work to accomplish is to get ourselves into a position
361+
# A major piece of work to accomplish is to get ourselves into a position
362362
# that allows us to check the step command can be executed.
363-
# We do this by compiling a map of variables we belive the step needs.
363+
# We do this by compiling a map of variables we believe the step needs.
364364

365365
# If the step about to be launched is based on a prior step
366366
# that generates multiple outputs (files) then we have to
@@ -459,7 +459,7 @@ def _prepare_step(
459459
# whose origin is of type 'files'.
460460

461461
our_job_definition: dict[str, Any] = self._get_step_job(step=step_definition)
462-
our_inputs: dict[str, Any] = job_defintion_decoder.get_inputs(
462+
our_inputs: dict[str, Any] = job_definition_decoder.get_inputs(
463463
our_job_definition
464464
)
465465
# get all our step connections that relate to prior steps.
@@ -470,10 +470,10 @@ def _prepare_step(
470470

471471
we_are_a_combiner: bool = False
472472

473-
# What step might we be comnining?
474-
# It'll remain None afdter the next block if we're not combining.
473+
# What step might we be combining?
474+
# It'll remain None after the next block if we're not combining.
475475
step_name_being_combined: str | None = None
476-
# If we are a combiner, what is the varaible (identifying a set of files)
476+
# If we are a combiner, what is the variable (identifying a set of files)
477477
# that is bing combined? There can only be one.
478478
combiner_input_variable: str | None = None
479479
for p_step_name, connections in plumbing_of_prior_steps.items():
@@ -502,7 +502,7 @@ def _prepare_step(
502502
assert num_step_recplicas_being_combined > 0
503503
assert "status" in response
504504

505-
# Assume all the dependent prior step instnaces are done
505+
# Assume all the dependent prior step instances are done
506506
# and undo our assumption if not...
507507
all_step_instances_done: bool = True
508508

@@ -539,7 +539,7 @@ def _prepare_step(
539539
error_msg=f"Prior instance of step '{step_name_being_combined}' has failed",
540540
)
541541

542-
# We're not a cmbiner or we are
542+
# We're not a combiner or we are
543543
# (and all the dependent instances have completed successfully).
544544
# We can now compile a set of variables for it.
545545

@@ -563,9 +563,9 @@ def _prepare_step(
563563
#
564564
# The decoder gives us a list of 'Connectors' that are a par of variable
565565
# names representing "in" (workflow) and "out" (step) variable names.
566-
# "in" variables are worklfow variables, and "out" variables
567-
# are expected Stewp (Job) variables. We use these connections to
568-
# take workflow variables and puth them in our variables map.
566+
# "in" variables are workflow variables, and "out" variables
567+
# are expected Step (Job) variables. We use these connections to
568+
# take workflow variables and put them in our variables map.
569569
for connector in get_step_workflow_variable_connections(
570570
step_definition=step_definition
571571
):
@@ -607,13 +607,13 @@ def _prepare_step(
607607

608608
# The step's prime variables are now set.
609609

610-
# Before we return these to the claler do we have enough
610+
# Before we return these to the caller do we have enough
611611
# to satisfy the step Job's command? It's a simple check -
612612
# we give the step's Job command and our prime variables
613-
# to the Job decoder - it wil tell us if an inportnat
613+
# to the Job decoder - it wil tell us if an important
614614
# variable is missing....
615615
job: dict[str, Any] = self._get_step_job(step=step_definition)
616-
message, success = job_defintion_decoder.decode(
616+
message, success = job_definition_decoder.decode(
617617
job["command"], prime_variables, "command", TextEncoding.JINJA2_3_0
618618
)
619619
if not success:
@@ -628,7 +628,7 @@ def _prepare_step(
628628
# We need to set the number of step replicas to run.
629629
#
630630
# If we're not a combiner and a variable in our "plumbing" refers to a variable
631-
# of type "files" in a prior step then we are expected to run multipe times
631+
# of type "files" in a prior step then we are expected to run multiple times
632632
# (even if just once). The number of times we're expected to run is dictated
633633
# by the number of values (files) in the "files" variable.
634634
#
@@ -650,7 +650,7 @@ def _prepare_step(
650650
wf_step: dict[str, Any] = get_step(wf, p_step_name)
651651
assert wf_step
652652
job_definition: dict[str, Any] = self._get_step_job(step=wf_step)
653-
jd_outputs: dict[str, Any] = job_defintion_decoder.get_outputs(
653+
jd_outputs: dict[str, Any] = job_definition_decoder.get_outputs(
654654
job_definition
655655
)
656656
for connector in connections:
@@ -712,7 +712,7 @@ def _launch(
712712
step_definition: dict[str, Any],
713713
step_preparation_response: StepPreparationResponse,
714714
) -> None:
715-
"""Given a runningWorkflow record, a step defitnion (from the Workflow),
715+
"""Given a runningWorkflow record, a step definition (from the Workflow),
716716
and the step's variables (in a preparation object) this method launches
717717
one or more instances of the given step."""
718718
step_name: str = step_definition["name"]

0 commit comments

Comments
 (0)