-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: add NearbyArtefactsList #1581
Conversation
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.
Reviewed 4 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @razvan-pro)
aimmo-game-worker/simulation/errors.py, line 7 at r2 (raw file):
class NoNearbyArtefactsError(Error):
What's the reason for making NoNearbyArtefactsError
extend Error
instead of Exception
directly?
aimmo-game-worker/simulation/utils.py, line 20 at r2 (raw file):
if len(self) == 0: raise NoNearbyArtefactsError( "There aren't any nearby objects, you need to move closer!"
objects or artefacts?
aimmo-game-worker/simulation/world_map.py, line 8 at r2 (raw file):
from typing import Dict, List from .pathfinding import astar from .utils import NearbyArtefactsList
Organise imports? 😁 🙏
game_frontend/src/pyodide/webWorker.ts, line 79 at r2 (raw file):
const matches = log.match(regexToFindNextTurnErrors) if (matches?.length >= 2) { const simpleError = matches[2].split('\n').slice(-2).join('')
I can't fully tell what this does, does it format the error message to be more readable?
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.
Reviewable status: 3 of 5 files reviewed, 4 unresolved discussions (waiting on @faucomte97)
aimmo-game-worker/simulation/errors.py, line 7 at r2 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
What's the reason for making
NoNearbyArtefactsError
extendError
instead ofException
directly?
It's a common pattern as far as I know. I'd say for better structure and for typing as well, for example if this package is used by others, you can catch all errors thrown by it by catching its base error class.
aimmo-game-worker/simulation/utils.py, line 20 at r2 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
objects or artefacts?
"artefacts" sounds better 🙂 👍
aimmo-game-worker/simulation/world_map.py, line 8 at r2 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Organise imports? 😁 🙏
😅 😁
game_frontend/src/pyodide/webWorker.ts, line 79 at r2 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
I can't fully tell what this does, does it format the error message to be more readable?
I was a bit uncertain about this change. It actually removes the traceback and prints just the exception line. It looks like it was doing the same thing before as well - from some of my tests, it didn't change any previous functionality (also the tests that we have are passing). However, there was some traceback from the custom exception that I added, it was showing that it occurred in aimmo-game-worker/simulation/utils.py
and it seemed confusing. This split/slice fixes that.
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.
Reviewable status: 3 of 5 files reviewed, 4 unresolved discussions (waiting on @faucomte97)
game_frontend/src/pyodide/webWorker.ts, line 79 at r2 (raw file):
Previously, razvan-pro (Razvan Mahu) wrote…
I was a bit uncertain about this change. It actually removes the traceback and prints just the exception line. It looks like it was doing the same thing before as well - from some of my tests, it didn't change any previous functionality (also the tests that we have are passing). However, there was some traceback from the custom exception that I added, it was showing that it occurred in
aimmo-game-worker/simulation/utils.py
and it seemed confusing. This split/slice fixes that.
Can we put some comments for this please?
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.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dionizh and @razvan-pro)
game_frontend/src/pyodide/webWorker.ts, line 79 at r2 (raw file):
Previously, dionizh (Dioni Zhong) wrote…
Can we put some comments for this please?
Yes comments :)
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.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @faucomte97)
game_frontend/src/pyodide/webWorker.ts, line 79 at r2 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Yes comments :)
yep 👍
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.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @razvan-pro)
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.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @razvan-pro)
Codecov Report
@@ Coverage Diff @@
## development #1581 +/- ##
===============================================
+ Coverage 67.55% 67.70% +0.15%
===============================================
Files 161 163 +2
Lines 3316 3332 +16
Branches 234 235 +1
===============================================
+ Hits 2240 2256 +16
Misses 1048 1048
Partials 28 28
|
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)