Skip to content

Test XYTS endianness, proc-local files and date-line domains - #404

Merged
lispandfound merged 1 commit into
masterfrom
ai/coverage
Oct 13, 2026
Merged

lispandfound merged 1 commit into
masterfrom
ai/coverage

Conversation

@ucgmsim

@ucgmsim ucgmsim Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

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

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>
@ucgmsim ucgmsim Bot added ai-generated Opened by the scheduled Claude jobs ai-tests Bot-written tests (coverage or mutation) that need review labels Oct 13, 2026
@ucgmsim
ucgmsim Bot requested a review from lispandfound October 13, 2026 12:02
@lispandfound
lispandfound merged commit 8c6d2e0 into master Oct 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Opened by the scheduled Claude jobs ai-tests Bot-written tests (coverage or mutation) that need review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant