Skip to content

Deprecated power-fitting compatibility package

Deprecated in v0.7

pyvoro2.powerfit is retained only for historical imports during v0.7 and will be removed in v0.8. Use pyvoro2.inverse for the normal fixed-observation workflow or pyvoro2.inverse.separator for advanced separator-specific functionality.

Historical name Canonical v0.7 name
PairBisectorConstraints SeparatorObservations
resolve_pair_bisector_constraints resolve_separator_observations
PowerFitProblem SeparatorFitProblem
PowerWeightFitResult SeparatorFitResult
fit_power_weights fit_weights_from_separators

Because PowerWeightFitResult is an identity alias, its instances also expose the v0.7 layered result properties. The new provisional view type names are exported only by pyvoro2.inverse.separator; they do not broaden the historical pyvoro2.powerfit.__all__ surface.

pyvoro2.powerfit

Deprecated compatibility exports for historical separator fitting.

ActiveSetPathSummary dataclass

Compact summary of transient active-set path diagnostics.

AlgebraicEdgeDiagnostics dataclass

Edge-space diagnostics matching the paper-side algebraic formulas.

ConnectivityDiagnostics dataclass

Structured connectivity diagnostics for the inverse-fit graph.

effective_graph and active_effective_graph are the informative observation graphs induced only by positive-confidence rows. The historical unconstrained_points field remains candidate-graph based. offsets_identified_in_objective conservatively reports complete relative-offset determination by informative data or positive L2 regularization; arbitrary penalties and hard restrictions do not set it.

ConnectivityDiagnosticsError

Bases: ValueError

Raised when connectivity_check='raise' detects a graph issue.

ConstraintGraphDiagnostics dataclass

Connectivity summary for a graph induced by constraint rows.

ExponentialBoundaryPenalty dataclass

Bases: ScalarPenalty

Repulsive penalty near the boundaries of an interval.

The penalty is based on exponentials measured from an inner interval [lower + margin, upper - margin].

FitModel dataclass

Complete objective definition for inverse power-weight fitting.

The objective consists of
  • one required mismatch term,
  • an optional hard feasibility set,
  • zero or more extra penalties,
  • optional L2 regularization on the weights.

FixedValue dataclass

Bases: HardConstraint

Hard equality restriction in the chosen measurement space.

HardConstraintConflict dataclass

Compact witness for inconsistent hard separator restrictions.

HardConstraintConflictTerm dataclass

One bound relation participating in an infeasibility witness.

HuberLoss dataclass

Bases: ScalarMismatch

Huber mismatch penalty in the chosen measurement space.

The penalty is quadratic near zero and linear for large residuals.

Interval dataclass

Bases: HardConstraint

Hard interval restriction in the chosen measurement space.

L2Regularization dataclass

Optional L2 regularization on the weight vector.

PairConstraintDiagnostics dataclass

to_records(*, ids=None)

Return one plain-Python record per candidate pair.

RealizedPairDiagnostics dataclass

Diagnostics for matching candidate constraints to realized boundaries.

geometry property

Return optional boundary/cell geometry and tessellation diagnostics.

requested_image_matching property

Return requested-pair and periodic-image matching diagnostics.

to_records(constraints, *, use_ids=False)

Return one plain-Python record per candidate pair.

to_report(constraints, *, use_ids=False)

Return a JSON-friendly report for realized-boundary matching.

unaccounted_records(*, ids=None)

Return one record per realized-but-unaccounted unordered pair.

ReciprocalBoundaryPenalty dataclass

Bases: ScalarPenalty

Reciprocal repulsion near interval boundaries.

This penalty is intended to be used together with a hard interval or a strong outside penalty. It penalizes separator positions that enter the boundary layers [lower, lower + margin] and [upper - margin, upper].

SelfConsistentPowerFitResult dataclass

candidate_diagnostics property

Return final diagnostics over every candidate observation.

final_realization property

Return realization diagnostics for the final fitted state.

inner_fit property

Return the final fixed-observation inner fit.

outer_termination property

Return termination metadata for the experimental outer loop.

path property

Return the final active state and optional path history.

to_records(*, use_ids=False)

Return one plain-Python record per candidate pair.

to_report(*, use_ids=False)

Return a JSON-friendly report for this active-set solve.

SoftIntervalPenalty dataclass

Bases: ScalarPenalty

Quadratic penalty for leaving a preferred interval.

The penalty is zero within [lower, upper] and quadratic outside.

SquaredLoss dataclass

Bases: ScalarMismatch

Quadratic mismatch penalty: (predicted - target)^2.

UnaccountedRealizedPair dataclass

One realized internal boundary whose unordered pair was not supplied.

to_record(*, ids=None)

Return a plain-Python record for the unaccounted pair.

UnaccountedRealizedPairError

Bases: ValueError

Raised when unaccounted_pair_check='raise' finds absent pairs.

build_active_set_report(result, *, use_ids=False)

Return a JSON-friendly report for a self-consistent active-set result.

build_fit_report(result, constraints, *, use_ids=False)

Return a JSON-friendly report for a low-level fit result.

build_power_fit_problem(constraints, *, model=None)

Build a public separator-fit problem from resolved observations.

build_power_fit_result(problem, weights, *, solver='external', status='optimal', status_detail=None, converged=True, n_iter=0, warnings=(), canonicalize_gauge=True, r_min=0.0, weight_shift=None)

Package candidate weights into a standard power-fit result object.

build_realized_report(diagnostics, constraints, *, use_ids=False)

Return a JSON-friendly report for realized-face matching.

dumps_report_json(report, *, indent=2, sort_keys=False)

Serialize a powerfit report into a JSON string.

match_realized_pairs(points, *, domain, constraints, weights=None, radii=None, return_boundary_measure=False, return_cells=False, return_tessellation_diagnostics=False, tessellation_check='diagnose', unaccounted_pair_check='diagnose')

Determine which resolved pair constraints correspond to realized boundaries.

The matching is purely geometric: each requested ordered pair (i, j, shift) is checked against the set of realized cell boundaries in the power tessellation, including explicit periodic image shifts. Supply exactly one of mathematical weights (preferred) or backend-compatible radii.

radii_to_weights(radii)

Convert radii to finite power weights (w = r^2).

Raises ValueError when the input or its squared result is non-finite.

solve_self_consistent_power_weights(points, constraints, *, measurement='fraction', domain, ids=None, index_mode='index', image='nearest', image_search=1, confidence=None, model=None, active0=None, options=None, r_min=0.0, weight_shift=None, fit_solver='auto', fit_max_iter=2000, fit_rho=1.0, fit_tol_abs=1e-06, fit_tol_rel=1e-05, return_history=False, return_cells=False, return_boundary_measure=False, return_tessellation_diagnostics=False, tessellation_check='diagnose', connectivity_check='warn', unaccounted_pair_check='warn')

Iteratively refine an active pair set against realized power-diagram boundaries.

weights_to_radii(weights, *, r_min=0.0, weight_shift=None)

Convert power weights to finite radii using one global shift.

Raises ValueError when an input, intermediate value, or result is non-finite.

write_report_json(report, path, *, indent=2, sort_keys=False)

Write a powerfit report to a JSON file.

:::