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

Possible deprecation issues in the example file of multimodel_custom_model #252

Open
DrCheesenuggets opened this issue Nov 9, 2023 · 1 comment

Comments

@DrCheesenuggets
Copy link

DrCheesenuggets commented Nov 9, 2023

After making efforts to run the multimodel custom model of Jansen-Rit and thalamus, I have been keeping on receiving errors that are possibly related to deprecation issues. A common issue is that newer numpy versions have changed usage of np.objects to objects.
Here some errors:

ValueError Traceback (most recent call last)
File ~\PycharmProjects\wholebrainsim\venv\Lib\site-packages\scipy\signal\windows_windows.py:2344, in get_window(window, Nx, fftbins)
2343 try:
-> 2344 beta = float(window)
2345 except (TypeError, ValueError) as e:

ValueError: could not convert string to float: 'hanning'

During handling of the above exception, another exception occurred:

SC = np.array([[0.0, 0.15], [6., 0.0]])
delays = np.array([[0.0, 13.0], [13.0, 0.0]]) # thalamocortical delay = 13ms
thalamocortical = MultiModel(JansenRitThalamusMiniNetwork(connectivity_matrix=SC, delay_matrix=delays, seed=42))
display(thalamocortical.model_instance.describe())

Traceback leading to the following:

File ~\PycharmProjects\wholebrainsim\venv\Lib\site-packages\neurolib\models\multimodel\builder\base\network.py:439, in SingleCouplingExcitatoryInhibitoryNode.init_node(self, **kwargs)
437 # gather inputs form this node - assumes constant delays
438 var_idx = 0
--> 439 self.inputs = np.zeros_like(self.connectivity, dtype=np.object)
440 # iterate over masses as from, hence columns
441 for from_mass, mass in enumerate(self.masses):
442 # iterate over indices as to, hence rows
AttributeError: module 'numpy' has no attribute 'object'.
np.object was a deprecated alias for the builtin object. To avoid this error in existing code, use object by itself. Doing this will not modify any behavior and is safe.

@JacobDuda
Copy link

For some reason there is a discrepancy between the code on the GitHub (v0.6.1) and the latest release (v0.6.2). In 0.6.2 the SingleCouplingExcitatoryInhibitoryNode class in the network.py file calls np.object when it should just be calling object. I think just install the library directly from the repo instead of using pip gets around it, but then you are missing some other changes I guess, otherwise you can just edit the code yourself by deleting the four characters.

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

2 participants