-
Notifications
You must be signed in to change notification settings - Fork 6
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
Concrete GridPandas #44
Conversation
- create set_cells at DiscreteSpaceDF level
- created concrete swap in SpaceDF - update due to changes in mixin
- add remaining capacity property - branching _update_capacity in cells and agents
…nts are already present, the second if agents aren't already present - Fixes to the logic of some methods of SpaceDF (random_agents, swap_agents), DiscreteSpaceDF (__repr__, __str__) GridDF (__init__, get_directions, get_distances, get_neighbors, get_neighborhood, get_cells, out_of_bounds, remove_agents, torus_adj, _compute_offsets, _get_df_coords)
…act DataFrameMixin
- added custom _empty_cell_condition - fixed the logic of some methods (_generate_empty_grid, _sample_cells, _update_capacity_agents, remaining_capacity)
… 34-concrete-gridpandas
… 34-concrete-gridpandas
… 34-concrete-gridpandas
Sorry for the delay in reviewing. Hope it's not blocking the other issues. |
It looks like there is a test flake on the latest main CI. |
Do not worry, I was working on PolarsMixin and GridPolars.
You're right, failure on ubuntu is related to the sampling operation. Should be an easy fix. |
This PR adds the GridPandas class, a concrete Pandas-based implementation of GridDF, with unit-tests for all public methods and properties. The remaining capacity of cells is stored in a np.array where only vectorized operations are applied.
Key changes in this PR:
SpaceDF
DiscreteSpaceDF
GridDF
Requires merging #43.