NSLS-II / pyCHX

chx_analysis_codes
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

xsvsp_single() function of chx_specklecp.py does not work when the `norm != None` #47

Closed tankonst closed 3 years ago

tankonst commented 4 years ago

xsvsp_single does not work when norm is selected, because the function extract_label_indices is not defined. Most likely, the function is a part of scikitbeam.core.roi library

https://github.com/NSLS-II/pyCHX/blob/5477bbcc9b66092f9c8d6fd3a7abd751f7dd3b29/pyCHX/v2/_commonspeckle/chx_specklecp.py#L141

tankonst commented 4 years ago

changing extract_label_indices to roi.extract_label_indeces makes it run, but another issue appears. """ Traceback (most recent call last): line 449, in _process prob_k[level, j] += spe_hist ValueError: operands could not be broadcast together with shapes (11,) (12,) (11,) """

ambarb commented 3 years ago

@tankonst do you need a fix soon or can it just wait for v2?

tankonst commented 3 years ago

Ooops, I forgot I opened this issue. After trying to fix it for a while, I have realized that different parameters should be passed to hte function for it to work. I works correctly. Sorry for confusion. I am closing the issue.

ambarb commented 3 years ago

no worries. can you type what it should have been with some description. Maybe we should improve the doc string since the ultimate goal of v2/_commonspeckle is an open library for anyone that wants to understand how to use the functions.

ambarb commented 3 years ago

maybe also the documentation is lacking in skbeam. extract_label_indices gave me troubles in skbeam, and at the time, it wasn't worth the effort to understand how I was wrong in understanding its usage. Eitherway, I think we can re-0pen and change the issue title to be about docstring improvement