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

add a new graph cached attribute to the Bot object #792

Merged
merged 4 commits into from
May 17, 2024

Conversation

otizonaizit
Copy link
Member

Introduce a new cached attribute graph to the Bot object.
This PR also moves the walls_to_graph function from utils.py to team.py, where it arguably now belongs. An alias walls_to_graph is left in utils.py for backward compatibility.

Fixes: #789

... it holds a networkx graph representation of the maze. The graph was before
 manually generated using the walls_to_graph function in utils.py
@Debilski
Copy link
Member

Should we have a deprecated decorator on utils.walls_to_graph? At some point we should surely decide on one import only.

Should we use the frozen graph then? It doesn’t help much but at least it signals ‘do not touch’.

@otizonaizit
Copy link
Member Author

otizonaizit commented May 15, 2024 via email

@Debilski
Copy link
Member

Debilski commented May 15, 2024

Ok but if we keep the import around then we should still flag it so that is is not removed by some import checker. Or remove it now and live with the consequences.

@otizonaizit
Copy link
Member Author

The graph is now a read-only view and tests have been added. Ready to merge on my side.

@Debilski Debilski merged commit 0c9a0f1 into ASPP:main May 17, 2024
24 of 25 checks passed
github-actions bot pushed a commit that referenced this pull request May 17, 2024
add a new `graph` cached attribute to the `Bot` object 0c9a0f1
@Debilski Debilski mentioned this pull request Jul 17, 2024
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.

Add new Bot.graph attribute
2 participants