actually no, and we have something weird for that too:
We have code that creates one master sequence then replaces every sequence in the testdb with that master sequence, so all tables pull from the same sequence. That way you can never accidentally swap two id's in an api response and have the tests pass because you coincidentally both had id 5 or whatever. We can run the tests either way (with sequences swapped out or not). We almost always leave the master sequence in place because the id-swap bug is very common and the alternative (bug caused by two id's being the same on different tables) basically never comes up.
I concur with this approach. TRANSACTION-y tests (the default in Django) often don't quite line up with reality and make it hard to eg. drop in a breakpoint and run a server against the test's db state.
I've experimented (see below) with TEMPLATE dbs and such in Python (with inspiration from this library). IMHO the "around 100ms" mark is pretty slow for a big test suite. Interestingly, pg_restore is only twice as slow as TEMPLATEs.
Wherever you fall on that debate (I have my opinions but they are not strongly held), a bigger red flag here for me is the `pip install ...` opener. The fact they later have a `uvx ...` example in the docs just makes defaulting to pip even worse.
As that comment mentions:
> 5 years ago [...] Python packaging was a big mess.
> Today [...] I think Python's packaging story has never been stronger.
Poetry, & later Uv, are essential & invaluable milestones in that revolutionary story; Pip is terrible software & should be left in the past.
> Poetry, & later Uv, are essential & invaluable milestones in that revolutionary story; Pip is terrible software & should be left in the past.
The comparison to other programs is missing the point of why pip is terrible. For that matter, last I checked Poetry relied on either vendored pip or something very much like it to do the actual package installation.
If you like workflows dictated by all-in-one tools, go for it. Don't force it on me. Some of us still see great value in the Unix philosophy.
The real problem is that pip doesn't even do a good job of its "one thing" (the actual package installation). It barely understands caching, has insecure and confusing default behaviours stemming from nigh-unfixable legacy issues, doesn't know how to inspect the installation environment properly (therefore relying on ugly hacks to install cross-environment at all), vendors a bunch of stuff it barely uses and often doesn't really need, and is overall horribly architected.
I get you on unix philosophy (I'm not into it myself but I respect those who want that) but uv, for all its extra features, does actually do that particular "one thing" a lot better than pip.
You've summarised many of pip's internally problems well - there's also the lack of any attempt at proper manifest management. This is partially an ecosystem problem (pre-PEP518), but the tools inform the specs as much as the specs inform the tools.
I think there's also a reasonable argument to be made that uv only does one thing, & that the big problems in this space before was that python required using 3 tools to awkwardly collaborate to get one thing done. That one thing is dependency management: pip to pull them, venv to load them, pyenv to pull & load one of them (the interpreter).
pyenv is a wrapper for something that experienced pip+venv users would find trivial. If you use uv, meanwhile, that is also wrapping venv. It's integrating those tasks under one command prefix, which is the main thing I don't like.
The other thing I don't like is having tens of megs of opaque compiled binary (that doesn't provide a useful library) when properly designed Python would perform more than acceptably for common use cases (tons of this is I/O-bound; a proper cache lets you just recursively hardlink a directory tree instead of unpacking an archive file; the bytecode compilation is implemented in C and could be parallelized with `multiprocess` as long as you don't require binary-level reproducibility for Python bytecode; etc.)
Ahh - the dependency graph recipe card. These are excellent. I've imagined something like this forever. Always annoyed that recipes put ingredients in a giant undifferentiated list and then give an instruction like "mix the dry ingredients in a deep bowl".
For a while I expected there could be a good return on a good implementation of this, but now as soon as a strong interface itself is created it seems easy to copy.
I used to want this kind of recipe card, but I've cooked so much that's no longer the case (I actually forgot all about the idea until reading this comment). I can usually look at the list of ingredients, and imagine what needs to be done. If it's an unusual or unfamiliar cuisine I will read the method, but after that point the list of ingredients suffice. If I read a recipe somewhere and want to cook it later, I will just write the ingredients on a post-it (usually in cooking order) and maybe 1-2 brief comments.
I imagine in domains you are skilled at you'd also prefer high level instructions than a step-by-step tutorial.
I agree that doesn't help the beginner, or someone who doesn't cook regularly, or someone cooking something new and I think most recipe writers are just following the established structure without thinking about what they and others really need.
Feels like one might be able to get an llm to convert an annoying to read recipe into a mermaid dependency graph following this example. Might be worth a try!
FWIW though most recipes are basically ~10 steps long so a simple list suffice.
Still it could be an interesting experiment as I imagine that precisely recipes that are less sequential are (on average, with as challenging steps, e.g. excluding making caramel which has a high chance of burning) perceived as more complex.
I asked perplexity to convert a simple recipe to a dependency graph and it works pretty well! I like this graph to figure out my cooking workflow. What tasks can be started independently and what needs to be done before others.
That's a very cool site! I enjoyed the hand-drawn graphs.
Your tables remind me of recipes in Modernist Cuisine. They all have ingredients grouped by the procedures together with weight, sometimes volume, and ratio.
I love this! I bet you could make a successful recipe book based on this concept, with large schematics that a cook can read from a distance while working in the kitchen.
This is cool - I tried automating different recipe formats/visualizations at https://www.gobsmacked.io. I was thinking of trying to do something similar to this next.
I really like these. I went through a phase a couple years ago where I got really into cooking new fancy recipes, and having to scroll around on recipe pages, or try and read my own chicken scratch notes or understand the context I was trying to imply when I wrote the notes weeks ago was a struggle.
Having everything more or less right there in front of your face seems really nice.
And I don't know why, but "Beans (green)" is really tickling my funny bone.
This will perhaps be overkill for what you're trying to achieve, but there is Object Process Methodology (OPM)[1] which may be inspiration for modelling recipes. It looks similar to the methodology you're using, and as an example, expects the following type of modelling:
The advantage of OPM is alignment of graphical and textual representations.
The downside of such approach is you soon discover how many millions of objects may exist in recipes--unwashed carrot, washed carrot, orange carrot, purple carrot, yellow carrot, white carrot, peeled carrot, coarsely diced carrot, finely diced carrot, julienned carrot... and purple julienned carrot vs. yellow julienned carrot. And that's just basic preparation complexity well before any contemplation of cooking or plating up elements. To go further you then discover a lack of useful labels such as "mirepoix" or "soffrito", if for example, you wanted to substitute sweet potato in place of carrot in the recipe.
Then there is SysML 2[2] which is kind of like OPM if you ever wanted to write a recipe in 35,000 lines of code, including possibly all the complexity of mathematical modelling of the Maillard reaction for purple carrots vs. yellow carrots using either extra virgin olive oil or butter. Probably best suited for the largest food processing companies such as Nestle, Unilever, Modelez, etc and even then, inherent complexity of their food products rarely would reach the level of a fine dining dish prepared by a chef.
OPM looks like a great way to implement a free-style crafting system for a roguelike. I mean instead of having standard recipes that you have to assemble you could invent your own by putting together basic ingredients but then you need a way to know what comes out (and its effects I guess). I don't know if any existing games do that.
Also have a look at Inform 7[1] (domain specific language for interactive fiction), specifically the "Stone" example section[2] which explains edible food and the effects different foods may have on the adventurer.
It's similar concept to OPM with some modelling basics already built on top for player movement throughout a world, player interaction with objects (looking at, lifting, moving), and many other primitives needed to write interactive fiction. And relevant to this thread, Inform 7 of course has modelling basics for a player eating food, drinking potions, etc.
Thanks! I know Inform. Haven't used it but I know of it and I think I've even played a few games written with some version of it. Adventure games don't usually do what I had in mind but maybe it's possible to do just not something very relevant to the genre?
Cute! I have a lot of handwritten notes. I've been waiting for a competent "paper scan to SVG" workflow to be developed so I can digitalize them properly. I think your project would also greatly benefit from something like that
Nice ideas, it just misses amounts. And of course there may be nuances of technique missing, e.g. low or high heat. So it might work best as a recap and starting point "how to vary m favourite recipe".
a lot of the schematics have avoidable edge crossings, that could improve intuitive readability enormously, theres entire subfields of graph theory that consideres rendering of graphs and planar embeddings.
There are a few different ways to cook this up. Here's one:
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens
data Cat = Cat { _age :: Int }
deriving Show
makeLenses ''Cat
data Item
= I Int
| L [Item]
| C Cat
deriving Show
makePrisms ''Item
cat :: Cat
cat = Cat 3
l :: [Item]
l = [I 1, L [I 2, C cat], I 4]
l' :: [Item]
l' = set (ix 1 . _L . ix 1 . _C . age) 9 l
ghci> l'
[I 1,L [I 2,C (Cat {_age = 9})],I 4]
Yes, AI or no AI, tell me about something actually interesting that you're working on.
Currently it feels a bit like everyone is talking about what new editor they're using. I don't care about that type of developer tooling very much. AI isn't coming up with some exciting new database, type system, etc etc.
"Look at how I'm able to web dev x% faster" because of LLMs is boring.
reply