• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TUW-GEO / ascat / 28500847048

01 Jul 2026 07:17AM UTC coverage: 46.92% (+0.6%) from 46.278%
28500847048

push

github

sebhahn
Refactor and harden ascat.cf_array; add unit tests

Fix latent bugs, clean up the CF discrete-geometry array classes, and
complete the conversion matrix, all covered by a new test module.

Bug fixes:
- Fix CFDiscreteGeom.array_type base property (defined without self, so it
  raised TypeError instead of NotImplementedError).
- Resolve the sample dimension for OrthoMultiTimeseriesArray and cache the
  array type (set_sample_dimension previously operated on None).
- Raise a clear ValueError from RaggedArray.to_indexed_ragged/
  to_contiguous_ragged/to_point_array instead of silently returning None
  for an unsupported array type.
- point_to_indexed no longer mutates the caller's dataset (use assign).
- Use resample period "1ME" instead of the deprecated "1M" (pandas 2.2).
- Type-hint resample_method as typing.Callable, not the builtin callable.

Refactor:
- Replace the side-effecting array_type property with an explicit
  _resolve() called once from __init__; array_type is now a plain getter.
- Remove the static-method wrappers that only forwarded to the module-level
  conversion functions.
- Move the duplicated timeseries_id property to the base class.
- Centralize array-type strings as module constants (POINT, INDEXED,
  CONTIGUOUS, ORTHOMULTI_TS).
- Dispatch cf_array_class via a dict and add a CFDiscreteGeom.from_dataset
  factory classmethod.

Features:
- Add OrthoMultiTimeseriesArray.to_point_array/to_indexed_ragged/
  to_contiguous_ragged so point <-> ragged <-> orthomulti conversions are
  symmetric.

Tests:
- Add tests/test_cf_array.py covering type detection, class dispatch, all
  conversions and round-trips, non-mutation, and error handling.

81 of 84 new or added lines in 1 file covered. (96.43%)

1 existing line in 1 file now uncovered.

2704 of 5763 relevant lines covered (46.92%)

1.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.0
/src/ascat/cf_array.py


Build SHA Not Found

The commit SHA "5b87f5a47ef150e64feb6bc04d197970fd12c409" was not found in your repository, so the file cannot be loaded. This may be because you posted from a local development environment, or your CI created an ephemeral commit.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc