Closed otizonaizit closed 3 months ago
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’.
Not sure it makes sense to have the deprecated decorator. New code will not use the old function. Old code is not going to be updated by anyone, so the deprecation won't motivate anyone to update the code. In my opinion we can leave the import there for an indefinite time.
Before merging I want to add some tests to be sure that if a bot changes the graph right now those changes are indeed lost. I am not sure given the way the caching is implemented. Sorry, I didn't think of it when I submitted the PR, otherwise I would have put the WIP label...
We can then use the frozen decorator then, which should pass the still-to-be-written tests, in case the current implementation is indeed broken.
On Wed 15 May, 07:08 +0000, Rike-Benjamin Schuppner @.***> wrote:
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’.
— Reply to this email directly, view it on GitHub¹, or unsubscribe². You are receiving this because you authored the thread.☘Message ID: @.***>
––––
¹ https://github.com/ASPP/pelita/pull/792#issuecomment-2112653689 ² https://github.com/notifications/unsubscribe-auth/AACUYC4UBHUZJYSAE2XWV2TZCNT6VAVCNFSM6AAAAABHX4IJ5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSGY2TGNRYHE
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.
The graph is now a read-only view and tests have been added. Ready to merge on my side.
Introduce a new cached attribute
graph
to theBot
object. This PR also moves thewalls_to_graph
function fromutils.py
toteam.py
, where it arguably now belongs. An aliaswalls_to_graph
is left inutils.py
for backward compatibility.Fixes: #789