Skip to content

[MRG] Support a separate output grid in the LP barycenter - #931

Open
bingdongni wants to merge 4 commits into
PythonOT:masterfrom
bingdongni:feature/fixed-barycenter-grid
Open

bingdongni wants to merge 4 commits into
PythonOT:masterfrom
bingdongni:feature/fixed-barycenter-grid

Conversation

@bingdongni

@bingdongni bingdongni commented Nov 19, 2026 •

Copy link
Copy Markdown

Motivation

A histogram on a fine measurement grid may need a barycenter on a much smaller reporting grid. ot.lp.barycenter currently uses the input bin count for both marginals. This accepts a rectangular cost matrix whose columns define the output support. The weights and the selected solver retain their existing meaning.

Changes and tests

The LP now has one transport variable per input/output bin pair and one barycenter variable per output bin. Both the SciPy and CVXOPT paths use these dimensions. A gallery example maps 40 input bins to eight reporting bins.

Linux tests cover single-bin, finer and coarser output grids on HiGHS IPM, HiGHS dual simplex, and CVXOPT. A separate check compared the objective against a one-dimensional search over two-bin barycenters, evaluating each candidate with network-simplex EMD. The GitHub run builds this branch from source with its pinned Eigen dependency and runs the gallery example. The user guide, function reference, and release notes are updated.

A full documentation build at 8108ebf ran all 88 gallery examples and verified the rendered guide link, example page, and figure.

The Linux lint job passed on 9f7ba60 with the project's pre-commit configuration.

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.10%. Comparing base (367355d) to head (4a2183b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #931   +/-   ##
=======================================
  Coverage   97.09%   97.10%           
=======================================
  Files         130      130           
  Lines       27229    27251   +22     
=======================================
+ Hits        26437    26461   +24     
+ Misses        792      790    -2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants