Skip to content

Fix 'buffer source array is read-only' error#256

Merged
jni merged 1 commit intomainfrom
map-array-workaround
Feb 6, 2026
Merged

Fix 'buffer source array is read-only' error#256
jni merged 1 commit intomainfrom
map-array-workaround

Conversation

@jni
Copy link
Copy Markdown
Owner

@jni jni commented Feb 6, 2026

Workaround for scikit-image/scikit-image#6378
Can be removed after scikit-image/scikit-image#7535
is released.

@jni jni merged commit 4eacfa6 into main Feb 6, 2026
7 checks passed
@jni jni deleted the map-array-workaround branch February 6, 2026 04:59
@jni
Copy link
Copy Markdown
Owner Author

jni commented Feb 6, 2026

For posterity, this was the failure log:

2026-02-05T13:52:48.1644315Z =================================== FAILURES ===================================
2026-02-05T13:52:48.1644859Z __________________________ test_fast_graph_center_idx __________________________
2026-02-05T13:52:48.1645130Z 
2026-02-05T13:52:48.1645236Z     def test_fast_graph_center_idx():
2026-02-05T13:52:48.1645510Z         s = csr.Skeleton(skeleton0)
2026-02-05T13:52:48.1645770Z >       i = csr._fast_graph_center_idx(s)
2026-02-05T13:52:48.1646037Z             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-05T13:52:48.1646203Z 
2026-02-05T13:52:48.1646484Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/test/test_csr.py:268: 
2026-02-05T13:52:48.1646996Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2026-02-05T13:52:48.1647543Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/csr.py:1267: in _fast_graph_center_idx
2026-02-05T13:52:48.1648106Z     simp_csgraph, reduced_nodes = _simplify_graph(skel)
2026-02-05T13:52:48.1648421Z                                   ^^^^^^^^^^^^^^^^^^^^^
2026-02-05T13:52:48.1648881Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/csr.py:1242: in _simplify_graph
2026-02-05T13:52:48.1649369Z     src_relab, dst_relab = fw_map[src], fw_map[dst]
2026-02-05T13:52:48.1649646Z                            ^^^^^^^^^^^
2026-02-05T13:52:48.1650116Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skimage/util/_map_array.py:184: in __getitem__
2026-02-05T13:52:48.1650595Z     out = map_array(
2026-02-05T13:52:48.1651001Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skimage/util/_map_array.py:72: in map_array
2026-02-05T13:52:48.1651522Z     _map_array(input_arr, out_view, input_vals, output_vals)
2026-02-05T13:52:48.1652810Z skimage/util/_remap.pyx:10: in skimage.util._remap._map_array
2026-02-05T13:52:48.1653117Z     ???
2026-02-05T13:52:48.1653359Z <stringsource>:664: in View.MemoryView.memoryview_cwrapper
2026-02-05T13:52:48.1653652Z     ???
2026-02-05T13:52:48.1654044Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2026-02-05T13:52:48.1654263Z 
2026-02-05T13:52:48.1654334Z >   ???
2026-02-05T13:52:48.1654542Z E   ValueError: buffer source array is read-only
2026-02-05T13:52:48.1654729Z 
2026-02-05T13:52:48.1654817Z <stringsource>:352: ValueError
2026-02-05T13:52:48.1655109Z __________________________________ test_sholl __________________________________
2026-02-05T13:52:48.1655339Z 
2026-02-05T13:52:48.1655421Z     def test_sholl():
2026-02-05T13:52:48.1655628Z         s = csr.Skeleton(skeleton0)
2026-02-05T13:52:48.1655948Z >       c, r, counts = csr.sholl_analysis(s, shells=np.arange(0, 5, 1.5))
2026-02-05T13:52:48.1656283Z                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-05T13:52:48.1656485Z 
2026-02-05T13:52:48.1656739Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/test/test_csr.py:278: 
2026-02-05T13:52:48.1657200Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2026-02-05T13:52:48.1657687Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/csr.py:1352: in sholl_analysis
2026-02-05T13:52:48.1658165Z     center_idx = _fast_graph_center_idx(skeleton)
2026-02-05T13:52:48.1658436Z                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-05T13:52:48.1658884Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/csr.py:1267: in _fast_graph_center_idx
2026-02-05T13:52:48.1659381Z     simp_csgraph, reduced_nodes = _simplify_graph(skel)
2026-02-05T13:52:48.1659679Z                                   ^^^^^^^^^^^^^^^^^^^^^
2026-02-05T13:52:48.1660115Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skan/csr.py:1242: in _simplify_graph
2026-02-05T13:52:48.1660585Z     src_relab, dst_relab = fw_map[src], fw_map[dst]
2026-02-05T13:52:48.1660859Z                            ^^^^^^^^^^^
2026-02-05T13:52:48.1661320Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skimage/util/_map_array.py:184: in __getitem__
2026-02-05T13:52:48.1661788Z     out = map_array(
2026-02-05T13:52:48.1662352Z /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/skimage/util/_map_array.py:72: in map_array
2026-02-05T13:52:48.1662865Z     _map_array(input_arr, out_view, input_vals, output_vals)
2026-02-05T13:52:48.1663233Z skimage/util/_remap.pyx:10: in skimage.util._remap._map_array
2026-02-05T13:52:48.1663528Z     ???
2026-02-05T13:52:48.1663767Z <stringsource>:664: in View.MemoryView.memoryview_cwrapper
2026-02-05T13:52:48.1664052Z     ???
2026-02-05T13:52:48.1664267Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2026-02-05T13:52:48.1664476Z 
2026-02-05T13:52:48.1664543Z >   ???
2026-02-05T13:52:48.1664756Z E   ValueError: buffer source array is read-only
2026-02-05T13:52:48.1664943Z 
2026-02-05T13:52:48.1665044Z <stringsource>:352: ValueError
2026-02-05T13:52:48.1665328Z =========================== short test summary info ============================
2026-02-05T13:52:48.1665833Z FAILED test/test_csr.py::test_fast_graph_center_idx - ValueError: buffer source array is read-only
2026-02-05T13:52:48.1666377Z FAILED test/test_csr.py::test_sholl - ValueError: buffer source array is read-only
2026-02-05T13:52:48.1666799Z ======================== 2 failed, 160 passed in 24.78s ========================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant