@jamescooke@fosstodon.org
@jamescooke@fosstodon.org avatar

jamescooke

@jamescooke@fosstodon.org

Python developer working with data and royalties at Mixcloud.

Lover of testing and linting. User of Linux.

Author of https://github.com/jamescooke/flake8-aaa

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jacob, to random
@jacob@jacobian.org avatar

A couple of years ago, I wrote a series on estimation. But I left something out: the pre-requisite step of “breaking down” a project into constituent tasks. For me, breaking down tasks is largely intuitive — "think about the project and then write the task list" is how I might have described it. But that's a deeply unsatisfying “just draw the rest of the owl" sort of answer. So, here's a deep dive into what’s going on in my brain when I break down a project into tasks:

https://jacobian.org/2024/mar/11/breaking-down-tasks/

jamescooke,
@jamescooke@fosstodon.org avatar

@soviut Meanwhile, I’ve just finished a refactor to a solver for financial royalty contracts for work. I’ve never built anything like this before. It uses libraries like SymPy under the hood that I’ve never used before.

The refactor appeared as a requirement to a change that was suggested in a demo… I thought it would take an afternoon and it took a week. I never thought I would need this "task" 😭

jamescooke, to random
@jamescooke@fosstodon.org avatar

The compost bin never ceases to amaze me - even after six months or so of having it running.

It’s "eaten" wool, string, compostable plastic bags, loads of cardboard - on top of standard food and garden waste and, in return, gives wafts of hot air out of it when turning over the compost.

It reminds me of a reliable server that you check on occasionally - "is it still running?" Yep - with gusto. ☺️

Nigel_Purchase, to random
@Nigel_Purchase@mstdn.social avatar
jamescooke,
@jamescooke@fosstodon.org avatar

@Nigel_Purchase This was the article I read this week: https://www.bbc.co.uk/news/uk-politics-68508351 and felt equally concerned about the rhetoric.

This is a good response from Comment Is Free 😊

hamatti, to bookclub
@hamatti@mastodon.world avatar

If a book called itself a "Tiny Book of [topic]", what would you expect from the tininess? Physical size, page count, content – and where goes your limit for "tiny" in those?

I'm looking for some inspiration.

jamescooke,
@jamescooke@fosstodon.org avatar

@hamatti When I read your toot yesterday the first thing I thought of were the Very Short Introductions series. The books are small enough to fit in an inside pocket and skim the surface of the subject.

I once lent the Capitalism book to my friend and never got it back 😔. She said she lost it, probably because it’s so small 😭

https://en.m.wikipedia.org/wiki/Very_Short_Introductions

jamescooke, to random
@jamescooke@fosstodon.org avatar

Oh the feels when you find out that the code you reformatted nicely so that Black wouldn't mash it runs 20% slower 😞 (that's with 10K iterations using timeit)

jamescooke, to random
@jamescooke@fosstodon.org avatar

Feeling quite burned out - too many WTF moments with Python and work over the last couple of weeks.

Plus child[0] has their birthday party this weekend, so extra carnage is guaranteed. 😬

dazfuller, to random
@dazfuller@mstdn.social avatar

Couldn’t work out why my alarm was going off on a Saturday, and now I have to live with the disappointment

jamescooke,
@jamescooke@fosstodon.org avatar

@dazfuller how are the results going?

jamescooke, to python
@jamescooke@fosstodon.org avatar

New blog post 🎉

https://jamescooke.info/pipxs-upgrade-is-shallow-lets-go-deeper.html

Upgrading installed pipx software - BUT - also upgrading their dependencies.

jamescooke, to random
@jamescooke@fosstodon.org avatar

Am trying to debug if the clematis hasn’t flowered, or if it just hasn’t flowered yet. 🤔

jamescooke, to random
@jamescooke@fosstodon.org avatar

Am thinking I’m going to try out @glyph ‘s new Fritter project… My NHL radio recorder needs a rewrite to make it more robust and automated and I think this library will help with lots of that time / scheduling related logic.

https://github.com/glyph/Fritter

Maybe once the Penguins don’t make the playoffs, then I’ll try 😬🤔😭.

jamescooke,
@jamescooke@fosstodon.org avatar

@glyph Just over 3 weeks to go until the season is over (unless by some miracle, they make the playoffs) - and even then, I'll probably not have much time free for a bit. 👍

jamescooke,
@jamescooke@fosstodon.org avatar

