Coverage for skema/data/eq2mml/__init__.py: 0%

10 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-30 17:15 +0000

1from typing import Text 

2from pathlib import Path 

3import base64 

4 

5# NOTE: generate additional images with https://latex2png.com/ 

6 

7def _img2b64(img_name: Text) -> bytes: 

8 p = Path(__file__).parent / "images" / img_name 

9 with p.open("rb") as infile: 

10 img_bytes = infile.read() 

11 return base64.b64encode(img_bytes).decode("utf-8") 

12 

13img_b64_bayes_transparent = _img2b64("bayes-rule-transparent.png") 

14img_b64_bayes_white_bg = _img2b64("bayes-rule-white-bg.png")