MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _render_fresh

Function _render_fresh

SLiCAP/schematic/latex_label.py:254–268  ·  view source on GitHub ↗
(expr_str: str)

Source from the content-addressed store, hash-verified

252
253
254def _render_fresh(expr_str: str) -> bytes | None:
255 if not LATEX_AVAILABLE or not _ensure_slicap():
256 return None
257 if _is_placeholder(expr_str):
258 return None # unset "?" reminder — not an expression
259 try:
260 sympy_obj = _slicap_check(expr_str)
261 if sympy_obj is None:
262 return None
263 latex_str = _slicap_latex(sympy_obj)
264 if not latex_str:
265 return None
266 except Exception:
267 return None
268 return _latex_to_svg(latex_str)
269
270
271def _render_latex_str(latex_str: str) -> bytes | None:

Callers 1

_render_cachedFunction · 0.85

Calls 3

_ensure_slicapFunction · 0.85
_is_placeholderFunction · 0.85
_latex_to_svgFunction · 0.85

Tested by

no test coverage detected