@glyph Have read the docs - am mainly interested in persistence because I'd like my stream recorder worker to run every minute and to be able to say:

  • Check the NHL API again in X hours.
  • Ensure that ffmpeg runs until the current game finishes plus 30 mins. (And restart it if it's crashed)
jamescooke, to random
@jamescooke@fosstodon.org avatar

New button in the "finish review" dropdown of GitHub... For when you realise the code is beyond rescuing 😬

jamescooke,
@jamescooke@fosstodon.org avatar

Looks like they’ve removed it again… sorry I mean abandoned it. 😉

jamescooke, to random
@jamescooke@fosstodon.org avatar

The Johnny Decimal site has had an upgrade since I last looked at it, and I'm loving it.

https://johnnydecimal.com/

I love the idea of then using Johnny Decimal numbers elsewhere to make things more searchable across filesystems / devices / apps - that's a great idea 😊

jamescooke, to random
@jamescooke@fosstodon.org avatar

This is the worst home coding project I've ever done - the fact I'm trying to learn Textual as a backender is definitely playing a part.

Featuring: Spaghetti all the way down, git branches everywhere. TODO items, docstrings that don't make sense, a test suite that only covers the helpers and not the app itself.

Might have to burn it and start again 😬 🍝 🙈

flub, to random
@flub@mastodon.social avatar

I love projects that have "Other solutions" or the like in their READMEs. They care.

jamescooke,
@jamescooke@fosstodon.org avatar

@flub Also creates and or recognises the problem space that The Project and "Other solutions" occupy. I think can be a great help for encouraging shared learnings and comparison of solutions…

"The Project solves X by doing A. Other solution solves it by doing B."

jamescooke, to random
@jamescooke@fosstodon.org avatar

Found a bug in yesterday regarding how it processes blank lines when checking if there are blank lines in blocks.

https://flake8-aaa.readthedocs.io/en/stable/error_codes/AAA05-blank-line-in-block.html

If the blank line is followed by a # comment line, then Flake8-AAA doesn’t see it 🙈

While trying to check if the bug is valid, I’ve ended up yak shaving…

jamescooke,
@jamescooke@fosstodon.org avatar

@leblancfg But but but but…

  1. isn’t at version 1.0 yet. It feels like I’m not ready to drop development of it yet.
  2. I’m definitely not ready to rebuild it in Rust.

I’m still working out all the nuances of the AAA pattern - even after years of part time development. 🙏🏻

jamescooke,
@jamescooke@fosstodon.org avatar

@leblancfg NP I'm taking the "old man" strategy on Ruff and doing a "wait and see".

jamescooke,
@jamescooke@fosstodon.org avatar

Got the error captured - had to update the GitHub issue template as it was well out of date.

https://github.com/jamescooke/flake8-aaa/issues/237

jamescooke, to python
@jamescooke@fosstodon.org avatar

So Mypy didn’t save us from this test error 😔. But it seems that calling quantize() with a bool exp isn’t "wrong" in stdlib - I wish it was though.

jamescooke,
@jamescooke@fosstodon.org avatar

So it turns out the decimal(expr= ...) arg is typed by typeshed as an int or Decimal.

https://github.com/python/typeshed/blob/49b1a1a96a90946ff8885792eec30acb5cf39af0/stdlib/_decimal.pyi#L122

BUT because bool is a subclass of int, then mypy lets this pass. 😥

So the actual problem here is that bools can be passed to anything that takes an int and no-one bats an eyelid in Python. 😭

jamescooke,
@jamescooke@fosstodon.org avatar

@demiurg Oh wow - that's some good history reading. Thanks for finding that. I'm terrible for checking on and reading PEPs.

jamescooke,
@jamescooke@fosstodon.org avatar

@bignose Thanks for sharing that you don't like that subclassing 👍

After all this noodling, I'm now thinking about mitigating the risk of accidentally using a bool instead of an int - which was my initial toot with a quantize() call in an assertion. Would love to be able to ask Mypy to treat bool as its own type with a flag 🤔

jamescooke, to random
@jamescooke@fosstodon.org avatar

Although I like the idea of the "not by AI" badge (https://notbyai.fyi/), if I was building a LLM crawler, then I’d definitely ingest pages with this badge first.

H/t @pythonbytes

jamescooke,
@jamescooke@fosstodon.org avatar

@ruthpozuelo Oh no! I guess Jupyter notebook rendering is one of those features that provides vendor lock in. 😬

Have you checked out if Binder would provide a good render? You might be able to put the repo on Codeberg, but use Binder for render.

https://mybinder.org/

jamescooke,
@jamescooke@fosstodon.org avatar

@ruthpozuelo Also, just spotted this - under the hood in Gitea, renderers can be specified. Here are the docs: https://docs.gitea.com/next/administration/external-renderers#appini-file-configuration

Don't think this will be coming for Codeberg any time soon, and it's a long shot, but you might have some energy for a hosted Forgejo / Gitea instance.

This means, I think, that I can get my home instance to render notebooks - which I had no idea about.

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