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

fix: load correct worksheet in aimmo-game #1476

Merged
merged 3 commits into from
Mar 5, 2021
Merged

Conversation

razvan-pro
Copy link
Collaborator

@razvan-pro razvan-pro commented Mar 4, 2021

Because of Agones changes, aimmo-game doesn't load the correct worksheet ID at the moment. This is fine for now as worksheets 1 and 2 have the same data, but it will be needed for the third one which will have different properties.

Note this won't work if the game worksheet is changed after the game is running - we will fix this at a later stage.


This change is Reviewable

@razvan-pro razvan-pro self-assigned this Mar 4, 2021
Copy link
Contributor

@dionizh dionizh left a comment

Choose a reason for hiding this comment

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

Did the pip files change just because of the python version update to 3.7 or is there something else?

Reviewed 1 of 9 files at r1.
Reviewable status: 1 of 9 files reviewed, 2 unresolved discussions (waiting on @razvan-pro)


aimmo-game/simulation/avatar/avatar_manager.py, line 13 at r1 (raw file):

WorksheetData = None

Might be opening a can of worms, but I like the convention of no space for default parameter. What do you think?


aimmo-game/simulation/worksheet/init.py, line 2 at r1 (raw file):

from .worksheet import WorksheetData
__all__ = ["WorksheetData"]

can we empty this file?

Copy link
Contributor

@dionizh dionizh left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 9 files at r1.
Reviewable status: 4 of 9 files reviewed, 2 unresolved discussions (waiting on @razvan-pro)

Copy link
Collaborator Author

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

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

The one in aimmo-game yes. For the other I ran pipenv lock to update it 🙂

Reviewable status: 4 of 9 files reviewed, 2 unresolved discussions (waiting on @dionizh and @razvan-pro)


aimmo-game/simulation/avatar/avatar_manager.py, line 13 at r1 (raw file):

Previously, dionizh (Dioni Zhong) wrote…
WorksheetData = None

Might be opening a can of worms, but I like the convention of no space for default parameter. What do you think?

Formatted with black which seems to like spaces 🙂 I'll go with black 🙂


aimmo-game/simulation/worksheet/init.py, line 2 at r1 (raw file):

Previously, dionizh (Dioni Zhong) wrote…
from .worksheet import WorksheetData
__all__ = ["WorksheetData"]

can we empty this file?

Technically yes, but then we'd have to import from simulation.worksheet.worksheet instead 🙂 Maybe I should add get_worksheet_data here as well? 🤔

Copy link
Contributor

@dionizh dionizh left a 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 9 files reviewed, 2 unresolved discussions (waiting on @dionizh and @razvan-pro)


aimmo-game/simulation/worksheet/init.py, line 2 at r1 (raw file):
For me I prefer __init__.py empty as much as possible, so it's one less file to check and modify 🙂. I saw that at the other places you import as:

from simulation.worksheet import WorksheetData
from simulation.worksheet.worksheet import get_worksheet_data

So maybe we can keep it consistent and simple, so both import from simulation.worksheet.worksheet then empty the __init__.py as you already changed the convention a bit 😁? But it's not a biggie if you just wanna leave it.

Copy link
Collaborator Author

@razvan-pro razvan-pro left a 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 10 files reviewed, 1 unresolved discussion (waiting on @dionizh and @razvan-pro)


aimmo-game/simulation/worksheet/init.py, line 2 at r1 (raw file):

Previously, dionizh (Dioni Zhong) wrote…

For me I prefer __init__.py empty as much as possible, so it's one less file to check and modify 🙂. I saw that at the other places you import as:

from simulation.worksheet import WorksheetData
from simulation.worksheet.worksheet import get_worksheet_data

So maybe we can keep it consistent and simple, so both import from simulation.worksheet.worksheet then empty the __init__.py as you already changed the convention a bit 😁? But it's not a biggie if you just wanna leave it.

Agreed 😁

Copy link
Contributor

@dionizh dionizh left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 6 of 6 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@codecov
Copy link

codecov bot commented Mar 5, 2021

Codecov Report

Merging #1476 (16d7193) into development (8e7711e) will decrease coverage by 0.05%.
The diff coverage is 73.68%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #1476      +/-   ##
===============================================
- Coverage        63.01%   62.95%   -0.06%     
===============================================
  Files              166      165       -1     
  Lines             3658     3663       +5     
  Branches           224      228       +4     
===============================================
+ Hits              2305     2306       +1     
  Misses            1327     1327              
- Partials            26       30       +4     
Impacted Files Coverage Δ
aimmo-game/simulation/worksheet/worksheet.py 76.19% <ø> (-1.09%) ⬇️
aimmo-game/simulation/game_state.py 72.22% <60.00%> (-2.78%) ⬇️
aimmo-game/simulation/avatar/avatar_manager.py 96.42% <75.00%> (-3.58%) ⬇️
aimmo-game/simulation/obstacle.py 93.75% <75.00%> (-6.25%) ⬇️
aimmo-game/simulation/simulation_runner.py 95.55% <83.33%> (-1.04%) ⬇️

@razvan-pro razvan-pro merged commit f9bcb61 into development Mar 5, 2021
@razvan-pro razvan-pro deleted the fix-game-worksheet branch March 5, 2021 13:49
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.

None yet

2 participants