Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional methods and fixes to DataFrameMixin (#43)
* adding __repr__ and __str__ to DiscreteDF * implement random_pos in DiscreteSpaceDF * Changing set_cells docstring * adding _df_columns to mixin * add _df_column_names * - move capacity to DiscreteSpaceDF - create set_cells at DiscreteSpaceDF level * adding _contains to mixin, changed _add_columns to _with_columns * - moved column names to SpaceDF - created concrete swap in SpaceDF - update due to changes in mixin * add _srs_range * add _df_join to mixin * adding "cross" option to _df_join * adding _df_filter_ to mixin * add _df_rename_columns to DataFrameMixin * adding get_neighborhood to GridDF * - remove _place_agents_df and move it to move_agents - add remaining capacity property - branching _update_capacity in cells and agents * fix move update capacity first * pandas implementation * move pandas, polars tests to their folders * adding GridPandas to __init__ * adding remaining capacity * reorder mixin * adding mixin_test for pandas * fixes to abstract DataFrameMixin syntax * updates to types * renamed files for pytest * adding typeguard to mixin * added series concatenation to DataFrameMixin * adding place_agents * renaming test_agentsets (for pytest compatibility) * added index as abstract property and changed inactive_agents mismatched return type * - changed index_col to index_cols across methods - added some useful method (add, all, div, drop_columns, drop_duplicates, group_by_cum_count, mul, norm, reset_index, set_index, srs_to_df) - minor fixes * - new methods in PandasMixin based on additions to DataFrameMixin - fixes to the logic of some methods * - Distinction between place and move: the first raises Warning if agents 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) * addition of the new methods to PolarsMixin according to the new abstract DataFrameMixin * - added index property to AgentsDF * - specified _copy_with_method attribute for fast copy through CopyMixin - added custom _empty_cell_condition - fixed the logic of some methods (_generate_empty_grid, _sample_cells, _update_capacity_agents, remaining_capacity) * added tests for GridPandas * test_mixin_pandas will be added with it's own PR * moved test_space_pandas to pandas test folder and changed named to test_grid_pandas * Revert space files to main/origin (will have their own PR)
- Loading branch information