Skip to content

Allow for non-consecutive forager indices #163

@dimkab

Description

@dimkab

On forager object creation through the call to dataObject.__init__(), the foragersDF.forager.unique() array is implicitly assumed to be equal to range(len(foragersDF.forager.unique()). This behaviour is

  1. not documented
  2. undesirable in many practical situations when foragersDF is by itself a slice of a larger dataframe, in which case only a handful of foragers are present.
  3. Is not explicitly checked at object creation, which causes great many issues afterwards.

The ideal solution should be to allow arbitrary non-consecutive indices at object creation and either reindex them right away, or keep track of internal indices vs. actual labels. In any case, any such assumption should be documented and asserted in code, together with a test case.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions