Files
cs249r_book/mlsysim/tests/test_datasets.py
Vijay Janapa Reddi 92f9165d03 fix(book): harden LEGO formatting across volumes
Add native Binder checks for LEGO formatting/unit/prose contracts, extend mlsysim formatter helpers, and normalize Vol1/Vol2 LEGO output strings through typed formatters.

Validate precision-sensitive prose rendering across both volumes and promote direct math/string assembly to fmt_math, fmt_display_math, fmt_text, and domain-specific helpers.
2026-06-11 14:36:35 -04:00

13 lines
392 B
Python

import pytest
from mlsysim import Datasets
from mlsysim.core.units import byte, second
def test_mswc_audio_encoding_is_registry_backed():
mswc = Datasets.MSWC
assert mswc.sample_duration.to(second).magnitude == pytest.approx(1.0)
assert mswc.sample_rate.to(1 / second).magnitude == pytest.approx(16_000.0)
assert mswc.sample_width.to(byte).magnitude == pytest.approx(2.0)