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

input args data type conflict #11

Open
YaungLiu opened this issue Oct 3, 2022 · 1 comment
Open

input args data type conflict #11

YaungLiu opened this issue Oct 3, 2022 · 1 comment

Comments

@YaungLiu
Copy link

YaungLiu commented Oct 3, 2022

Hi,

I would like to ask about an error of 'incompatible function arguments'.
It suggests only the following argument types are supported: 1. (arg0: numpy.ndarray[numpy.int64], arg1: numpy.ndarray[numpy.float64], arg2: numpy.ndarray[numpy.float64], arg3: int, arg4: int, arg5: str, arg6: int) Tuple[numpy.ndarray[numpy.int32], numpy.ndarray[numpy.int32]]
when I used numpy.array.

So I changed from numpy.array to numpy.ndarray, but it raises another error of ValueError: maximum supported dimension for an ndarray is 32, found 390577

The following is my script.

`from pcst_fast import pcst_fast
import numpy as np
import pickle5 as pickle

edge = pickle.load(open('edge.pickle', 'rb'))
prizes = pickle.load(open('prize.pickle', 'rb'))

edges = []
costs = []
for (gene1, gene2) in edge:
edges.append([gene1, gene2])
costs.append(edge[(gene1, gene2)])

edges = np.ndarray(edges, dtype='int64')
costs = np.ndarray(costs, dtype='float64')
prize = np.ndarray(prizes, dtype='float64')

verticess, edgess = pcst_fast(edges, prize, costs, root=-1, num_clusters=3, pruning='strong', verbosity_level=3)
print(verticess)
print(edgess)
`

@YaungLiu
Copy link
Author

YaungLiu commented Oct 3, 2022

I checked your example and it seems that the input prize and edge should be python list rather than array. It fixed now. Thank you.

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

1 participant