The instantiateTupleVariationStore function now groups TupleVariation
tables that have the same axes 'tents', then merges them into a single
TupleVariation by summing their deltas. The rounding to integer happens
after summing the scaled deltas as floats, to reduce off-by-one errors.
To be able to sum gvar TupleVariation, it needs to calculate the inferred
deltas so it now takes two optional lists (origCoords and endPts) that
are passed on to iup_delta function. These only make sense for gvar
type of TupleVariation, of course, and are unused for cvar tuples.
It also run iup_delta_optimize on the gvar deltas that are left after
partial instancing and whose inferred deltas had to be interpolated.
This can be disabled with --no-optimize CLI option.
Also added calcInferredDeltas and optimize methods to TupleVariation
class, which use functions from varLib.iup module, plus tests
that exercise them.
The function now takes a VarStore instance, the fvar axes and a partial
location, and returns an array of delta-sets to be applied to the
default instance.
The algorithm is now more similar to the one used for instantiating the
tuple variation store.
Tests are coming soon.
update VarData.VarRegionCount
also set StartCoord and EndCoord to 0 (same end result as only setting PeakCoord
to 0, but this produces less noise when inspeciting the generated XML dump)
we can reuse the prune_regions method defined in varStore.py to update
the VarRegionList.
also update the counts at the end (will be done automatically on compile anyway).
refactored code, hopefully simplifying things a bit.
for cvar/cvt we do the rounding only at the end after we have summed the scaled deltas
to avoid introducing unnecessary rounding errors.