Skip to content

Commit

Permalink
Ensure that Cases do not consider themselves to be their own dependen…
Browse files Browse the repository at this point in the history
…cy (#19)

Ensure that Cases do not consider themselves to be their own dependency

This makes sure that self is not contained in a Case's set of
dependencies. This can happen when a plugin is inferring a Case
dependency based on a referenced input file name. If that name maps back
to the current case, it would errantly flag the current Case as its own
dependency.
  • Loading branch information
youngmit authored and ntouran committed Jan 13, 2020
1 parent 0eb612c commit fd82067
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions armi/cases/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def dependencies(self):
r"^(?P<dirName>.*[\/\\])?(?P<title>[^\/\\]+)-SHUFFLES\.txt$",
)
)
# ensure that a case doesn't appear to be its own dependency
dependencies.discard(self)

return dependencies

Expand Down Expand Up @@ -282,6 +284,12 @@ def setUpTaskDependence(self):
Set the task dependence based on the :code:`dependencies`.
This accounts for whether or not the dependency is enabled.
Note
----
This is a leftover from before the release of the ARMI framework. The API of the
proprietary cluster communication library is being used here. This should either
be moved out into the cluster plugin, or the library should be made available.
"""
if not self.enabled:
return
Expand Down

0 comments on commit fd82067

Please sign in to comment.