paulox, to python
@paulox@fosstodon.org avatar

This morning I presented my talk "Many ways to be a Python contributor" at PyCon Italia 2024 🚀

I thank Michela for helping me and all the attendees 🙏

CC @pycon

More info here 👇
https://www.paulox.net/2024/05/25/pycon-italia-2024/

Paolo giving his talk
Portrait of Paolo during the talk
Paolo and Michela after the talk

pyOpenSci, to python
@pyOpenSci@fosstodon.org avatar

Happy Saturday, y'all, and welcome home to all the PyCon travelers!

What's everyone working on this weekend?

(We're queuing up some 🔥 blog posts!)

JackEvans, to python
@JackEvans@fosstodon.org avatar

Python folks I'm looking for a tool.

I want something like modulefinder that I can point at a target that outputs a subset of deps/requirements (so I can tree shake requirements in a monorepo).

Does such a tool exist? (before I attempt to write one)

mblayman, to python
@mblayman@mastodon.social avatar

🐍 On this Building SaaS with and , I added a feature to improve the user experience (UX) to ease the transition between school years in my homeschool scheduling app. https://www.youtube.com/watch?v=SIRdhKCXmFE

pizzatorque, to emacs
@pizzatorque@emacs.ch avatar

I'm live on Twitch, come hang out! and shenanigans and making a minimal terminal client for lemmy. https://www.twitch.tv/PizzaTorque?sr=a

jhx, to python
@jhx@fosstodon.org avatar

Cool #Python module to make reuqests over #Tor :python:

https://pypi.org/project/requests-tor/

paulox, to python
@paulox@fosstodon.org avatar

Today at 12.35 PM CEST I'll present the talk "Many ways to be a Python contributor" at PyCon Italia 2024 🚀

You can follow the talk in the Tagliatelle room or watch it live online on the website 👇
https://2024.pycon.it/en/event/many-ways-to-be-a-python-contributor

ptmcg, to python
@ptmcg@fosstodon.org avatar

I just published 0.9.0 version of logmerger, compatible with Python 3.13. Here is an example merge of a client and server log, plus PCAP packet capture file showing TCP send/receive traffic. Uses textual TUI framework for cursor and mouse interaction in a terminal session. https://pypi.org/project/logmerger

villares, to python Portuguese
@villares@pynews.com.br avatar
jonny, to python
@jonny@neuromatch.social avatar

Here's an ~ official ~ release announcement for

repo: https://github.com/p2p-ld/numpydantic
docs: https://numpydantic.readthedocs.io

Problems: @pydantic is great for modeling data!! but at the moment it doesn't support array data out of the box. Often array shape and dtype are as important as whether something is an array at all, but there isn't a good way to specify and validate that with the Python type system. Many data formats and standards couple their implementation very tightly with their schema, making them less flexible, less interoperable, and more difficult to maintain than they could be. The existing tools for parameterized array types like nptyping and jaxtyping tie their annotations to a specific array library, rather than allowing array specifications that can be abstract across implementations.

numpydantic is a super small, few-dep, and well-tested package that provides generic array annotations for pydantic models. Specify an array along with its shape and dtype and then use that model with any array library you'd like! Extending support for new array libraries is just subclassing - no PRs or monkeypatching needed. The type has some magic under the hood that uses pydantic validators to give a uniform array interface to things that don't usually behave like arrays - pass a path to a video file, that's an array. pass a path to an HDF5 file and a nested array within it, that's an array. We take advantage of the rest of pydantic's features too, including generating rich JSON schema and smart array dumping.

This is a standalone part of my work with @linkml arrays and rearchitecting neurobio data formats like NWB to be dead simple to use and extend, integrating with the tools you already use and across the experimental process - specify your data in a simple yaml format, and get back high quality data modeling code that is standards-compliant out of the box and can be used with arbitrary backends. One step towards the wild exuberance of FAIR data that is just as comfortable in the scattered scripts of real experimental work as it is in carefully curated archives and high performance computing clusters. Longer term I'm trying to abstract away data store implementations to bring content-addressed p2p data stores right into the python interpreter as simply as if something was born in local memory.

plenty of todos, but hope ya like it.

[Further demonstration of validation and array expression, where a Union of NDArray specifications can specify a more complex data type - eg. an image that can be any shape in x and y, an RGB image, or a specific resolution of a video, each with independently checked dtypes] For example, to specify a very special type of image that can either be a 2D float array where the axes can be any size, or a 3D uint8 array where the third axis must be size 3 a 1080p video from typing import Union from pydantic import BaseModel import numpy as np from numpydantic import NDArray, Shape class Image(BaseModel): array: Union[ NDArray[Shape["* x, * y"], float], NDArray[Shape["* x, * y, 3 rgb"], np.uint8], NDArray[Shape["* t, 1080 y, 1920 x, 3 rgb"], np.uint8] ] And then use that as a transparent interface to your favorite array library! Interfaces Numpy The Coca-Cola of array libraries import numpy as np # works frame_gray = Image(array=np.ones((1280, 720), dtype=float)) frame_rgb = Image(array=np.ones((1280, 720, 3), dtype=np.uint8)) # fails wrong_n_dimensions = Image(array=np.ones((1280,), dtype=float)) wrong_shape = Image(array=np.ones((1280,720,10), dtype=np.uint8)) # shapes and types are checked together, so this also fails wrong_shape_dtype_combo = Image(array=np.ones((1280, 720, 3), dtype=float))
[Demonstration of usage outside of pydantic as just a normal python type - you can validate an array against a specification by checking it the array is an instance of the array specification type] And use the NDArray type annotation like a regular type outside of pydantic – eg. to validate an array anywhere, use isinstance: array_type = NDArray[Shape["1, 2, 3"], int] isinstance(np.zeros((1,2,3), dtype=int), array_type) # True isinstance(zarr.zeros((1,2,3), dtype=int), array_type) # True isinstance(np.zeros((4,5,6), dtype=int), array_type) # False isinstance(np.zeros((1,2,3), dtype=float), array_type) # False
[Demonstration of JSON schema generation using the sort of odd case of an array with a specific dtype but an arbitrary shape. It has to use a recursive JSON schema definition, where the items of a given JSON array can either be the innermost dtype or another instance of that same array. Since JSON Schema doesn't support extended dtypes like 8-bit integers, we encode that information as maximum and minimum constraints on the

jbzfn, to python
@jbzfn@mastodon.social avatar
treyhunner, to python
@treyhunner@mastodon.social avatar

Note that this function uses an "if" statement that returns, and an "else" that also returns.

Read more 👉 https://trey.io/FlSco3

nedbat, to python
@nedbat@hachyderm.io avatar

The joy of trying to be on the cutting edge of :

HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
'Programming Language :: Python :: 3.14' is not a valid classifier.

treyhunner, to python
@treyhunner@mastodon.social avatar

Tell me about a time that you didn't question your own assumptions as well as you would have hoped... in work or life in general.

Maybe a bug in code lead you on a wild goose chase because of an incorrect assumption.

Maybe you looked up evidence that confirmed your view and later realized you neglected to lookup opposing views.

Or anything else!

ramikrispin, to python
@ramikrispin@mstdn.social avatar

Happy Friday! ☀️

Scientific Python Lectures 🚀

Here is a short e-book with a sequence of tutorials on the scientific Python ecosystem for beginners. This includes topics such as:
✅ Working with numerical data using NumPy
✅ Data visualization with Matplotlib
✅ Scientific computing with SciPy
✅ Statistics with Python
✅ Machine learning with scikit-learn

https://lectures.scientific-python.org

Thanks to the tutorial contributors!

image/png
image/png

amcasari, to python
@amcasari@hachyderm.io avatar

You can spell it out how you want, but in my heart and brain I will always hear "oh-PY-oh"

Speaking of - @pyohio has extended their CFP!!! Go go go go go friends!

pyohio, to python
@pyohio@fosstodon.org avatar

🚨 🚨 🚨 We're approaching the Final Call for Proposals for 2024!!! 🚨 🚨 🚨

This Sunday, Anywhere on Earth (AoE) Will be your last chance to submit a talk for our awesome conference!

If you had fun at and want to keep hanging out with the Community, or have something you want to share with the rest of us, please submit a talk! We love first time speakers!

Find out more here:
https://www.pyohio.org/2024/speaking/cfp/

treyhunner, to python
@treyhunner@mastodon.social avatar

This is the first year that after the sprints, I find myself scanning the recent issues and pull requests on CPython's repository to watch the improvements happen on a Python feature in real-time. ⏳

I was planning to wait until the next beta to re-install Python 3.13, but I had to try it out again yesterday after seeing some fixes land. 💗

I'm not a core developer and I'm not usually an early adopter, but I am so excited for each new improvement in the new Python REPL. 🎉

pyOpenSci, to opensource
@pyOpenSci@fosstodon.org avatar

📣 pyOpenSci is looking for volunteers!

We’re receiving a record number of packages as part of our Open Peer Review process, and need to grow our Editorial Board. Volunteer Editors:

🔍 find reviewers
👷 oversee the review process
💜 support submitters
✅ determine package acceptance

We’re accepting applications from all scientific disciplines, with an immediate need for editors with a background in climatology and/or energy!

paulox, to python
@paulox@fosstodon.org avatar

At the end of the second day of PyCon Italia 2024, the lighting talks are underway ⚡

Valerio and Alessia are putting the speakers in difficulty with some pizza-based difficulties 🍕

CC @leriomaggio @pycon

Luca spinning the wheel
Peter presenting his talk with goggles
Rygel presenting his lightning talk

NorthBayPython, to python
@NorthBayPython@social.northbaypython.org avatar

It's a great week to buy your ticket to #NBPy 2024, Northern California's most one-track #Python conference:

  • 17 talks from Pythonistas from around California and the world (https://2024.northbaypython.org)
  • Outdoors in glorious California weather, in a very well-ventilated venue (a relaxed, data-informed hybrid masking policy compared with last year)
  • Beautiful scenery, friendly barn cats
  • Confirmed quite decent food

Convinced? See you there! Tickets at https://pretix.northbaypython.org/nbpy/nbpy-2024/

peterdrake, to python
@peterdrake@qoto.org avatar

Multiple assignment swapping is handy when implementing sorting algorithms (for teaching purposes) in :

a[i], a[i - 1] = a[i - 1], a[i]

pyOpenSci, to opensource
@pyOpenSci@fosstodon.org avatar

python -m pip install sciform

You can wrestle with scientific-formatting yourself, or you can use the sciform package from Justin Gerber!

sciform is used to convert python numbers into strings according to a variety of user-selected scientific formatting options including decimal, binary, fixed-point, scientific and engineering formats, using documented standards wherever possible!

📄 documentation: https://sciform.readthedocs.io/en/stable/

asx, to python
@asx@hachyderm.io avatar

Reminder that @pyohio CFP closes this Sunday May 26, 2024 AoE. If you have a proposal that you have in your drafts (in your brain or in writing) now is the time. Details: https://www.pyohio.org/2024/speaking/cfp/
Lets go!! :python_logo:

box464, to python
@box464@mastodon.social avatar

A free intro to python webinar for kids this weekend!

https://guruface.com/webinar/python-coding-classes-for-kids/416

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • cubers
  • DreamBathrooms
  • InstantRegret
  • tacticalgear
  • magazineikmin
  • Youngstown
  • thenastyranch
  • mdbf
  • slotface
  • rosin
  • modclub
  • kavyap
  • ethstaker
  • provamag3
  • osvaldo12
  • khanakhh
  • cisconetworking
  • Durango
  • everett
  • ngwrru68w68
  • Leos
  • normalnudes
  • GTA5RPClips
  • tester
  • megavids
  • anitta
  • lostlight
  • All magazines