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 update for "Optimization of FS cell" #509

Closed alex4200 closed 4 years ago

alex4200 commented 4 years ago

Expected behavior

Should work for python3

Actual Behavior (please include screenshot if possible)

Several incompatibility issues.

Steps to reproduce the problem

  1. Clone notebook
  2. Change kernel
  3. Run all cells

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

Guidelines

When updating the notebook you might consider some of the Guidelines to provide an improved look & feel.

a1eko commented 4 years ago

Hi Alex! What's the URL to "clone the notebook" or should I do it in Collab?

alex4200 commented 4 years ago

Hi, the URL to the DEV notebook is: /8566/opt-fs_cell.ipynb

You just need to update this notebook until it is running on a python3 kernel

https://collab.humanbrainproject.eu/#/collab/8566/nav/64870

a1eko commented 4 years ago

I corrected use of the print function. Should be compatible with both v2 and v3 now.

alex4200 commented 4 years ago

@a1eko: I tested the above notebook and I found the following issues:

  1. That notebook is still with the python2 kernel. You need to change the kernel to python3 and save the notebook.
  2. In the second code cell you have to replace storage = get_bbp_client().document by storage = get_hbp_service_client().storage.
  3. Later in the notebook, after "Parameters" there are some brackets missing for print x.
  4. Later in the section "Simulator" I get an error
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-32-7f5abacf1fef> in <module>
----> 1 simulator = ephys.simulators.NrnSimulator()

/opt/conda/lib/python3.6/site-packages/bluepyopt/ephys/simulators.py in __init__(self, dt, cvode_active, cvode_minstep, random123_globalindex)
     30             self.banner_disabled = False
     31 
---> 32         self.neuron.h.load_file('stdrun.hoc')
     33 
     34         self.dt = dt if dt is not None else self.neuron.h.dt

/opt/conda/lib/python3.6/site-packages/bluepyopt/ephys/simulators.py in neuron(self)
     86 
     87         if self.disable_banner and not self.banner_disabled:
---> 88             NrnSimulator._nrn_disable_banner()
     89             self.banner_disabled = True
     90 

/opt/conda/lib/python3.6/site-packages/bluepyopt/ephys/simulators.py in _nrn_disable_banner()
     72             raise Exception(
     73                 'hoc shared library not found in %s' %
---> 74                 nrnpy_path)
     75 
     76         hoc_so = hoc_so_list[0]

Exception: hoc shared library not found in /home/jovyan/.local/nrn/lib/python/neuron

Having restarted the notebook from scratch I get a kernel-restart at that point in the notebook. The log file show the following entry during these times:

It's version 6.2.0 "c" code is incompatible with this neuron version.

If you can have a look and fix the errors (and make a test run of your notebook) that would be great.

alex4200 commented 4 years ago

@a1eko Do you have any update on this issue?

a1eko commented 4 years ago

Not yet. I just resolved "500: internal server error" I had with all my notebooks.


