Atelier des rouesLab FR
Objects/Documentation

transport24.py

Rational transport and checks · transport24.py

Download ↓
"""Exact common decoder for finite anchored experiments. Standard library."""
from fractions import Fraction as F
from itertools import accumulate
from commun23 import common_law, hockey, knots, solve
from deficience21 import tv, push


def gap(a, b, q, y):
    return max(hockey(q, y, w) - hockey(a, b, w) for w in knots((a, b), (q, y)))


def waterlevel(rates, evaluate, target):
    """Invert a continuous monotone polygon at one of its affine segments."""
    prev = None
    for rate in sorted(set(rates)):
        value = evaluate(rate)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.