[Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Hongyi Zhao
Hi, My environment is Ubuntu 20.04 and python 3.8.3 managed by pyenv. I try to run the script , but it will keep running and never end. When I use 'Ctrl + c' to terminate it, it will give the following output: $ py

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Robert Kern
You don't need to use vectorize() on fermi(). fermi() will work just fine on arrays and should be much faster. On Sat, Oct 10, 2020, 8:23 AM Hongyi Zhao wrote: > Hi, > > My environment is Ubuntu 20.04 and python 3.8.3 managed by pyenv. I > try to run the script > < > https://notebook.rcc.uchicag

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Hongyi Zhao
On Sun, Oct 11, 2020 at 1:48 AM Robert Kern wrote: > > You don't need to use vectorize() on fermi(). fermi() will work just fine on > arrays and should be much faster. Yes, it really does the trick. See the following for the benchmark based on your suggestion: $ time python mu.py [-10.999 -10.9

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Andrea Gavana
Hi, On Sun, 11 Oct 2020 at 00.27, Hongyi Zhao wrote: > On Sun, Oct 11, 2020 at 1:48 AM Robert Kern wrote: > > > > You don't need to use vectorize() on fermi(). fermi() will work just > fine on arrays and should be much faster. > > Yes, it really does the trick. See the following for the benchma

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Andrea Gavana
On Sun, 11 Oct 2020 at 07.14, Andrea Gavana wrote: > Hi, > > On Sun, 11 Oct 2020 at 00.27, Hongyi Zhao wrote: > >> On Sun, Oct 11, 2020 at 1:48 AM Robert Kern >> wrote: >> > >> > You don't need to use vectorize() on fermi(). fermi() will work just >> fine on arrays and should be much faster. >>

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Hongyi Zhao
On Sun, Oct 11, 2020 at 1:33 PM Andrea Gavana wrote: > > > > On Sun, 11 Oct 2020 at 07.14, Andrea Gavana wrote: >> >> Hi, >> >> On Sun, 11 Oct 2020 at 00.27, Hongyi Zhao wrote: >>> >>> On Sun, Oct 11, 2020 at 1:48 AM Robert Kern wrote: >>> > >>> > You don't need to use vectorize() on fermi(). f

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Andrea Gavana
On Sun, 11 Oct 2020 at 07.52, Hongyi Zhao wrote: > On Sun, Oct 11, 2020 at 1:33 PM Andrea Gavana > wrote: > > > > > > > > On Sun, 11 Oct 2020 at 07.14, Andrea Gavana > wrote: > >> > >> Hi, > >> > >> On Sun, 11 Oct 2020 at 00.27, Hongyi Zhao > wrote: > >>> > >>> On Sun, Oct 11, 2020 at 1:48 AM

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Hongyi Zhao
On Sun, Oct 11, 2020 at 2:02 PM Andrea Gavana wrote: > > > > On Sun, 11 Oct 2020 at 07.52, Hongyi Zhao wrote: >> >> On Sun, Oct 11, 2020 at 1:33 PM Andrea Gavana >> wrote: >> > >> > >> > >> > On Sun, 11 Oct 2020 at 07.14, Andrea Gavana >> > wrote: >> >> >> >> Hi, >> >> >> >> On Sun, 11 Oct 20

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Evgeni Burovski
The script seems to be computing the particle numbers for an array of chemical potentials. Two ways of speeding it up, both are likely simpler then using dask: First: use numpy 1. Move constructing mu_all out of the loop (np.linspace) 2. Arrange the integrands into a 2d array 3. np.trapz along a