cnr-ibf-pa / hbp-bsp-issues

Ticketing system for developers/testers and power users of the Brain Simulation Platform of the Human Brain Project
4 stars 0 forks source link

Python3 upgrade for Striatum Microcircuitry usecase #502

Closed alex4200 closed 4 years ago

alex4200 commented 4 years ago

Expected behavior

Notebook works with python3 kernel

Actual Behavior (please include screenshot if possible)

Does not work yet with python3

Steps to reproduce the problem

  1. Clone the use case
  2. Change kernel to python3
  3. Adjust first cell to:
    
    import os
    import tarfile
    clients = get_hbp_service_client()
    filename = "Striatum-scaffold-network-use-case-2018.tar.bz2"
    clients.storage.download_file(os.path.join(get_collab_storage_path(), filename), filename)

tar = tarfile.open(filename) tar.extractall() tar.close()

os.chdir('StriatumScaffold2018')

This is some magic to make the plots show up in the notebook

%matplotlib inline

4. Run all cells

The error is because of a print statement in one of the python files included in the zip file. These files must be checked for python3 compatibility. 

Traceback (most recent call last):

File "/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2862, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 2, in from Network_place_neurons import NetworkPlaceNeurons

File "/home/jovyan/StriatumScaffold2018/Network_place_neurons.py", line 69 print text ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(text)?



### Optional infrastructural data (user, platform, browser, environment, ...)

Py3 kernel

## Guidelines

