Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-26371 Update code to support new QuantumGraph type #71

Merged
merged 1 commit into from Sep 28, 2020

Conversation

natelust
Copy link
Contributor

No description provided.

Copy link
Collaborator

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK on general, some renaming is probably needed in mpGraphExecutor and I would like to keep reverse option in FixupDataId if possible.

"""

def __init__(self, taskLabel: str, dimensions: Union[str, Sequence[str]], reverse: bool = False):
self.taskLabel = taskLabel
self.dimensions = dimensions
self.reverse = reverse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did not remove it from parameter list? Why reverse is not supported, is it impossible in a new world?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back in

for qdata in keyQuanta[key]:
qdata.dependencies |= prev_indices
return quanta
quanta = list(graph.quantaForTask(taskDef))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What order do they come out? Previous version ordered them by dataId, can't we do the same here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back in

@@ -54,14 +56,16 @@ class _Job:

Parameters
----------
qdata : `~lsst.pipe.base.QuantumIterData`
qdata : `~lsst.pipe.base.QuantumNode`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename qdata to qnode.

@@ -54,14 +56,16 @@ class _Job:

Parameters
----------
qdata : `~lsst.pipe.base.QuantumIterData`
qdata : `~lsst.pipe.base.QuantumNode`
Quantum and some associated information.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAn you add docstring for two new arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were not needed any more and were removed instead

@@ -164,7 +168,7 @@ def finishedIds(self):
jobsIds : `set` [`int`]
Set of integer job IDs.
"""
return set(job.qdata.index for job in self.jobs if job.state == JobState.FINISHED)
return set(job.qdata for job in self.jobs if job.state == JobState.FINISHED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be job.index instead? Same for two other changes below. If it needs to return nodes instead of index then it's better to rename methods and update docstrings.

quantaIter : iterable of `~lsst.pipe.base.QuantumIterData`
Possibly updated set of quanta, properly ordered for execution.
graph : `QuantumGraph`
Modified `QuantumGraph`, properly ordered for execution.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think new QuantumGRaph cannot be non-ordered, may be drop this "properly ordered..."

@@ -181,22 +218,18 @@ def test_mpexec_fixup(self):

taskDef = TaskDefMock()

for reverse in (False, True):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we could keep reverse.

Copy link
Collaborator

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.


Returns
-------
update : `~lsst.daf.butler.Quantum`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call it quantum instead of update? Or updatedQuantum?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants