-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return occupied booleans in retrieve (#414)
## Description <!-- Provide a brief description of the PR's purpose here. --> Previously, we relied on sentinel values to indicate whether a given cell was occupied. Since it is entirely possible that users want to use these sentinel values in their fields, we now return a separate `occupied` array that indicates which cells are occupied. Considerations: - Chose not to support additional return types like tuple and pandas for now, as such flexibility is less essential in `retrieve`, and this feature can be added fairly easily later on - We still set the sentinel values depending on the field type since it may be confusing to see arbitrary values for a given field without seeing the occupied array. - the `threshold` field is now included in outputs from `retrieve()` ## TODO <!-- Notable points that this PR has either accomplished or will accomplish. --> - [x] Implement new retrieve and retrieve_single methods - [x] Fix tests - [x] Fix usage in tutorials ## Questions <!-- Any concerns or points of confusion? --> ## Status - [x] I have read the guidelines in [CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md) - [x] I have formatted my code using `yapf` - [x] I have tested my code by running `pytest` - [x] I have linted my code with `pylint` - [x] I have added a one-line description of my change to the changelog in `HISTORY.md` - [x] This PR is ready to go
- Loading branch information
Showing
5 changed files
with
63 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters