Coverage for src/cvxball/__init__.py: 100%
5 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-09-07 19:33 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-09-07 19:33 +0000
1"""Core package for minimum enclosing ball utilities and solvers.
3Exposes the version and both solvers, so the whole public surface is reachable as
4``from cvxball import min_circle_active_set, min_circle_fgk``. The submodule paths
5``cvxball.solver`` and ``cvxball.fischer_gaertner_kutz`` keep working, so this is
6additive -- but the short form is the documented one, which leaves the module
7layout free to change without breaking callers.
9The two solvers answer the same question and agree on the answer, arriving from
10opposite sides: :func:`cvxball.min_circle_active_set` ascends the dual and holds
11no enclosing ball until it terminates, while :func:`cvxball.min_circle_fgk`
12deflates an enclosing ball and is feasible throughout. The first is the default --
13faster on every row of ``experiments/bench_seb.py``, and it returns the dual
14weights as a certificate; :func:`cvxball.fischer_gaertner_kutz.ball_with_counts`
15is the second one's fuller signature, reporting the support set and the pivot
16counts alongside the ball.
18The dependencies are NumPy and SciPy, which the re-exports pull in on import.
19That is the intended trade: they are the package's only reason to exist, so an
20``import cvxball`` that did not pull them in would be deferring work every caller
21is about to need. Nothing else is imported, because nothing else is needed -- the
22Clarabel cone program and Welzl's recursion, which the two solvers are measured
23against, live in ``experiments/`` and are references rather than solvers this
24ships.
25"""
27import importlib.metadata
29from cvxball.fischer_gaertner_kutz import Ball, ball_with_counts, min_circle_fgk
30from cvxball.solver import min_circle_active_set
32__version__ = importlib.metadata.version("cvxball")
34__all__ = [
35 "Ball",
36 "__version__",
37 "ball_with_counts",
38 "min_circle_active_set",
39 "min_circle_fgk",
40]