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

null_model_und_sign not supported between instances of 'tuple' and 'int' #76

Closed
vinferrer opened this issue Sep 5, 2019 · 5 comments
Closed

Comments

@vinferrer
Copy link

Hello,

I tried to use null_model_und_sign but it gave me this error:
/opt/anaconda3/lib/python3.6/site-packages/bct/algorithms/reference.py in null_model_und_sign(W, bin_swaps, wei_freq)
978 if np.size(np.where(Ap.flat)) < (n * (n - 1)):
979 W_r = randmio_und_signed(W, bin_swaps)
--> 980 Ap_r = W_r > 0
981 An_r = W_r < 0
982 else:

TypeError: '>' not supported between instances of 'tuple' and 'int'

I used an undirected signed matrix of 416x416. Could you help with this issue?

Cheers,
Vicente

@vinferrer vinferrer changed the title null_model_und_sign null_model_und_sign not supported between instances of 'tuple' and 'int' Sep 5, 2019
@MuriloSchaefer
Copy link
Contributor

Hey, I also had some issues with null_model_und_sign.

look at this PR: #74
After that change my code worked welll

@aestrivex
Copy link
Owner

aestrivex commented Mar 24, 2020 via email

@frheault
Copy link

frheault commented Apr 14, 2020

Hi @aestrivex,
Since it is related to the same function, I decided to post it here.

I am currently working on version 0.5.1 on python 3.7

At line 1008 of bct/algorithms/reference.py
wei_period = np.round(1 / wei_freq) # convert frequency to period
This has to be converted to int before line 1013
R = np.random.permutation(m)[:int(np.min((m, wei_period))]

Since the tag 0.5.1 isn't the one being install via pip install, I was wondering if it was still WIP?
Should I do a PR or wait it out (or fork) ?

@aestrivex
Copy link
Owner

aestrivex commented Apr 14, 2020 via email

@aestrivex
Copy link
Owner

Fixed in #74

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

No branches or pull requests

4 participants