numpy/python (image) problem

2020-12-08 Thread Paulo da Silva
Hi! I am looking at some code, that I found somewhere in the internet, to compute DCT for each 8x8 block in an gray (2D) image (512x512). This is the code: def dct2(a): return scipy.fft.dct(scipy.fft.dct(a,axis=0,norm='ortho'),axis=1,norm='ortho') imsize=im.shape dct=np.zeros(imsize) # Do

Property type hints?

2020-12-08 Thread Paul Bryan
Would this be a reasonably correct way to annotate a property with a type hint? >>> class Foo: ... bar: int ... @property ... def bar(self): ... return 1 ... >>> foo = Foo() >>> import typing >>> typing.get_type_hints(foo) {'bar': } I could also decorate the property method r

Re: linear algebric equations

2020-12-08 Thread Christian Gollwitzer
Am 07.12.20 um 17:59 schrieb Tito SanĂ²: Regarding the solution of linear algebraic equations I noticed a big difference in the computation time in Python compared to the old fortran language. I have compared both the linelg and lapack.dgesv-lapack.zgesv modules with the fortan: dgelg and f04adf

Re: linear algebric equations

2020-12-08 Thread Marco Sulla
On Mon, 7 Dec 2020 at 20:38, Tito SanĂ² wrote: > Is it possible to get better performance in Python? Have you installed BLAS for Scipy? What OS do you have? -- https://mail.python.org/mailman/listinfo/python-list

RE: linear algebric equations

2020-12-08 Thread Schachner, Joseph
Yes. Import os, and use os.system( ) to call your Fortran (or C) executable. If the executable saves results in a file or files, Python can read them in an format a nice overall report. In html or xml, if you like. Using Python as glue, the execution time will be exactly what it was for you

PyDev 8.1.0 Released

2020-12-08 Thread Fabio Zadrozny
PyDev 8.1.0 Release Highlights - *Interactive Console* - The selection for which console to open may be saved. (*#PyDev-1112*) - When the *current editor* option is selected, the related interpreter is no longer asked. (*#PyDev-1112*) - *Debugger* (updated to pydevd 2

Re: [RELEASE] Python 3.9.1 is now available, together with 3.10.0a3 and 3.8.7rc1

2020-12-08 Thread Terry Reedy
On 12/7/2020 8:33 PM, Pablo Galindo Salgado wrote: It's starting to get very cold (at least on the Northern hemisphere) so we have been carefully packaging a total of three new Python releases to keep you warm these days! Python 3.9.1 is the first maintenance release of Python 3.9, and also the

Re: Letter replacer - suggestions?

2020-12-08 Thread Thomas Jollans
On 07/12/2020 16:48, Bischoop wrote: I worked on my wee script that replaces a letters: https://bpa.st/OYBQ . I would like to have some suggestions about the code from more experienced programmers, the code does work and do its job but perhaps could work in a better way. Thanks Sure! First o