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

Photonlibpy - Best Target Function #1223

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions photon-lib/py/photonlibpy/photonPipelineResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,10 @@ def getTimestamp(self) -> float:
def getTargets(self) -> list[PhotonTrackedTarget]:
return self.targets

def getBestTarget(self) -> PhotonTrackedTarget:
Copy link
Contributor

Choose a reason for hiding this comment

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

I might just add a doc string explaining how "best" is calculated, and then we should be good to ship it

if not self.hasTargets():
return None
return self.getTargets()[0]

def hasTargets(self) -> bool:
return len(self.targets) > 0
Loading