-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update binning size values to string format (#399)
- Loading branch information
Showing
3 changed files
with
30 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,7 @@ | |
} | ||
}, | ||
"binning": { | ||
"size": 1 | ||
"size": "1x1" | ||
}, | ||
"logging": { | ||
"default": { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
|
||
BINNING_SIZE_MAP = { | ||
'1x1': 1, | ||
'2x2': 2, | ||
'4x4': 4, | ||
} | ||
|
||
|
||
def binning_size_str_to_int(text: str) -> int: | ||
return BINNING_SIZE_MAP.get(text, 1) | ||
|
||
|
||
def binning_size_int_to_str(val: int): | ||
for k, v in BINNING_SIZE_MAP.items(): | ||
if v == val: | ||
return k | ||
|
||
return '1x1' |