Toots for pamelafox@fosstodon.org account

Written by Pamela Fox on 2025-01-13 at 22:24

The latest mypy release includes performance improvements, yay! https://github.com/python/mypy/blob/master/CHANGELOG.md

=> More informations about this toot | View the thread

Written by Pamela Fox on 2025-01-07 at 22:58

I've started reading Sebastian Raschka's "Build a Large Language Model (From Scratch)" and I'm loving it. Great descriptions, newbie-friendly math, and lots of Python.

https://amzn.to/3DLBDmk

=> More informations about this toot | View the thread

Written by Pamela Fox on 2025-01-07 at 18:44

I'm running GitHub actions on Python 3.13 now, and seeing really slow install times from uv.

Not sure if it's a fluke from this run, or something to do with 3.13?

15 minutes and counting...

https://github.com/Azure-Samples/azure-search-openai-demo/actions/runs/12657091764/job/35271122592?pr=2238

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-18 at 00:28

New blog post: how to add speech input and output to your app, using the built-in browser speech APIs and custom HTML elements:

https://blog.pamelafox.org/2024/12/add-browser-speech-inputoutput-to-your.html

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-11 at 20:58

Check out https://github.com/tweag/FawltyDeps to identify unused imports and undeclared imports in your Python projects.

=> View attached media

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-11 at 17:31

Is there something like a dead-import detector for Python? I just realized we have a package in our requirements that never gets imported anymore, which I didn't notice for months.

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-11 at 00:18

I'm confused about the Pycon CFP for tutorials: the webpage says descriptions should be 300 chars, whereas pretalks says 300 words. Anyone know which one it is? words and chars are pretty different.

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-10 at 20:08

I've now made custom HTMLElement's for both speech input and output, using the built-in free browser SDKs.

Updated PR @ https://github.com/Azure-Samples/openai-chat-vision-quickstart/pull/30

=> View attached media

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-10 at 19:10

I prettied up the speech input with a CSS animation, inspired by the speech input button for GitHub Copilot chat, and I think it's looking real cute! Do GIFs work here?

=> View attached media

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-10 at 17:30

And if you want to try out the speech input, there's a test deployment here: https://pf-vision-t5hmp6ocr-ca.happyground-ae776626.westus.azurecontainerapps.io/

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-10 at 17:30

I'm adding speech input to my LLM chat samples to improve accessibility, and am using a custom HTMLElement. I'm really not liking how the shadow dom means I have to re-embed Bootstrap CSS, should I just not use shadow dom?

https://github.com/Azure-Samples/openai-chat-vision-quickstart/pull/30/files

=> View attached media

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 23:03

I'm curious what style mocks y'all prefer! should i be magic mocking more??

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 23:03

So I eventually modified most tests to "my style" with monkeypatch.setattr whenever possible.

I'm still grateful for Copilot's help since:

  1. I've now learnt more about how to use MagicMock, for when I need it

  1. sometimes it's less intimidating to edit an existing failed test than to write a brand new one

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 23:02

I had a lot of tricky tests to write today that needed mocks against an async SDK.

To get started, I tried out GitHub Copilot "generate tests".

Observations:

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 22:52

TIL: tuple[float] isn't the way to convey a tuple of floats, because tuples commonly contain different types. instead you must do tuple[float,float,float] for 3 floats or tuple[float,...] for any length

https://docs.python.org/3/library/typing.html#annotating-tuples

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 19:39

Sometimes I'm writing a unit test against an SDK and think, "oh no, I am the first person in the history of humanity to have ever mocked this class. what if it's impossible"

and then I think

"do it for humanity, pamela!!"

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 00:58

its far easier to add tests for a new feature when the existing code has coverage!

write tests from the start!

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-06 at 00:38

i always cringe when I find myself reaching for "nonlocal" in python. it looks gross, it feels gross, but it works, sooo... :-/

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-12-04 at 02:25

My 5-yr-old apparently believes in Santa again, despite us telling her the truth last year.

She also says "we should vote for a new santa!!" and "mommy, can girls be santas?"

I told her it was a great idea and I'd run for next Santa, but then she said it'd be boring watching me make gifts. :(

=> More informations about this toot | View the thread

Written by Pamela Fox on 2024-11-27 at 18:27

I love being able to test against local emulators instead of prod accounts, so I made a dev container for Azurite (local Azure Blob storage):

https://github.com/pamelafox/azurite-python-playground

And here's a blog post about how it works:

https://blog.pamelafox.org/2024/11/running-azurite-inside-dev-container.html

=> More informations about this toot | View the thread

=> This profile with reblog | Go to pamelafox@fosstodon.org account

Proxy Information
Original URL
gemini://mastogem.picasoft.net/profile/109288236134478383
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
341.486416 milliseconds
Gemini-to-HTML Time
6.368074 milliseconds

This content has been proxied by September (ba2dc).