Skip to content

Commit

Permalink
mitosheet: fix bug with mitosheet not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondr77 committed Feb 5, 2025
1 parent d1ecfce commit bcb2b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mitosheet/mitosheet/mito_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def get_mito_frontend_code(kernel_id: str, comm_target_id: str, div_id: str, mit
# NOTE: we encode these as utf8 encoded byte arrays, so that we can avoid having to do complicated things with
# replacing \t, etc, which is required because JSON.parse limits what characters are valid in strings (bah humbug)
def to_uint8_arr(string: str) -> List[int]:
return list(np.frombuffer(string.encode("utf8"), dtype=np.uint8))
return np.frombuffer(string.encode("utf8"), dtype=np.uint8).tolist() # type: ignore

js_code = js_code.replace('["REPLACE_THIS_WITH_SHEET_DATA_BYTES"]', f'{to_uint8_arr(mito_backend.steps_manager.sheet_data_json)}')
js_code = js_code.replace('["REPLACE_THIS_WITH_ANALYSIS_DATA_BYTES"]', f'{to_uint8_arr(mito_backend.steps_manager.analysis_data_json)}')
Expand Down

0 comments on commit bcb2b82

Please sign in to comment.