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!
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.
Back to the #numpy & #flocking experiment based on Nicolas Rougier's example in "From Python to Numpy". Code at: https://github.com/villares/sketch-a-day/tree/main/2025/sketch_2025_06_26
More sketch-a-day: https://abav.lugaralgum.com/sketch-a-day
If you like this, support my work:
https://www.paypal.com/donate/?hosted_button_id=5B4MZ78C9J724
https://liberapay.com/Villares
https://wise.com/pay/me/alexandrev562 #Processing #Python #py5 #CreativeCoding
We are pleased to announce the integration of a new stack feature in #Blosc2
, which allows for stacking large arrays along a new axis.
Performance benchmarks show that while aligned chunks yield the best results, #Blosc2 with unaligned chunks can still outperform #NumPy—a welcome discovery!
Many thanks to Luke Shaw for his excellent work on this new functionality.
We've updated our recent blog post:
Check it out! https://www.blosc.org/posts/blosc2-new-concatenate/#stacking-arrays
Not very good WIP... I always struggle to make #trimesh 3D meshes from scratch with #numpy Code at: https://github.com/villares/sketch-a-day/tree/main/2025/sketch_2025_06_22
More sketch-a-day: https://abav.lugaralgum.com/sketch-a-day
If you like this, support my work:
https://www.paypal.com/donate/?hosted_button_id=5B4MZ78C9J724
https://liberapay.com/Villares
https://wise.com/pay/me/alexandrev562 #Processing #Python #py5 #CreativeCoding
In NumPy, if a and b are matrices, a @ b gives you the matrix product.
If a and b are vectors, a @ b gives you a dot product.
If a and b are scalars (0-dimensional tensors), a @ b throws an error.
Provocative writing style but an interesting proposal for a better array interface for #Python. If you've ever found yourself hacking `None` into #NumPy array indices to make broadcasting work, you might find this (and the associated "I don't like NumPy") interesting:
(via @nicholdav)
This might be more evidence for my growing feeling that JAX is magical.
Oh dear, I'm still working on erosion. For quick experimentation, I've even broken out #Python, #Jupyter, #numpy and #matplotlib.
Here's a neat picture showing that something is working a little bit, although I think usually rivers are lower than the surrounding terrain, not higher.
Where will this end?