From d4feca1f2643b4c6d465c039199a251657ba7741 Mon Sep 17 00:00:00 2001 From: zachary62 Date: Sun, 29 Dec 2024 04:16:19 +0000 Subject: [PATCH] fix python --- docs/batch.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/batch.md b/docs/batch.md index feb1ded..e4bda95 100644 --- a/docs/batch.md +++ b/docs/batch.md @@ -23,7 +23,7 @@ A **BatchNode** extends `Node` but changes `prep()` and `exec()`: ### Example: Summarize a Large File -``python +```python class MapSummaries(BatchNode): def prep(self, shared): # Suppose we have a big file; chunk it @@ -45,7 +45,7 @@ class MapSummaries(BatchNode): map_summaries = MapSummaries() flow = Flow(start=map_summaries) flow.run(shared) -``python +```python --- @@ -56,7 +56,7 @@ A **BatchFlow** runs a **Flow** multiple times, each time with different `params ### Example: Summarize Many Files -``python +```python class SummarizeAllFiles(BatchFlow): def prep(self, shared): # Return a list of param dicts (one per file) @@ -69,7 +69,7 @@ summarize_file = SummarizeFile(start=load_file) # Wrap that flow into a BatchFlow: summarize_all_files = SummarizeAllFiles(start=summarize_file) summarize_all_files.run(shared) -``python +```python **Under the Hood**: 1. `prep(shared)` returns a list of param dicts—e.g., `[{filename: "file1.txt"}, {filename: "file2.txt"}, ...]`.