-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple codewords for the same target (#1646)
`to_json` walks through each of the targets/r/c in a codebook when trying to save. Unfortunately, selecting an array with the same target twice results in a 3D array (target/r/c) rather than a 2D array (r/c). This PR rewrites to_json so it can handle multiple codewords that decode to the same target. Rather than selecting by label, we walk through each of the targets by integer offset. This also optimizes the walkthrough of the codebook object by finding all the non-zero points in numpy code rather than in python code. With the seqFISH dataset, this is at least a 10x speedup in writing out the json file. With denser codebooks, the speedup probably is inconsequential. Test plan: wrote a test that has multiple codewords for the same target. it crashes without the fix and succeehds with the fix. Fixes: #1643
- Loading branch information
Tony Tung
authored
Nov 13, 2019
1 parent
01593a7
commit 7892e0a
Showing
2 changed files
with
47 additions
and
11 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