text stringlengths 0 252 |
|---|
============================= test session starts ============================== |
platform linux -- Python 3.12.11, pytest-8.4.1, pluggy-1.6.0 -- /usr/local/bin/python3 |
rootdir: /verifier |
collecting ... collected 6 items |
test_outputs.py::test_isolated_runner_uses_read_only_staging_and_drops_privileges PASSED [ 16%] |
test_outputs.py::test_nominal_artifacts_solver_and_declared_schema FAILED [ 33%] |
test_outputs.py::test_nominal_fields_and_fourier_spectra_match_independent_recomputation PASSED [ 50%] |
test_outputs.py::test_nominal_plane_wave_table_and_residual_summary_are_correct FAILED [ 66%] |
test_outputs.py::test_nominal_components_obey_normalization_formula_and_fft_conventions PASSED [ 83%] |
test_outputs.py::test_submitted_solver_generalizes_to_hidden_crop_and_alternate_configuration FAILED [100%] |
=================================== FAILURES =================================== |
______________ test_nominal_artifacts_solver_and_declared_schema _______________ |
def test_nominal_artifacts_solver_and_declared_schema() -> None: |
require_regular_file(SOLVER, "reusable /root/analyze_stm.py") |
> assert_bundle_schema(nominal_bundle()) |
test_outputs.py:884: |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
bundle = Bundle(output_directory=PosixPath('/root'), configuration_path=PosixPath('/root/data/reconstruction_config.json'), con...'kx_inv_angstrom': 0.014776646639964398, 'ky_inv_angstrom': 0.09267977920125965, 'magnitude': 0.010486474055700832}]}}) |
def assert_bundle_schema(bundle: Bundle) -> None: |
outputs = bundle.configuration["outputs"] |
expected_keys = set(outputs["npz_keys"]) |
assert set(bundle.arrays) == expected_keys |
shape = tuple(int(value) for value in bundle.configuration["map"]["shape_yx"]) |
y_count, x_count = shape |
assert bundle.arrays["x_angstrom"].shape == (x_count,) |
assert bundle.arrays["y_angstrom"].shape == (y_count,) |
assert bundle.arrays["fft_kx_inv_angstrom"].shape == (x_count,) |
assert bundle.arrays["fft_ky_inv_angstrom"].shape == (y_count,) |
assert bundle.arrays["moire_reciprocal_basis_inv_angstrom"].shape == ( |
2, |
2, |
) |
assert bundle.arrays["moire_real_basis_angstrom"].shape == (2, 2) |
for key in MAP_KEYS: |
assert ( |
bundle.arrays[key].shape == shape |
), f"{key} shape is {bundle.arrays[key].shape}" |
for key, values in bundle.arrays.items(): |
assert values.dtype.kind in {"f", "i", "u"} |
assert np.isfinite(values).all(), f"{key} contains nonfinite values" |
assert set(bundle.summary) == SUMMARY_KEYS |
assert bundle.summary["schema_version"] == outputs["summary_schema_version"] |
assert bundle.summary["input_shape_yx"] == list(shape) |
assert set(bundle.summary["moire_supercell"]) == set( |
outputs["summary_contract"]["moire_supercell_fields"] |
) |
counts = bundle.summary["plane_wave_counts"] |
> assert set(counts) == {"layer_a", "layer_b", "moire"} |
E AssertionError: assert {'layer_a', 'layer_b'} == {'layer_a', '...r_b', 'moire'} |
E |
E Extra items in the right set: |
E 'moire' |
E |
E Full diff: |
E { |
E 'layer_a',... |
E |
E ...Full output truncated (3 lines hidden), use '-vv' to show |
test_outputs.py:235: AssertionError |
________ test_nominal_plane_wave_table_and_residual_summary_are_correct ________ |
def test_nominal_plane_wave_table_and_residual_summary_are_correct() -> None: |
bundle = nominal_bundle() |
reference = nominal_reference() |
> assert_record_agreement( |
bundle.records, |
reference.records, |
tuple(bundle.configuration["outputs"]["csv_key_columns"]), |
) |
test_outputs.py:894: |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
actual = ({'amplitude_before_normalization': 0.19212149027787226, 'amplitude_normalized': 0.17511195687748599, 'component': 'la...amplitude_normalized': 0.25509299017573656, 'component': 'layer_b', 'kx_inv_angstrom': -0.20365547074114232, ...}, ...) |
expected = ({'amplitude_before_normalization': 0.19212149029545478, 'amplitude_normalized': 0.17511195262056442, 'component': 'la...amplitude_normalized': 0.25509298298627137, 'component': 'layer_b', 'kx_inv_angstrom': -0.20365547070845982, ...}, ...) |
key_columns = ('component', 'm', 'n', 'p', 'q') |
def assert_record_agreement( |
actual: tuple[dict[str, object], ...], |
expected: tuple[dict[str, object], ...], |
key_columns: tuple[str, ...], |
) -> None: |
assert len(actual) == len(expected) |
actual_by_key = records_by_physical_key(actual, key_columns, "submitted CSV") |
expected_by_key = records_by_physical_key( |
expected, |
key_columns, |
"reference CSV", |
) |
> assert set(actual_by_key) == set(expected_by_key), "CSV physical-key set differs from the independent reconstruction" |
E AssertionError: CSV physical-key set differs from the independent reconstruction |
E assert {('layer_a', ..., 0, -1), ...} == {('layer_a', ... '', ''), ...} |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 343