From f2951f3f7876578788adb4410e488bb0e51139cc Mon Sep 17 00:00:00 2001 From: Jake Poznanski Date: Mon, 17 Mar 2025 08:47:57 -0700 Subject: [PATCH] Lints --- olmocr/bench/katex/render.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/olmocr/bench/katex/render.py b/olmocr/bench/katex/render.py index 0621643..c259654 100644 --- a/olmocr/bench/katex/render.py +++ b/olmocr/bench/katex/render.py @@ -16,7 +16,6 @@ import json import os import pathlib import re -import shutil import sqlite3 import threading import unittest @@ -28,6 +27,7 @@ from playwright.sync_api import sync_playwright # --- New SQLite Cache Implementation --- + class EquationCache: def __init__(self, db_path: Optional[str] = None): if db_path is None: @@ -44,14 +44,16 @@ class EquationCache: conn = sqlite3.connect(self.db_path) c = conn.cursor() # Added an 'error' column to store rendering errors - c.execute(''' + c.execute( + """ CREATE TABLE IF NOT EXISTS equations ( eq_hash TEXT PRIMARY KEY, mathml TEXT, spans TEXT, error TEXT ) - ''') + """ + ) conn.commit() conn.close() @@ -126,6 +128,7 @@ equation_cache = EquationCache() # Thread-local storage for Playwright and browser instances _thread_local = threading.local() + @dataclass class BoundingBox: x: float