Skip to content

Commit

Permalink
fix the unwanted rerun of friend dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nshadskiy authored and harrypuuter committed Aug 19, 2024
1 parent aaf7418 commit fd5fda7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion processor/tasks/CROWNMultiFriends.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def create_branch_map(self):
if inputfile.path.endswith(".root")
]
friend_inputs = [
self.input()[f"CROWNFriends_{self.nick}_{friend}"]["collection"]
self.input()[f"CROWNFriends_{self.nick}_{self.friend_mapping[friend]}"][
"collection"
]
for friend in self.friend_dependencies # type: ignore
]
friend_branches = [
Expand Down
10 changes: 7 additions & 3 deletions processor/tasks/FriendQuantitiesMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def requires(self):
scopes=self.scopes,
)
for friend in self.friend_dependencies:
requirements[f"CROWNFriends_{friend}"] = CROWNFriends(
requirements[
f"CROWNFriends_{self.nick}_{self.friend_mapping[friend]}"
] = CROWNFriends(
nick=self.nick,
analysis=self.analysis,
config=self.config,
Expand All @@ -75,7 +77,7 @@ def requires(self):
era=self.era,
sample_type=self.sample_type,
scopes=self.scopes,
friend_name=friend,
friend_name=self.friend_mapping[friend],
friend_config=friend,
)
return requirements
Expand Down Expand Up @@ -117,7 +119,9 @@ def run(self):
# add all friend files to the inputfiles list
for friend in self.friend_dependencies:
inputfiles.extend(
self.input()[f"CROWNFriends_{friend}"][sample]._flat_target_list
self.input()[
f"CROWNFriends_{self.nick}_{self.friend_mapping[friend]}"
][sample]._flat_target_list
)
for inputfile in inputfiles:
if inputfile.path.endswith("quantities_map.json"):
Expand Down
2 changes: 1 addition & 1 deletion processor/tasks/ProduceFriends.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def requires(self):
console.log(f"Config: {self.config}")
console.log(f"Shifts: {self.shifts}")
console.log(f"Scopes: {self.scopes}")
console.log(f"Slient: {self.silent}")
console.log(f"Silent: {self.silent}")
console.rule("")

data = self.set_sample_data(self.parse_samplelist(self.sample_list))
Expand Down

0 comments on commit fd5fda7

Please sign in to comment.