Repository navigation
Test XYTS endianness, proc-local files and date-line domains - #404
Merged
Merged
Conversation
Brings `qcore/xyts.py` from 96% to 100% line coverage. The new tests build small synthetic XYTS files in `tmp_path` (`_write_xyts` helper), so they don't depend on the 45 MB sample file. What the new tests check: - **Endianness detection** (`test_endianness_detected`): the same data is written once little-endian and once big-endian. Both files must give the same header values, data, `ll_map`, magnitude timeslice and PGV map. - **Process-local files** (`test_proc_local_file`): with `proc_local_file=True`, the code reads the extra `local_nx/ny/nz` header fields. The data section starts at offset 72 and has shape `(nt, 3, local_ny, local_nx)`. `ll_map` still covers the global `nx × ny` domain. - **Missing local dimensions** (`test_proc_local_file_missing_local_dims`): if a process-local header has `local_nx == 0`, the constructor raises `ValueError`. With `meta_only=True` the same file still loads. - **Antimeridian crossing** (`test_date_line_crossing`): for a domain centred on 180° longitude, `ll_map`, `corners()` and `region()` all give continuous longitudes in (179, 181) instead of wrapping to negative values. `.ai/ci-checks` passes: ruff-format, ruff, deptry, npdlint, ty and pytest (176 passed). Coverage of `qcore/xyts.py`: 95.8% → 100.0%. _Cost $0.44, 15 turns._ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
qcore/xyts.pyfrom 96% to 100% line coverage. The new tests build small synthetic XYTS files intmp_path(_write_xytshelper), so they don't depend on the 45 MB sample file.What the new tests check:
test_endianness_detected): the same data is written once little-endian and once big-endian. Both files must give the same header values, data,ll_map, magnitude timeslice and PGV map.test_proc_local_file): withproc_local_file=True, the code reads the extralocal_nx/ny/nzheader fields. The data section starts at offset 72 and has shape(nt, 3, local_ny, local_nx).ll_mapstill covers the globalnx × nydomain.test_proc_local_file_missing_local_dims): if a process-local header haslocal_nx == 0, the constructor raisesValueError. Withmeta_only=Truethe same file still loads.test_date_line_crossing): for a domain centred on 180° longitude,ll_map,corners()andregion()all give continuous longitudes in (179, 181) instead of wrapping to negative values..ai/ci-checkspasses: ruff-format, ruff, deptry, npdlint, ty and pytest (176 passed).Coverage of
qcore/xyts.py: 95.8% → 100.0%.Cost $0.44, 15 turns.
🤖 Generated with Claude Code