From: alex4200 notifications@github.com Sent: Thursday, March 5, 2020 1:38 PM To: cnr-ibf-pa/hbp-bsp-issues Cc: Alexander Kozlov; Mention Subject: Re: [cnr-ibf-pa/hbp-bsp-issues] Python3 update for "Optimization of FS cell" (#509)

@a1ekohttps://github.com/a1eko Do you have any update on this issue?

- 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/509?email_source=notifications&email_token=ACT7NUT6SPARQL55QEWYI3LRF6MK3A5CNFSM4KHR2EF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5CMFI#issuecomment-595207701, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACT7NURUQ34ED2646TBFP23RF6MK3ANCNFSM4KHR2EFQ.

antonelepfl commented 4 years ago

Do you have any update on this?

a1eko commented 4 years ago

Fixed it in my Sandbox. Carmen tested it fine but it doesn't run for me... kernel dies at simulator = ephys.simulators.NrnSimulator()

Could you check it please? I added you to the team. It takes about 10 minutes once it starts optimiser.run() https://collab.humanbrainproject.eu/#/collab/3332/nav/524088

clupascu commented 4 years ago

@a1eko I replied to you in the support ticket that you should ask for a reset of your container. I was waiting for a reply from you there. Was your container reset?

antonelepfl commented 4 years ago

In my case it works but I had to upgrade the version of pandas (I had 0.19) because I had some errors with some testing library while importing it

a1eko commented 4 years ago

@Carmen, Since they didn't reply, I suppose it wasn't reset. Reminded again here: https://support.humanbrainproject.eu/#ticket/zoom/3155

a1eko commented 4 years ago

@clupascu It is reset now. Should I try it or did you want to inspect anything first?

alex4200 commented 4 years ago

@a1eko I suggest you try again.

clupascu commented 4 years ago

@a1eko just do a !pip freeze before trying again and save the output. Then try again and let us know.

a1eko commented 4 years ago

@clupascu (sorry for delay!) pip freeze output is attached: collab-freeze-20200330.txt

Same problem cell 21 (simulator = ephys.simulators.NrnSimulator()) this time complaining on no neuron hoc file: /opt/conda/lib/python3.6/site-packages/bluepyopt/ephys/simulators.py:74: UserWarning: Unable to find Neuron hoc shared library in /home/jovyan/.local/nrn/lib/python/neuron, not disabling banner 'not disabling banner' % nrnpy_path)

Although there seems to be a hoc.so file there.

clupascu commented 4 years ago

@a1eko in this ticket https://support.humanbrainproject.eu/#ticket/zoom/3185 I told you that you should install bluepyopt 1.6.42 using the code available in this notebook (second and third cells) https://collab.humanbrainproject.eu/#/collab/9132/nav/530562. In the pip freeze that you attached I see bluepyopt==1.6.11.

clupascu commented 4 years ago

@a1eko or the pip freeze attached was before installing the new version of bluepyopt? We can also have a Skype call to help on this if you would like. Please let me know.

a1eko commented 4 years ago

@clupascu: Right, bluepyopt 1.6.42 was installed in cell 2 and pip freeze says bluepyopt==1.6.42 now. Sure we can skype if it helps.

clupascu commented 4 years ago

@a1eko we can have a Skype call tomorrow at 11. See you tomorrow on Skype.

a1eko commented 4 years ago

@clupascu This example notebook runs well now, thank you! https://collab.humanbrainproject.eu/#/collab/3332/nav/524088

@alex4200 Alex, should I replace the problem notebook with the above one https://collab.humanbrainproject.eu/#/collab/8566/nav/64870

or should I edit it? (It is intended for BSP and it is not runnable by itself.)

alex4200 commented 4 years ago

@a1eko I am not sure what you mean. Do you have changed the existing notebook to make it python3 compatible? Or do you have a new notebook?

I just checked the notebook you mentioned and it still has a python2 kernel. I appreciate if you can clarify.

But the best practice is still if you update the existing DEV notebook which is opt-fs_cell.ipynb in Collab 8566.

a1eko commented 4 years ago

@alex4200 Check this one https://collab.humanbrainproject.eu/#/collab/8566/nav/546964 Does it run?

alex4200 commented 4 years ago

Hi,

I fixed a very small bug, but this notebook runs to the end. Is that to be used instead of the current one?

Cheers

Alex


From: Alexander Kozlov notifications@github.com Sent: Wednesday, April 1, 2020 6:07:02 PM To: cnr-ibf-pa/hbp-bsp-issues Cc: Dietz Alexander; Mention Subject: Re: [cnr-ibf-pa/hbp-bsp-issues] Python3 update for "Optimization of FS cell" (#509)

@alex4200https://github.com/alex4200 Check this one https://collab.humanbrainproject.eu/#/collab/8566/nav/546964 Does it run?

— 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/509#issuecomment-607341076, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADBDXS67CZVS7XSL2XMAWD3RKNRCLANCNFSM4KHR2EFQ.

a1eko commented 4 years ago

Yes, Alex, exactly! It is supposed to replace the previous notebook for the use case "Optimization of FS cell" (#509) in BSP.

alex4200 commented 4 years ago

Notebook is on PROD, closing ticket