+
Skip to content

Conversation

jberkh
Copy link

@jberkh jberkh commented Mar 29, 2024

I ran into an issue in pyscenic, where some values for pyscenic.prune.prun2df arguments auc_threshold and nes_threshold, it gave the following error:

File "/home/jberkh/miniconda3/envs/envScenic/lib/python3.10/site-packages/ctxcore/recovery.py", line 80, in rcc2d
    np.bincount(curranking, weights=weights)[:rank_threshold]
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'

The error arises from the need for an integer matrix as input for np.bincount. Apparently, curranking becomes a float matrix at certain values for auc_threshold and nes_threshold. The explicit cast to int fixes this issue.

NB: I'm unsure if the broader context of the code would necessitate calling np.rint() before casting to int. If so, please edit the PR where necessary.

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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载