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

targets/synthesis .pop() error #59

Open
cvanoli opened this issue May 30, 2018 · 0 comments
Open

targets/synthesis .pop() error #59

cvanoli opened this issue May 30, 2018 · 0 comments

Comments

@cvanoli
Copy link
Collaborator

cvanoli commented May 30, 2018

In targets/synthesis, when a count column is passed, the adding or removing rows is done in two functions: _add_rows_by_count or _remove_rows_by_count.

Inside these functions, there is a case that is not contemplated. From the df, after applying the corresponding filters, only the rows that have a value in the count column less or equal than the amount (to add or remove) are saved into the sort_count array which is then used to pick to_add or to_remove indexes. BUT, the unforeseen case is when the sort_count array is empty, meaning that all of the available rows in the filtered df have count values bigger than the amount value.
In the case of adding rows, an error is raised in line 213
https://github.com/UDST/spandex/blob/master/spandex/targets/synthesis.py#L213
when trying to pop out an index from to_add when this is empty.

In the case of removing, an error will not raise, but the process will iterate over the empty sort_count and the function will end up returning the same df.

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

1 participant