#cython

2025-05-15

En route to @pycon after a brief stopover in NYC for part of Never Graduate week!

I’ll be talking about debugging in #cython (both at runtime and for memory management) on Saturday just after lunch.

us.pycon.org/2025/schedule/pre

Looking forward to seeing everyone at the conference!

#pycon25 #pyconus

Andrew Dalkedalke@toots.nu
2025-02-04

Hot off the presses!

hg.sr.ht/~dalke/hidden_shuffle

hidden_shuffle, an implementation of the Hidden Shuffle method for sequential random sampling.

Given a population of size N, randomly choose k elements (0<k<=N), and iterate over the elements in increasing index order.

Implemented in C. Use 'make' to create a command-line executable. Use "pip install ." (or your installer of choice) #cython wrapped #Python extension.

2025-02-02

I'm happy to announce a new version of our #pycraf #Python package:

github.com/bwinkel/pycraf

The only change is that it now runs with numpy v2. Doesn't sound like much, but it was some effort, as pycraf uses a lot of #Cython (i.e., compiled code) under the hood.

I was extremely happy when I realized that with numpy 2 one doesn't need to pin certain versions for ABI compatibility anymore. If you don't know what that means, don't worry - it's developer/package maintainer stuff. Apparently, even if you build the binary packages with numpy v2, it should still run under numpy v1. Magic. Will safe me hours of maintenance time, which can be better spent on new features.

2025-01-29

@isaaclyman
That's pretty much how #Python optimizing compilers like #cython, #mypyc, #numba, and #TaichiLang work, and iiuc is the idea behind #MOJOlang.

As for leaky abstractions, I'd mitigate that by moving the lower-level algorithms into a separate module and limit the optimization pass to that module. Higher-level modules, like CLI entry points or API server route handlers, shouldn't need the extra optimization.

Alexandre B A Villares 🐍villares@ciberlandia.pt
2024-12-31

@nen while still on Python, have you tried scientific computation speed up things like #Numba ? Also, I once saw a #Cython talk and I was almost convinced to give it a go (but I'm too lazy) :D

Alexander Tikhonovtikhonov_a
2024-11-23

Just published 3.15 with the plugin system! 🎉 I guess the next thing will be plugins for serialization and deserialization. Who knows, maybe this will be my ticket to strict validation and speeding up with . On a side note, I believe I’m among the last developers to discontinue support for 3.8.

github.com/Fatal1ty/mashumaro/

2024-11-03

Как реализовать быструю реентерабельную блокировку на Python и почему она работает

В стандартной библиотеке языка Python имеется базовый примитив синхронизации — реентерабельная блокировка. Она позволяет одному и тому же потоку, несколько раз захватить блокировку. Стандартная реализация может использовать для блокировки мьютекс или семафор, и их захват всегда приводит к вызову функции из ядра ОС. Используя GIL (Global Interpreter Lock - Глобальная блокировка интерпретатора) и особенности реализации Threading.Lock.release можно создать более быстрый вариант. Давайте попробуем разобраться

habr.com/ru/articles/855728/

#python #cython #locks

2024-10-06

My Q4 goal (or whatever, end of year) is to make at least one open source contribution to a major library (preferably for #Python)

I think #hacktoberfest is less of a thing?

So far I’ve noticed that on the major Python libraries, (core CPython, #numpy) they don’t really do “good first issue” tags anymore.

Also want to read everything I can about free threading. Maybe improve some of the #cython docs based on my past work.

(Very happy to be corrected on these assertions if I’m wrong)

2024-10-05

Do you love Cython? Are you passionate about open source? Consider volunteering with pyOpenSci! We’re looking for a volunteer reviewer with Cython expertise and an interest in network diffusion processes to help review the CyNetDiff Python package.

🫶 New to reviewing? We offer mentorship!

💻 Learn more about CyNetDiff: github.com/eliotwrobson/CyNetD
💜 Apply today: bit.ly/pyOSReviewer

#OpenSource #OpenScience #Python #pyOpenSci #Volunteer #Cython #NetworkDiffusion

2024-09-28

I’ve had an unfortunate trend lately of always presenting on the last day at conferences 😅

That being said, just finished presenting “Sleuthing in Cython” on my debugging and memory profiling adventures at #pyconjp2024

The talk was recorded and will be available later, but the slides and underlying repo are already up!

pretalx.com/media/pyconjp2024/

github.com/m-clare/cytriangle

#cython @ThePSF #oss #python

Dźwiedziudzwiedziu
2024-09-27

Refactoring Cython code, barely knowing Python, with the subtlety of a jackhammer ^_^J

2024-08-26

I just finished wrapping up my contribution to #gsoc24 !! I sped up one of the use cases by a factor of one gazilion! Was so nice to work in a large codebase using #python, #cython, #wx and #VTK

check out my blog for more info :D

guara.tech/posts/gsoc_2024_inv

#opensource #python #VTK

2024-04-22

I prototyped Python bindings for Linux adjtimex() with CFFI, ctypes, Cython, and PyO3 github.com/moreati/python-adjt Please be gentle, this is Baby's First Rust. #Python #CFFI #CTypes #Cython #PyO3

2024-03-04

**3** Replace Brian's just-in-time compilation mechanism
(Full-time)

In Brian's "runtime mode", the generated code can interact with Python code by accessing the same data structures in memory. To make this work seamlessly, Brian makes use of Cython. This approach comes with a few downsides, since Cython is much more general than what we need, and is not meant for dynamic code generation.

This project's aim is to replace the Cython-based runtime code generation by a simpler framework.

#C++ #Cython #python

neurostars.org/t/gsoc-2024-pro

4/5

2024-02-29

#ThisMonthInFluiddyn - Feb 2024 edition

A big one, where many #FluidDyn packages starts rolling on wheels 🚗 🏁 !

🔹FluidFFT, your user-friendly parallelized FFT package, is now so easy to install! Try:

pip install fluidfft pyfftw

🔹The #Pythran extensions comes pre-compiled!

🔹FluidFFT v0.4.x has plugins now (one each for different MPI enabled Cython backends: FFTW, P3DFFT, PFFT ...) which requires #Cython compilation. This used to be part of FluidFFT in older versions.

fluidfft.readthedocs.io/en/lat

Jonathan Hoggjonathanhogg
2024-02-07

Honestly, about 10% of my commits are immediately followed by another one with the message, “Oops! …”

Jonathan Hoggjonathanhogg
2024-02-07

Why has it taken me until yesterday to set up a git commit hook that runs the linter and stops me checking in *obviously broken code*…

[Edit: of course, I meant *pre-commit* hook 🙄]

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst