Fix frequency checks in cdds.qc
- Dominant language
- Python
- Stars
- 8
- Forks
- 7
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 23
Description
This issue arose during CP4a processing.
Contiguity checks in QC use frequency attribute to determine the expected values of time points in time axis. This generally works, but if the real frequency is higher than the one implied by the attribute (e.g. 6hrPt instead of 1hrPt), `contiguity_check` will fail with an `IndexError` here
```python
self.add_message(key, var_key, self._test_datetime_sequence(
point_sequence[reference_index], val, 'Time axis value '))
```
because it will run out of points in the reference sequence (`reference_index` is incremented by one in the loop, so it depends on the real length of the time coord, while the `point_sequence` is calculated from bounds and assumed frequency).
There should be a consistency check (maybe just `len(point_sequence)` vs `len(time_axis))` to make sure the former isn’t shorter than the latter.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the cdds.qc implementation at contiguity_check and the _test_datetime_sequence call shown in the issue. Reproduce the CP4a frequency mismatch, then inspect how point_sequence and the time-axis length are derived. Done means inconsistent lengths are handled without an IndexError and the contiguity check reports the appropriate result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100