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

change Codebook data default dtype to float #1975

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions starfish/core/codebook/codebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def zeros(cls, code_names: Sequence[str], n_round: int, n_channel: int):
codebook whose values are all zero

"""
data = np.zeros((len(code_names), n_round, n_channel), dtype=np.uint8)
data = np.zeros((len(code_names), n_round, n_channel), dtype=float)
return cls.from_numpy(code_names, n_round, n_channel, data)

@classmethod
Expand Down Expand Up @@ -295,7 +295,7 @@ def from_code_array(
target_names = [w[Features.TARGET] for w in code_array]

# fill the codebook
data = np.zeros((len(target_names), n_round, n_channel), dtype=np.uint8)
data = np.zeros((len(target_names), n_round, n_channel), dtype=float)
for i, code_dict in enumerate(code_array):
for bit in code_dict[Features.CODEWORD]:
ch = int(bit[Axes.CH])
Expand Down
2 changes: 1 addition & 1 deletion starfish/core/codebook/test/test_from_code_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_create_codebook():
targets = [x[Features.TARGET] for x in code_array]

# Loop performed by from_code_array
data = np.zeros((2, 2, 3), dtype=np.uint8)
data = np.zeros((2, 2, 3), dtype=float)
for i, code_dict in enumerate(code_array):
for bit in code_dict[Features.CODEWORD]:
ch = int(bit[Axes.CH])
Expand Down