Does IPython offer any profiling? Does regular Python profiling work? I would recommend to start a profiling session before the last statement, and to end it immediately after. A tool like snakeviz can them visualize it for you.

On Fri, Mar 8, 2024, 18:26 Xavier Otazu Porter <xotazu@cvc.uab.cat> wrote:
I am not a python expert, but same behaviour here ...

NEST 3.6 (git master HEAD from february 12), Python 3.8.12, Rocky Linux 8.5

Xavier

From: Hans Ekkehard Plesser <hans.ekkehard.plesser@nmbu.no>
Sent: Friday, March 8, 2024 3:24 PM
To: users@nest-simulator.org <users@nest-simulator.org>
Subject: [NEST Users] Strange interaction between NEST and IPython
 

 

Dear Python experts among the NEST Users!

 

I just notice a strange interaction between NEST and Ipython. In a freshly started Ipython, I execute the following three statements

 

import nest

n = nest.Create('parrot_neuron', positions=nest.spatial.free([(x, 0) for x in range(10000)]))

n

 

The last one takes extraordinarily long, over 10 seconds, I think. But if I instead do

 

print(n)

 

it executes instantaneously.

 

Also, if I do the same thing in python directly, just entering

 

n

 

shows the NodeCollection immediately.

 

Can anyone reproduce this and does anyone have an idea what might be going on?

 

I am on macOS 14.3.1 with Python 3.12.2, Ipython 8.22.2, and have checked with NEST 3.6 and a branch of recent master.

 

Best,

Hans Ekkehard

 

-- 

 

Prof. Dr. Hans Ekkehard Plesser

 

Department of Data Science

Faculty of Science and Technology

Norwegian University of Life Sciences

PO Box 5003, 1432 Aas, Norway

 

Phone +47 6723 1560

Email hans.ekkehard.plesser@nmbu.no

Home http://arken.nmbu.no/~plesser

 

 


Computer Vision Center
CONFIDENTIALITY WARNING

_______________________________________________
NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org