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

Clean up HexSingleGrid(HexGrid) andHexGrid #1847

Open
jackiekazil opened this issue Oct 25, 2023 Discussed in #1827 · 5 comments
Open

Clean up HexSingleGrid(HexGrid) andHexGrid #1847

jackiekazil opened this issue Oct 25, 2023 Discussed in #1827 · 5 comments
Milestone

Comments

@jackiekazil
Copy link
Member

Discussed in #1827

Originally posted by jackiekazil October 2, 2023
Why is the HexSingleGrid subclassed from HexGrid and HexGrid has nothing in it?
I was reading through the code and confused by this -- because it is also visible in the docs. Wondering if there was logical reason or if someone remembered why? I was thinking we should get rid of HexGrid or make it private.

See the following two lines -

class HexSingleGrid(_HexGrid, SingleGrid):

class HexGrid(HexSingleGrid):

@jackiekazil jackiekazil added this to the [FUTURE] v3.0.0 milestone Oct 25, 2023
@EwoutH
Copy link
Contributor

EwoutH commented Oct 26, 2023

Looks like it was changed in #1575 and #1581 by @Tortar early this year. Maybe he can give some more details on the motivation and implementation nuts and bolts.

@Tortar
Copy link
Contributor

Tortar commented Oct 28, 2023

Hi, the motivation to make Grid private was mainly due to the fact that only SingleGrid and MultiGrid should be used. For the same reasoning the HexGrid should have been splitted in two versions. To keep retrocompatibility though a simple subclassing trick was used so that to make HexGrid still usable. But when 2.0 was released, the HexGrid class could have been dropped

@Tortar
Copy link
Contributor

Tortar commented Oct 28, 2023

Ah also, class HexSingleGrid(_HexGrid, SingleGrid): shouldn't be removed, make it possible to use an HexGrid + max 1 agent per position

@jackiekazil
Copy link
Member Author

I am revisiting to try to wrap this up.
Great... so remove HexGrid class, which has the deprecation warning with a 3.0 release, since 2.0 has passed.

@EwoutH
Copy link
Contributor

EwoutH commented Jan 29, 2024

We should check this aligns / not disrupts with the efforts in

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

No branches or pull requests

3 participants