Documentation review and data consistency.
Some checks failed
build_docker / essential (push) Successful in 0s
build_docker / build_paddle_ocr (push) Successful in 4m57s
build_docker / build_raytune (push) Has been cancelled
build_docker / build_easyocr_gpu (push) Has been cancelled
build_docker / build_doctr (push) Has been cancelled
build_docker / build_doctr_gpu (push) Has been cancelled
build_docker / build_paddle_ocr_gpu (push) Has been cancelled
build_docker / build_easyocr (push) Has been cancelled

This commit is contained in:
2026-01-24 15:53:34 +01:00
parent 9ee2490097
commit 0089b34cb3
48 changed files with 1030 additions and 930 deletions

View File

@@ -12,7 +12,8 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DOCS_DIR = os.path.join(BASE_DIR, 'docs')
OUTPUT_DIR = os.path.join(BASE_DIR, 'thesis_output/figures')
MMDC = os.path.join(BASE_DIR, 'node_modules/.bin/mmdc')
CONFIG_FILE = os.path.join(BASE_DIR, 'mermaid.config.json')
CONFIG_FILE = os.path.join(BASE_DIR, 'mermaid.config.json')
PUPPETEER_CONFIG = os.path.join(BASE_DIR, 'tem/scripts/puppeteer_config.json')
# Light blue color for bar charts
BAR_COLOR = '#0098CD'
@@ -82,12 +83,15 @@ def convert_to_png(diagrams):
# For bar charts: generate SVG, fix colors, convert to PNG
svg_file = os.path.join(OUTPUT_DIR, f'temp_{diagram["index"]}.svg')
result = subprocess.run(
[MMDC, '-i', temp_file, '-o', svg_file, '-b', 'white', '-w', '1600', '-c', CONFIG_FILE],
capture_output=True,
text=True,
timeout=60
)
cmd = [MMDC, '-i', temp_file, '-o', svg_file, '-b', 'white', '-w', '1600', '-c', CONFIG_FILE]
if os.path.exists(PUPPETEER_CONFIG):
cmd += ['--puppeteerConfigFile', PUPPETEER_CONFIG]
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=60
)
if os.path.exists(svg_file):
# Read SVG and replace bar color
@@ -110,12 +114,15 @@ def convert_to_png(diagrams):
os.remove(svg_file)
else:
# For other diagrams: direct PNG generation
result = subprocess.run(
[MMDC, '-i', temp_file, '-o', output_file, '-b', 'white', '-w', '1600', '-s', '3', '-c', CONFIG_FILE],
capture_output=True,
text=True,
timeout=60
)
cmd = [MMDC, '-i', temp_file, '-o', output_file, '-b', 'white', '-w', '1600', '-s', '3', '-c', CONFIG_FILE]
if os.path.exists(PUPPETEER_CONFIG):
cmd += ['--puppeteerConfigFile', PUPPETEER_CONFIG]
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=60
)
if os.path.exists(output_file):
print(f"✓ Generated: figura_{diagram['index']}.png - {diagram['title']}")