Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
Fix typos in doc-strings and optimize regular expression use.
  • Loading branch information
natelust committed May 25, 2022
1 parent d7efc10 commit 475179c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/lsst/ctrl/mpexec/dotTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def expand_dimensions(dimensions):
pipeline = pipeline.toExpandedPipeline()

# The next two lines are a workaround until DM-29658 at which time metadata
# connections should star working with the above code
# connections should start working with the above code
labelToTaskName = {}
metadataNodesToLink = set()

Expand All @@ -250,6 +250,7 @@ def expand_dimensions(dimensions):

_renderTaskNode(taskNodeName, taskDef, file, None)

metadataRePattern = re.compile("^(.*)_metadata$")
for attr in sorted(iterConnections(taskDef.connections, "inputs"), key=lambda x: x.name):
if attr.name not in allDatasets:
dimensions = expand_dimensions(attr.dimensions)
Expand All @@ -266,8 +267,8 @@ def expand_dimensions(dimensions):
dimensions = expand_dimensions(attr.dimensions)
_renderDSTypeNode(nodeName, dimensions, file)
# The next if block is a workaround until DM-29658 at which time
# metadata connections should star working with the above code
if (match := re.match("^(.*)_metadata$", attr.name)) is not None:
# metadata connections should start working with the above code
if (match := metadataRePattern.match(attr.name)) is not None:
matchTaskLabel = match.group(1)
metadataNodesToLink.add((matchTaskLabel, attr.name))

Expand All @@ -287,7 +288,7 @@ def expand_dimensions(dimensions):
_renderEdge(taskNodeName, attr.name, file)

# This for loop is a workaround until DM-29658 at which time metadata
# connections should star working with the above code
# connections should start working with the above code
for matchLabel, dsTypeName in metadataNodesToLink:
# only render an edge to metadata if the label is part of the current
# graph
Expand Down

0 comments on commit 475179c

Please sign in to comment.