Skip to content

Commit

Permalink
lint, comments, removing dead code, fixing typos
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588369744
Change-Id: Ib68335add19e58b394da4d4d3825412df506e3f6
  • Loading branch information
vezhnick authored and copybara-github committed Dec 6, 2023
1 parent 3db52d7 commit 7a1603a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions concordia/associative_memory/associative_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_data_frame(self):
return self._memory_bank.copy()

def _get_top_k_cosine(self, x: np.ndarray, k: int):
"""Returns the top k rows of a dataframe that have the highest cosine similarity to an input vector x.
"""Returns the top k most cosine similar rows to an input vector x.
Args:
x: The input vector.
Expand All @@ -139,7 +139,7 @@ def _get_top_k_cosine(self, x: np.ndarray, k: int):
def _get_top_k_similar_rows(
self, x, k: int, use_recency: bool = True, use_importance: bool = True
):
"""Returns the top k rows of a dataframe that have the highest cosine similarity to an input vector x.
"""Returns the top k most similar rows to an input vector x.
Args:
x: The input vector.
Expand Down
2 changes: 1 addition & 1 deletion concordia/components/agent/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _log(self, entry: str):
def observe(self, observation: str):
self._last_observation.append(observation)

def update(self, push_to_mem=True):
def update(self):
observation = '\n'.join(self._last_observation)
self._last_observation = []
memories = self._memory.retrieve_associative(
Expand Down
4 changes: 2 additions & 2 deletions concordia/components/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def observe(self, observation: str):
for comp in self._components:
comp.observe(observation)

def update_before_event(self, event_statement: str) -> None:
def update_before_event(self, cause_statement: str) -> None:
for comp in self._components:
comp.update_before_event(event_statement)
comp.update_before_event(cause_statement)

def update_after_event(self, event_statement: str) -> None:
for comp in self._components:
Expand Down
1 change: 0 additions & 1 deletion examples/phone/components/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""A GameMaster that simulates a player's interaction with their phone."""

import textwrap

from concordia.agents import basic_agent
from concordia.associative_memory import blank_memories
from concordia.clocks import game_clock
Expand Down
1 change: 0 additions & 1 deletion examples/phone/components/triggering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"""A component that runs the phone scene when a phone action is detected."""

from collections.abc import Sequence

from concordia.agents import basic_agent
from concordia.associative_memory import associative_memory
from concordia.associative_memory import blank_memories
Expand Down
2 changes: 1 addition & 1 deletion examples/village/components/elections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


"""Construct and an externality that implements elections within a game master."""
"""Component that implements elections within a game master."""

from collections.abc import Callable, Sequence
import datetime
Expand Down

0 comments on commit 7a1603a

Please sign in to comment.