Repository navigation
[uss_qualifier/reports] Specify participants associated with resources #1820
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
Merged
BenjaminPelletier
merged 1 commit into
interuss:main
from
BenjaminPelletier:resource-participants
Oct 22, 2026
+151
−26
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,25 @@ | ||
| from abc import ABC, abstractmethod | ||
|
|
||
| from monitoring.uss_qualifier.resources.resource import Resource | ||
|
|
||
|
|
||
| class PluralResource[TSingularResource: Resource](Resource, ABC): | ||
| """Resource that provides multiple instances of a singular resources.""" | ||
|
|
||
| @abstractmethod | ||
| def get_resource_instances_count(self) -> int: | ||
| """Get the number of singular resources this plural resource contains.""" | ||
| raise NotImplementedError() | ||
|
|
||
| @abstractmethod | ||
| def get_resource_instance(self, index: int) -> TSingularResource: | ||
| """Get the specific singular resource at the specified index contained by this plural resource.""" | ||
| raise NotImplementedError() | ||
| from abc import ABC, abstractmethod | ||
|
|
||
| from monitoring.uss_qualifier.configurations.configuration import ParticipantID | ||
| from monitoring.uss_qualifier.resources.resource import Resource | ||
|
|
||
|
|
||
| class PluralResource[TSingularResource: Resource](Resource, ABC): | ||
| """Resource that provides multiple instances of a singular resources.""" | ||
|
|
||
| def get_associated_participants(self) -> list[ParticipantID]: | ||
| participants = [] | ||
| for i in range(self.get_resource_instances_count()): | ||
| resource = self.get_resource_instance(i) | ||
| participants.extend(resource.get_associated_participants()) | ||
| return list(dict.fromkeys(participants)) | ||
|
|
||
| @abstractmethod | ||
| def get_resource_instances_count(self) -> int: | ||
| """Get the number of singular resources this plural resource contains.""" | ||
| raise NotImplementedError() | ||
|
|
||
| @abstractmethod | ||
| def get_resource_instance(self, index: int) -> TSingularResource: | ||
| """Get the specific singular resource at the specified index contained by this plural resource.""" | ||
| raise NotImplementedError() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit/Semantic: Since it's a directory of participants, is it really a resource for a participant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's certainly worth considering the clarity of definitions. My intent is to enable report readers to see "whose resource it is" when seeing which resources were used for a scenario. For single-participant resources, this is fairly obvious ("flight_planner for uss1"). For plural resources, this is also fairly obvious ("dss_instances for uss1, uss2, uss3"). It's less obvious for resources like this, but I think the most useful representation still involves the participants. For this resource specifically, it's a resource that is capable of resolving particular pieces of information (e.g., URLs) to participant owners. It seems useful to know which participants the resource is capable of resolving, and this is effectively who the resource is for: this resource is for the participants for which it is capable of resolving responsibility.