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

fix unwanted rerun of friend dependencies when running ProduceMultiFriends #49

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading