-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add larger bit depth for displaying flag_masks (#492)
* Add flag_mask formatting support for bitdepth greater than uint8 Underlying cf flag_mask codes (eg. == and .isin) work with flag_masks with more than 8 independent flags (eg. uint32), however the formatting codes that print messages to the screen are limited to uint8. Add/modify functions to unpack bits from larger integer dtypes. * Edit fixed-width formatting for larger bit depth flag_masks Original formatting widths work well for 8-bit flag_masks, but need some modification for larger integer values. * Fix bit_length calculating multiple times bit_length is re-calculated a second time inside _unpacked_bits, which can lead to incorrect bit_length. Pass this value as an argument instead, since it was properly calculated earlier in the process. * Remove unsigned integer check Flags do not have to be unsigned. For example, "basin" test dataset will fail the unsigned integer test even though it contains valid int64 flags. * Add test for 16bit version of flag_masks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add flag_indep_uint16 example dataset * One more test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian <[email protected]>
- Loading branch information
1 parent
c2f2540
commit f6c8a1f
Showing
3 changed files
with
92 additions
and
9 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