lsnu commited on
Commit
f148a79
·
verified ·
1 Parent(s): 3565fc8

Add files using upload-large-folder tool

Browse files
derived/Source/README.md CHANGED
@@ -13,6 +13,7 @@ Important version note:
13
  Outputs:
14
  - [sheets](/workspace/SchemID/derived/Source/sheets) contains high-resolution PNG visualization sheets with multiple rendered circuits per page.
15
  - [sheets/sheet_manifest.csv](/workspace/SchemID/derived/Source/sheets/sheet_manifest.csv) lists the generated sheet pages and the figures included in each one.
 
16
  - [circuit_generation_code](/workspace/SchemID/derived/Source/circuit_generation_code) contains the extracted EPS code used to generate circuit diagrams.
17
  - [rendered](/workspace/SchemID/derived/Source/rendered) contains regenerated PNGs and no-text PNGs.
18
  - [metadata](/workspace/SchemID/derived/Source/metadata) contains structure and verification manifests.
@@ -29,6 +30,11 @@ Sheet build command:
29
  python3 /workspace/SchemID/derived/Source/scripts/generate_visual_sheets.py
30
  ```
31
 
 
 
 
 
 
32
  Upload command:
33
  ```bash
34
  python3 /workspace/SchemID/derived/Source/scripts/build_circuit_dataset.py --repo-root /workspace/SchemID --upload
 
13
  Outputs:
14
  - [sheets](/workspace/SchemID/derived/Source/sheets) contains high-resolution PNG visualization sheets with multiple rendered circuits per page.
15
  - [sheets/sheet_manifest.csv](/workspace/SchemID/derived/Source/sheets/sheet_manifest.csv) lists the generated sheet pages and the figures included in each one.
16
+ - [sheets/all_visualization_sheets.pdf](/workspace/SchemID/derived/Source/sheets/all_visualization_sheets.pdf) is the full combined PDF of all sheet pages.
17
  - [circuit_generation_code](/workspace/SchemID/derived/Source/circuit_generation_code) contains the extracted EPS code used to generate circuit diagrams.
18
  - [rendered](/workspace/SchemID/derived/Source/rendered) contains regenerated PNGs and no-text PNGs.
19
  - [metadata](/workspace/SchemID/derived/Source/metadata) contains structure and verification manifests.
 
30
  python3 /workspace/SchemID/derived/Source/scripts/generate_visual_sheets.py
31
  ```
32
 
33
+ Combined PDF command:
34
+ ```bash
35
+ python3 /workspace/SchemID/derived/Source/scripts/build_sheet_pdf.py
36
+ ```
37
+
38
  Upload command:
39
  ```bash
40
  python3 /workspace/SchemID/derived/Source/scripts/build_circuit_dataset.py --repo-root /workspace/SchemID --upload
derived/Source/scripts/build_sheet_pdf.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+
3
+ from __future__ import annotations
4
+
5
+ import csv
6
+ from pathlib import Path
7
+
8
+ import img2pdf
9
+
10
+
11
+ SOURCE_ROOT = Path("/workspace/SchemID/derived/Source")
12
+ SHEETS_ROOT = SOURCE_ROOT / "sheets"
13
+ MANIFEST_PATH = SHEETS_ROOT / "sheet_manifest.csv"
14
+ OUTPUT_PDF = SHEETS_ROOT / "all_visualization_sheets.pdf"
15
+ FIXED_DPI = (300, 300)
16
+
17
+
18
+ def main() -> None:
19
+ image_paths: list[str] = []
20
+ with MANIFEST_PATH.open(newline="") as handle:
21
+ reader = csv.DictReader(handle)
22
+ for row in reader:
23
+ image_path = SHEETS_ROOT / row["sheet_png"]
24
+ image_paths.append(str(image_path))
25
+
26
+ layout_fun = img2pdf.get_fixed_dpi_layout_fun(FIXED_DPI)
27
+ with OUTPUT_PDF.open("wb") as handle:
28
+ handle.write(img2pdf.convert(image_paths, layout_fun=layout_fun))
29
+
30
+
31
+ if __name__ == "__main__":
32
+ main()