med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

343
active users

#numpy

0 posts0 participants0 posts today

My first experience with #chatgpt5.

I queried how to write some #python code to write out unformatted, binary files so my #fortran code could read it.

Proceeds to give me a load of #NumPy code. Completely neglects to mention the #SciPy FortranFile class that can trivially read and write, and appears on the first page of a search.

This is going to be a bumpy ride!

I've been trying Jax for an Alife programming project, and that's just made me appreciate Taichi more.

The big selling point of Jax for a lot of people is vmap, which is an easy way to jit compile and vectorize Python code. It can get you a huge performance boost for little effort on custom code operating on Numpy-style arrays. That's already a boon for many projects! It's also perfect for "glue code" between GPU-based libraries or neural networks that avoids memory transfers over the PCI bus. What it doesn't do is use all the threads on your GPU, which is a shame, because there are thousands of them. For that, you have to write a custom kernel using an underdeveloped side library.

Taichi requires more thoughtful coding than Jax, but it lets you write kernels that use your whole GPU in a simple, clean way without manually managing grid sizes and memory allocations. This is a huge win for big simulation jobs, in terms of performance and ease of use.

Czym miałem się zajmować: dodawaniem wsparcia CPU_FLAGS_* do paczek #NumPy w #Gentoo.

Czym się zajmuję: przegrzebywaniem dokumentacji #ARM, źródeł jądra, źródeł NumPy, by ogarnąć brakujące flagi w CPU_FLAGS_ARM i sposób ich wykrywania.

Ugh great.

I sing mild praises of #Python documentation, but when it comes to third party libraries like #NumPy and especially #SciPy the documentation ranges from less than stellar to utterly atrocious.

And now I have a problem: scipy.optimize.fsolve() is throwing a numpy DeprecationWarning: Conversion of an array with nim > 0 to a scalar is deprecated.

The function I'm passing in to fsolve() returns a scalar!! And I'm already extracting index 0 from the return of fsolve!! WTF???

🗣️ Announcing Python-Blosc2 3.6.1

!Unlock new levels of data manipulation with Blosc2! 🚀

We've introduced a major improvement: powerful fancy indexing and orthogonal indexing for Blosc2 arrays.

We've tamed the complexity of fancy indexing to make it intuitive, efficient, and consistent with NumPy's behavior. 💪

Read all about it on our blog! 📝 blosc.org/posts/blosc2-fancy-i

Compress Better, Compute Bigger!

🚀 Great news for OpenMP on Python!

NumPy 2.3 includes early OpenMP support, making sorting operations like np.sort and np.argsort faster by using multiple processor cores — a big step for performance!

🛠️ This new feature is off by default but can be turned on during installation with -Denable_openmp=true

This marks the beginning of more parallel computing support in NumPy!

phoronix.com/news/NumPy-2.3-Re

www.phoronix.comNumPy 2.3 Introduces OpenMP Parallelization Support

If you're writing python libraries, DON'T REQUIRE fileno ON FILE OBJECTS!

Dealing w/ the bullshit that numpy.fromfile wants the fileno attribute on a file object. Yes, it's slightly faster, but it also makes it harder to mock when doing testing.

Now I'm going to have to deal w/ creating a temporary directory, writing the file, and cleaning up afterward. Things that unittest.TestCase should have an option to do, but doesn't. Luckily I've dealt w/ this BS before, so I'll just copy the code from another project.