"""Weight-free coverage of Plus's ANS format, precision and embedded contract.""" import json import lzma from pathlib import Path import sys import tempfile import unittest import constriction import numpy as np REPO = Path(__file__).resolve().parents[2] sys.path.insert(0, str(REPO / "tools/community_models")) import convert_underdog_bark3_plus as plus class BarkPlusConversionTest(unittest.TestCase): def test_levels_preserve_values_and_column_class_order(self): codes = np.array([[0, 1, 3, 4], [2, 4, 1, 0]], np.int32) classes = np.array([0, 1, 0, 15], np.uint8) levels = np.array([[.125, .75], [.25, 1.5]], np.float16) counts = np.ones((16, 5), dtype="