broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['L']/d['c'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-spectral-reciprocal-density

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']*d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect frequency while other fields remain valid.

A spectral coordinate adapter uses positive wavelength L and supplied speed c. Frequency=c/L. A finite wavelength bin has endpoints lo<hi; its frequency endpoints reverse order. Density F_lambda transforms by L**2/c at the sample center. No relativistic or unit inference is performed. Output fields are defined by: frequency = d['c']/d['L']; frequency_edges = [d['c']/d['hi'],d['c']/d['lo']]; frequency_density = d['F']*d['L']**2/d['c']; frequency_bandwidth = d['c']/d['lo']-d['c']/d['hi']; local_frequency_step = -d['c']*d['dL']/d['L']**2; bin_energy_proxy = d['F']*d['dL']

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['lo'],d['c']/d['hi']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

evaluation_group: astro-spectral-reciprocal-density

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['lo']/d['c'],d['hi']/d['c']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect frequency edges while other fields remain valid.

A spectral coordinate adapter uses positive wavelength L and supplied speed c. Frequency=c/L. A finite wavelength bin has endpoints lo<hi; its frequency endpoints reverse order. Density F_lambda transforms by L**2/c at the sample center. No relativistic or unit inference is performed. Output fields are defined by: frequency = d['c']/d['L']; frequency_edges = [d['c']/d['hi'],d['c']/d['lo']]; frequency_density = d['F']*d['L']**2/d['c']; frequency_bandwidth = d['c']/d['lo']-d['c']/d['hi']; local_frequency_step = -d['c']*d['dL']/d['L']**2; bin_energy_proxy = d['F']*d['dL']

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['c']/d['L']**2, 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-spectral-reciprocal-density

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect frequency density while other fields remain valid.

A spectral coordinate adapter uses positive wavelength L and supplied speed c. Frequency=c/L. A finite wavelength bin has endpoints lo<hi; its frequency endpoints reverse order. Density F_lambda transforms by L**2/c at the sample center. No relativistic or unit inference is performed. Output fields are defined by: frequency = d['c']/d['L']; frequency_edges = [d['c']/d['hi'],d['c']/d['lo']]; frequency_density = d['F']*d['L']**2/d['c']; frequency_bandwidth = d['c']/d['lo']-d['c']/d['hi']; local_frequency_step = -d['c']*d['dL']/d['L']**2; bin_energy_proxy = d['F']*d['dL']

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/(d['hi']-d['lo']), 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-spectral-reciprocal-density

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['hi']-d['lo'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect frequency bandwidth while other fields remain valid.

A spectral coordinate adapter uses positive wavelength L and supplied speed c. Frequency=c/L. A finite wavelength bin has endpoints lo<hi; its frequency endpoints reverse order. Density F_lambda transforms by L**2/c at the sample center. No relativistic or unit inference is performed. Output fields are defined by: frequency = d['c']/d['L']; frequency_edges = [d['c']/d['hi'],d['c']/d['lo']]; frequency_density = d['F']*d['L']**2/d['c']; frequency_bandwidth = d['c']/d['lo']-d['c']/d['hi']; local_frequency_step = -d['c']*d['dL']/d['L']**2; bin_energy_proxy = d['F']*d['dL']

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-spectral-reciprocal-density

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L'], 'bin_energy_proxy': d['F']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect local frequency step while other fields remain valid.

A spectral coordinate adapter uses positive wavelength L and supplied speed c. Frequency=c/L. A finite wavelength bin has endpoints lo<hi; its frequency endpoints reverse order. Density F_lambda transforms by L**2/c at the sample center. No relativistic or unit inference is performed. Output fields are defined by: frequency = d['c']/d['L']; frequency_edges = [d['c']/d['hi'],d['c']/d['lo']]; frequency_density = d['F']*d['L']**2/d['c']; frequency_bandwidth = d['c']/d['lo']-d['c']/d['hi']; local_frequency_step = -d['c']*d['dL']/d['L']**2; bin_energy_proxy = d['F']*d['dL']

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['L']**2/d['c']*d['dL']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-spectral-reciprocal-density

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'frequency': d['c']/d['L'], 'frequency_edges': [d['c']/d['hi'],d['c']/d['lo']], 'frequency_density': d['F']*d['L']**2/d['c'], 'frequency_bandwidth': d['c']/d['lo']-d['c']/d['hi'], 'local_frequency_step': -d['c']*d['dL']/d['L']**2, 'bin_energy_proxy': d['F']*d['dL']*d['c']/d['L']**2}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.4, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 0}), ({'L': 4, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.4, 'frequency_bandwidth': 60.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 0.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 6}), ({'L': 4, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 30.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.26666666666666666, 'frequency_bandwidth': 40.0, 'local_frequency_step': -15.0, 'bin_energy_proxy': -4}), ({'L': 4, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 30.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.4, 'frequency_bandwidth': 15.0, 'local_frequency_step': -7.5, 'bin_energy_proxy': 3})], 2: [({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.625, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 0}), ({'L': 5, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.625, 'frequency_bandwidth': 60.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 12.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.25, 'frequency_bandwidth': 20.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 6}), ({'L': 5, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 24.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.4166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -9.6, 'bin_energy_proxy': -4}), ({'L': 5, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 24.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.625, 'frequency_bandwidth': 15.0, 'local_frequency_step': -4.8, 'bin_energy_proxy': 3})], 3: [({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.9, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 0}), ({'L': 6, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 0.9, 'frequency_bandwidth': 60.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 10.0, 'frequency_edges': [10.0, 30.0], 'frequency_density': 1.8, 'frequency_bandwidth': 20.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 6}), ({'L': 6, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 20.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -6.666666666666667, 'bin_energy_proxy': -4}), ({'L': 6, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 20.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 0.9, 'frequency_bandwidth': 15.0, 'local_frequency_step': -3.3333333333333335, 'bin_energy_proxy': 3})], 4: [({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.225, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 0}), ({'L': 7, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.225, 'frequency_bandwidth': 60.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 8.571428571428571, 'frequency_edges': [10.0, 30.0], 'frequency_density': 2.45, 'frequency_bandwidth': 20.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 6}), ({'L': 7, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 17.142857142857142, 'frequency_edges': [20.0, 60.0], 'frequency_density': -0.8166666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -4.8979591836734695, 'bin_energy_proxy': -4}), ({'L': 7, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 17.142857142857142, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.225, 'frequency_bandwidth': 15.0, 'local_frequency_step': -2.4489795918367347, 'bin_energy_proxy': 3})], 5: [({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 1.6, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': 0, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': 0.0, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 0}), ({'L': 8, 'c': 120, 'lo': 1, 'hi': 2, 'F': 3, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [60.0, 120.0], 'frequency_density': 1.6, 'frequency_bandwidth': 60.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 60, 'lo': 2, 'hi': 6, 'F': 3, 'dL': 2}, {'frequency': 7.5, 'frequency_edges': [10.0, 30.0], 'frequency_density': 3.2, 'frequency_bandwidth': 20.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 6}), ({'L': 8, 'c': 120, 'lo': 2, 'hi': 6, 'F': -2, 'dL': 2}, {'frequency': 15.0, 'frequency_edges': [20.0, 60.0], 'frequency_density': -1.0666666666666667, 'frequency_bandwidth': 40.0, 'local_frequency_step': -3.75, 'bin_energy_proxy': -4}), ({'L': 8, 'c': 120, 'lo': 4, 'hi': 8, 'F': 3, 'dL': 1}, {'frequency': 15.0, 'frequency_edges': [15.0, 30.0], 'frequency_density': 1.6, 'frequency_bandwidth': 15.0, 'local_frequency_step': -1.875, 'bin_energy_proxy': 3})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect bin energy proxy while other fields remain valid.

A spectral coordinate adapter uses positive wavelength L and supplied speed c. Frequency=c/L. A finite wavelength bin has endpoints lo<hi; its frequency endpoints reverse order. Density F_lambda transforms by L**2/c at the sample center. No relativistic or unit inference is performed. Output fields are defined by: frequency = d['c']/d['L']; frequency_edges = [d['c']/d['hi'],d['c']/d['lo']]; frequency_density = d['F']*d['L']**2/d['c']; frequency_bandwidth = d['c']/d['lo']-d['c']/d['hi']; local_frequency_step = -d['c']*d['dL']/d['L']**2; bin_energy_proxy = d['F']*d['dL']

split: open-access