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

2261 get progenitor #2333

Merged
merged 2 commits into from
Sep 22, 2022
Merged

Conversation

ilija-lazoroski
Copy link
Contributor

What does this PR do?

Fixes part of #2261 .

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Have you successfully tested your changes locally? Elaborate:

    Tested by unit tests

  • If applicable, add screenshots or log transcripts of the feature working

@@ -40,6 +40,16 @@ def get_running_agents(self) -> Sequence[Agent]:
:raises RetrievalError: If an error occurred while attempting to retrieve the `Agents`
"""

@abstractmethod
def get_progenitor(self, descendant: Agent) -> Agent:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably just name the parameter 'agent'. Descendant means that it's not the progenitor, but in fact this method might get called where descendant IS the progenitor. It's pretty clear from the signature get_progenitor(self, agent) that you're getting a progenitor of an agent. IF not, then let's change the name to get_agent_progenitor

Copy link
Contributor

@VakarisZ VakarisZ left a comment

Choose a reason for hiding this comment

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

Mainly I don't see why we can't search progenitor of an agent which is already a progenitor

@mssalvatore mssalvatore merged commit 9ebf088 into 2261-refactor-manual-agent-logic Sep 22, 2022
@mssalvatore mssalvatore deleted the 2261-get-progenitor branch September 22, 2022 14:03
@@ -244,6 +244,8 @@
IAgentRepository.upsert_agent
IAgentRepository.get_agent_by_id
IAgentRepository.get_running_agents
IAgentRepository.get_progenitor
descendant
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this from?

Comment on lines +45 to +52
"""
Gets the progenitor `Agent` for the agent.

:param agent: The Agent for which we want the progenitor
:return: `Agent` progenitor ( an initial agent that started the exploitation chain)
:raises RetrievalError: If an error occured while attempting to retrieve the `Agent`
:raises UnknownRecordError: If the agent ID is not in the repository
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""
Gets the progenitor `Agent` for the agent.
:param agent: The Agent for which we want the progenitor
:return: `Agent` progenitor ( an initial agent that started the exploitation chain)
:raises RetrievalError: If an error occured while attempting to retrieve the `Agent`
:raises UnknownRecordError: If the agent ID is not in the repository
"""
"""
Gets the progenitor agent (initial agent that started the exploitation chain) for a particular agent
:param agent: The agent whose progenitor should be retrieved
:return: The progenitor agent
:raises RetrievalError: If an error occurs while attempting to retrieve an agent
:raises UnknownRecordError: If the agent ID is not in the repository
"""

mssalvatore added a commit that referenced this pull request Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants