Skip to content

[MRG] Reject complex input in soft-DTW barycenters - #720

Open
mameikagou wants to merge 2 commits into
tslearn-team:mainfrom
mameikagou:bugfix/reject-complex-softdtw
Open

[MRG] Reject complex input in soft-DTW barycenters#720
mameikagou wants to merge 2 commits into
tslearn-team:mainfrom
mameikagou:bugfix/reject-complex-softdtw

Conversation

@mameikagou

@mameikagou mameikagou commented Aug 27, 2026

Copy link
Copy Markdown

Fixes #167.

softdtw_barycenter can discard imaginary values during conversion and return a real-only result. Reject unsupported complex datasets and initial barycenters before conversion or optimization, including complex dtypes whose imaginary part is zero. Real-valued ragged inputs remain supported.

Validation: 21 barycenter tests pass, including NumPy object/ragged arrays and Torch complex and real inputs. The complex object-array regression fails on the base revision. git diff --check passes.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.33%. Comparing base (73ff407) to head (edb95fd).

Files with missing lines Patch % Lines
tslearn/barycenters/softdtw.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
- Coverage   95.26%   94.33%   -0.93%     
==========================================
  Files          83       83              
  Lines        7916     7976      +60     
==========================================
- Hits         7541     7524      -17     
- Misses        375      452      +77     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mameikagou

Copy link
Copy Markdown
Author

All 24 Azure checks pass on edb95fd, and the patch coverage check passes at 98.33%.

The coverage job log reports a UCR/UEA dataset initialization error (_list_univariate_filename is missing); the dataset fixture then skips dependent tests. Comparing the final coverage tables with build 2164, 76 of the 77 additional uncovered lines are in unchanged dataset/test/utility files. The remaining line is the new fallback in softdtw.py.

No coverage thresholds or unrelated code were changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

softdtw_barycenter discards imaginary part

1 participant