When updating the notebook you might consider some of the [Guidelines](https://collab.humanbrainproject.eu/#/collab/69119/nav/469089) to provide an improved look & feel.

## Extra Info

Related to #378 
Hjorthmedh commented 4 years ago

This is the old version of the scaffold model and should be replaced by the new version after paper is published. Submitting planned on Monday.

Hjorthmedh commented 4 years ago

This will be the replacement use case. https://collab.humanbrainproject.eu/#/collab/9102/nav/520440

Testing it now. It runs up until network simulation should start, but need an environment reset and neuron 7.7 to proceed.

Hjorthmedh commented 4 years ago

I wrote in the other thread that Neuron needs to be reinstalled on the collab, new version, plus Python 3 support. The 7.6 installation that is right now is for Python 2, and is not compatible.

Hjorthmedh commented 4 years ago

Did you close the other long running ticket about a striatum scaffold model? I could not find it now.

This ticket is named badly. The previous collab with the striatum usecase was python3 already from the start and running on that kernel. So there was no need to do that upgrade, however it probably broke due to changes in the API.

So from what I understand we will be migrating to lab.humanbrainproject.eu?

Here is a new use-case: https://lab.humanbrainproject.eu/user/hjorth/lab/tree/StriatumNetwork2020

I hope it is accessible to you, but maybe something needs to be done with the sharing settings.

What it does:

We can not keep breaking the collabs with new APIs. When they upgrade it must be with backward compability in mind.

Hjorthmedh commented 4 years ago

The error message:

!snudda simulate networks/StriatumExample --time 1.0 Traceback (most recent call last): File "/opt/app-root/bin/snudda", line 11, in load_entry_point('snudda', 'console_scripts', 'snudda')() File "/opt/app-root/src/StriatumNetwork2020/Snudda/snudda/cli.py", line 81, in snudda_cli actionsargs.action File "/opt/app-root/src/StriatumNetwork2020/Snudda/snudda/core.py", line 341, in simulate from .simulate import SnuddaSimulate File "/opt/app-root/src/StriatumNetwork2020/Snudda/snudda/simulate.py", line 22, in from mpi4py import MPI # This must be imported before neuron, to run parallel ImportError: /opt/app-root/lib/python3.6/site-packages/mpi4py/MPI.cpython-36m-x86_64-linux-gnu.so: undefined symbol: MPI_UNWEIGHTED

alex4200 commented 4 years ago

@Hjorthmedh I am not able to open your notebook, I get an error

Could not find path: StriatumNetwork2020

I think you have to share your notebook or folder with me. I will try to find out how to do that.

Hjorthmedh commented 4 years ago

Hi,

no it is still not working. Did you made that notebook public?

Cheers

Alex


From: hjorth hjorth@kth.se Sent: Thursday, February 13, 2020 7:34:01 AM To: cnr-ibf-pa/hbp-bsp-issues; cnr-ibf-pa/hbp-bsp-issues Cc: Mention; Dietz Alexander Subject: Notebook

Hej Alex, did you find out how?

Sent from my Samsung Galaxy smartphone.

-------- Original message -------- From: alex4200 notifications@github.com Date: 10/02/2020 07:08 (GMT+01:00) To: cnr-ibf-pa/hbp-bsp-issues hbp-bsp-issues@noreply.github.com Cc: Johannes Hjorth hjorth@kth.se, Mention mention@noreply.github.com Subject: Re: [cnr-ibf-pa/hbp-bsp-issues] Python3 upgrade for Striatum Microcircuitry usecase (#502)

@Hjorthmedhhttps://github.com/Hjorthmedh I am not able to open your notebook, I get an error

Could not find path: StriatumNetwork2020

I think you have to share your notebook or folder with me. I will try to find out how to do that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/cnr-ibf-pa/hbp-bsp-issues/issues/502?email_source=notifications&email_token=ABURAZMXXDDXWBT2YP5ERTTRCDVOLA5CNFSM4KFHKNGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELHK7NQ#issuecomment-583970742, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABURAZOS7D3SCGNTQSASPPDRCDVOLANCNFSM4KFHKNGA.

alex4200 commented 4 years ago

Hi Johannes,

you have to save the notebooks to a Collab in the drive, or you save it to a shared library which you have shared with me.

If that does not make sense, please contact the support at support@humanbrainproject.eu

Also take a look here: https://wiki.humanbrainproject.eu/bin/view/Collabs/jupyter-notebooks-collaboratory/Documentation/Introduction (new added documentation)

alex4200 commented 4 years ago

Currently, there is an import error in the new jupyterlab image when importing mpi4py:

from mpi4py import MPI # This must be imported before neuron, to run parallel
ImportError: /opt/app-root/lib/python3.6/site-packages/mpi4py/MPI.cpython-36m-x86_64-linux-gnu.so: undefined symbol: MPI_UNWEIGHTED

There is an issue with the image itself, and a new image will be deployed the coming Monday (9 Mar 2020). If that deployment does not fix the issue, another deployment is planned later that week.

alex4200 commented 4 years ago

@Hjorthmedh A new image has been deployed for the jupyterlabs (fixing the import mpi4py error); they are now available under https://lab.ebrains.eu/. I will try to rerun your notebook with the updated image.

alex4200 commented 4 years ago

A new error was discovered:

Traceback (most recent call last):
  File "/opt/app-root/bin/snudda", line 11, in <module>
    load_entry_point('snudda', 'console_scripts', 'snudda')()
  File "/mnt/user/drive/My Libraries/StriatumNetwork/SGA2/Snudda/snudda/cli.py", line 81, in snudda_cli
    actions[args.action](args)
  File "/mnt/user/drive/My Libraries/StriatumNetwork/SGA2/Snudda/snudda/core.py", line 341, in simulate
    from .simulate import SnuddaSimulate
  File "/mnt/user/drive/My Libraries/StriatumNetwork/SGA2/Snudda/snudda/simulate.py", line 23, in <module>
    from neuron import h, gui
ImportError: cannot import name 'h'

@Hjorthmedh created a bug report for support@humanbrainproject.eu

alex4200 commented 4 years ago

@Hjorthmedh Is there any news on that task, or should it be moved to SGA3?

Hjorthmedh commented 4 years ago

This usecase will be replaced by https://github.com/cnr-ibf-pa/hbp-bsp-issues/issues/378