Wasim Lorgat Profile picture
Sep 19 5 tweets 5 min read
Notebooks are an incredibly powerful and flexible medium... which can be overwhelming

Here's everything we know about writing great notebooks after years of working with #nbdev
nbdev.fast.ai/tutorials/best…
1. Use @ProjectJupyter's rich display features to supercharge your users

Pictured below:
@RDKit_org molecule
@fastdotai learning rate finder
• Mermaid @Graphviz diagram via @quarto_pub
• `Color` - a full example to get you started! Code: # With atom index mol_with_atom_index(mol)  Output: DiReads: We used the default learning rate before, but we mighDiagram of nbdev's processing pipelineReads:  class Color:     def __init__(self, color): self.col
2. Use lots of code examples

...and convert some of them to tests using assertions

@fastdotai's vision augmentation notebook is a great example that also uses rich display features
docs.fast.ai/vision.augment… Puppy image with six different image augmentations applied
3. Know which form of notebook you're writing

We're fans of @divio's "Grand Unified Theory of Documentation" - find what works for you
documentation.divio.com A 2x2 matrix, from top-left to bottom-right: Tutorials (lear
These are only 3 of many more best practices detailed in the doc. We also include a full example that converts a @numpy_team docstring to a notebook-friendly format following these practices

Read the full doc for more
nbdev.fast.ai/tutorials/best…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Wasim Lorgat

Wasim Lorgat Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @wasimlorgat

Sep 27, 2020
Last time, we took our first step in building a simple text editor: gathering references to understand how the problem might be decomposed. Let's dig into them!

Finseth's The Craft of Text Editing is an excellent source for this! They suggest to decompose an editor into three sub-systems:

1. The sub-editor
2. User-oriented commands
3. Redisplay
1. You can think of the sub-editor as a bare minimum text editor. Its most important component is the buffer, which stores text in a way that enables efficient reading and editing. This isn't as straightforward a problem as it seems, but we'll get to that later
Read 13 tweets
Sep 26, 2020
Ookay, let's make a simple terminal-based Roam clone that _is_ an outliner. I could fork and extend an existing outliner, but it's way more interesting to start from scratch
Step 1 is to do some reading... What's so special about outliners? I think they're strict supersets of text editors – if you used an outliner but only wrote in a single node, it'd effectively be a text editor

So let's take a step back. How do text editors work?
Let's start with the user. What does the user want to do?

1. Of course, to view text within a window. The distinction between text and window is important because the text may be longer than the window.
Read 11 tweets
Sep 18, 2020
I think the Gang of Four Design Patterns book is respectable. I wouldn't expect anyone to study it end-to-end though... I see it more as proof of work about the concept of design patterns
I do think it's lacking concrete real-world examples and it's a bit too abstract for me, which means it doesn't age well. There isn't much guidance, lots left to the reader. If I were in a room with the GoF, the book would only cover 1% of what I'd try to learn from them
These days I'd recommend the following instead (I primarily work in python so these are mostly Python related, for now):
Read 6 tweets
Jun 13, 2020
What are other terms for "metagames"? terms that might be more useful to search for relevant literature
can anyone recommend material on metagames? or related
“One might call what I was looking for ‘a metacookbook’—a book not about a certain cuisine or style of cooking, but about cooking itself—and I found good ones to be surprisingly rare”

https://t.co/JqZ4APszgS
Read 4 tweets
Jun 6, 2020
I _love_ the use of "residue" here! dude's really good at naming

"[...] a house is the residue of the interactions between the
members of a family, their emotions and their belongings; and a freeway is the residue of movement and commercial exchange." Image
"receptacle" is another brilliant name. It was used earlier, and tbh I found it odd then, but it really is a great fit

"[...] the real systems, whose existence actually
makes the city live, have been provided with no physical receptacle."
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(