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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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-astro-frequency-comb-coordinate

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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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 retained mode while other fields remain valid.

An astronomical calibration comb has carrier-envelope offset o, repetition frequency r>0, integer mode m, and filter stride s with first retained mode b. Frequencies f=o+m*r. Detector channel k in the filtered comb corresponds to mode b+k*s; c is a supplied speed constant. Output fields are defined by: mode_frequency = d['o']+d['m']*d['r']; retained_mode = d['b']+d['k']*d['s']; retained_frequency = d['o']+(d['b']+d['k']*d['s'])*d['r']; line_spacing = d['s']*d['r']; mode_wavelength = d['c']/(d['o']+d['m']*d['r']); first_retained_frequency = d['o']+d['b']*d['r']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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-astro-frequency-comb-coordinate

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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+d['b']+d['k']*d['s']*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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 retained frequency while other fields remain valid.

An astronomical calibration comb has carrier-envelope offset o, repetition frequency r>0, integer mode m, and filter stride s with first retained mode b. Frequencies f=o+m*r. Detector channel k in the filtered comb corresponds to mode b+k*s; c is a supplied speed constant. Output fields are defined by: mode_frequency = d['o']+d['m']*d['r']; retained_mode = d['b']+d['k']*d['s']; retained_frequency = d['o']+(d['b']+d['k']*d['s'])*d['r']; line_spacing = d['s']*d['r']; mode_wavelength = d['c']/(d['o']+d['m']*d['r']); first_retained_frequency = d['o']+d['b']*d['r']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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-astro-frequency-comb-coordinate

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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['r']/d['s'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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 line spacing while other fields remain valid.

An astronomical calibration comb has carrier-envelope offset o, repetition frequency r>0, integer mode m, and filter stride s with first retained mode b. Frequencies f=o+m*r. Detector channel k in the filtered comb corresponds to mode b+k*s; c is a supplied speed constant. Output fields are defined by: mode_frequency = d['o']+d['m']*d['r']; retained_mode = d['b']+d['k']*d['s']; retained_frequency = d['o']+(d['b']+d['k']*d['s'])*d['r']; line_spacing = d['s']*d['r']; mode_wavelength = d['c']/(d['o']+d['m']*d['r']); first_retained_frequency = d['o']+d['b']*d['r']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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-astro-frequency-comb-coordinate

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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/d['o']+d['m']*d['r'], 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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 mode wavelength while other fields remain valid.

An astronomical calibration comb has carrier-envelope offset o, repetition frequency r>0, integer mode m, and filter stride s with first retained mode b. Frequencies f=o+m*r. Detector channel k in the filtered comb corresponds to mode b+k*s; c is a supplied speed constant. Output fields are defined by: mode_frequency = d['o']+d['m']*d['r']; retained_mode = d['b']+d['k']*d['s']; retained_frequency = d['o']+(d['b']+d['k']*d['s'])*d['r']; line_spacing = d['s']*d['r']; mode_wavelength = d['c']/(d['o']+d['m']*d['r']); first_retained_frequency = d['o']+d['b']*d['r']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['s']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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-astro-frequency-comb-coordinate

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

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['o']+d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
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 first retained frequency while other fields remain valid.

An astronomical calibration comb has carrier-envelope offset o, repetition frequency r>0, integer mode m, and filter stride s with first retained mode b. Frequencies f=o+m*r. Detector channel k in the filtered comb corresponds to mode b+k*s; c is a supplied speed constant. Output fields are defined by: mode_frequency = d['o']+d['m']*d['r']; retained_mode = d['b']+d['k']*d['s']; retained_frequency = d['o']+(d['b']+d['k']*d['s'])*d['r']; line_spacing = d['s']*d['r']; mode_wavelength = d['c']/(d['o']+d['m']*d['r']); first_retained_frequency = d['o']+d['b']*d['r']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['g']*(d['a']-d['b'])/d['m'], 'littrow_wavelength': 2*d['g']*d['a']/d['m'], 'angular_dispersion': d['g']*d['c']/d['m'], 'linear_dispersion': d['g']*d['c']/(d['m']*d['F']), 'inferred_diffraction_sine': d['m']*d['line']/d['g']-d['a'], 'next_order_wavelength': d['g']*(d['a']+d['b'])/(d['m']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'g': 120, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.0, 'littrow_wavelength': 40.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': -0.25, 'next_order_wavelength': 22.5}), ({'g': 120, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.0, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': 0.25, 'next_order_wavelength': 7.5}), ({'g': 120, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.0, 'littrow_wavelength': 40.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': -0.25, 'next_order_wavelength': 7.5}), ({'g': 120, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 90.0, 'littrow_wavelength': 120.0, 'angular_dispersion': 60.0, 'linear_dispersion': 6.0, 'inferred_diffraction_sine': -0.4166666666666667, 'next_order_wavelength': 45.0}), ({'g': 120, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.0, 'littrow_wavelength': 20.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': 0.0, 'next_order_wavelength': 15.0}), ({'g': 120, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.0, 'littrow_wavelength': 40.0, 'angular_dispersion': 40.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': -0.25, 'next_order_wavelength': 22.5})], 2: [({'g': 121, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.25, 'littrow_wavelength': 40.333333333333336, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.25206611570247933, 'next_order_wavelength': 22.6875}), ({'g': 121, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.083333333333334, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': 0.24793388429752067, 'next_order_wavelength': 7.5625}), ({'g': 121, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.083333333333334, 'littrow_wavelength': 40.333333333333336, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.25206611570247933, 'next_order_wavelength': 7.5625}), ({'g': 121, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 90.75, 'littrow_wavelength': 121.0, 'angular_dispersion': 60.5, 'linear_dispersion': 6.05, 'inferred_diffraction_sine': -0.41735537190082644, 'next_order_wavelength': 45.375}), ({'g': 121, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.166666666666668, 'littrow_wavelength': 20.166666666666668, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.002066115702479332, 'next_order_wavelength': 15.125}), ({'g': 121, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.25, 'littrow_wavelength': 40.333333333333336, 'angular_dispersion': 40.333333333333336, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.25206611570247933, 'next_order_wavelength': 22.6875})], 3: [({'g': 122, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.5, 'littrow_wavelength': 40.666666666666664, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.2540983606557377, 'next_order_wavelength': 22.875}), ({'g': 122, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.166666666666666, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': 0.2459016393442623, 'next_order_wavelength': 7.625}), ({'g': 122, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.166666666666666, 'littrow_wavelength': 40.666666666666664, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.2540983606557377, 'next_order_wavelength': 7.625}), ({'g': 122, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 91.5, 'littrow_wavelength': 122.0, 'angular_dispersion': 61.0, 'linear_dispersion': 6.1, 'inferred_diffraction_sine': -0.4180327868852459, 'next_order_wavelength': 45.75}), ({'g': 122, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.333333333333332, 'littrow_wavelength': 20.333333333333332, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.0040983606557377095, 'next_order_wavelength': 15.25}), ({'g': 122, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.5, 'littrow_wavelength': 40.666666666666664, 'angular_dispersion': 40.666666666666664, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.2540983606557377, 'next_order_wavelength': 22.875})], 4: [({'g': 123, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.75, 'littrow_wavelength': 41.0, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.25609756097560976, 'next_order_wavelength': 23.0625}), ({'g': 123, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.25, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': 0.24390243902439024, 'next_order_wavelength': 7.6875}), ({'g': 123, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.25, 'littrow_wavelength': 41.0, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.25609756097560976, 'next_order_wavelength': 7.6875}), ({'g': 123, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 92.25, 'littrow_wavelength': 123.0, 'angular_dispersion': 61.5, 'linear_dispersion': 6.15, 'inferred_diffraction_sine': -0.4186991869918699, 'next_order_wavelength': 46.125}), ({'g': 123, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.5, 'littrow_wavelength': 20.5, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.0060975609756097615, 'next_order_wavelength': 15.375}), ({'g': 123, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.75, 'littrow_wavelength': 41.0, 'angular_dispersion': 41.0, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.25609756097560976, 'next_order_wavelength': 23.0625})], 5: [({'g': 124, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 31.0, 'littrow_wavelength': 41.333333333333336, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.25806451612903225, 'next_order_wavelength': 23.25}), ({'g': 124, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.333333333333334, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': 0.24193548387096775, 'next_order_wavelength': 7.75}), ({'g': 124, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.333333333333334, 'littrow_wavelength': 41.333333333333336, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.25806451612903225, 'next_order_wavelength': 7.75}), ({'g': 124, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 93.0, 'littrow_wavelength': 124.0, 'angular_dispersion': 62.0, 'linear_dispersion': 6.2, 'inferred_diffraction_sine': -0.41935483870967744, 'next_order_wavelength': 46.5}), ({'g': 124, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.666666666666668, 'littrow_wavelength': 20.666666666666668, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.008064516129032251, 'next_order_wavelength': 15.5}), ({'g': 124, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 31.0, 'littrow_wavelength': 41.333333333333336, 'angular_dispersion': 41.333333333333336, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.25806451612903225, 'next_order_wavelength': 23.25})]}
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-spectrograph-grating-coordinate

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['g']*(d['a']+d['b'])*d['m'], 'littrow_wavelength': 2*d['g']*d['a']/d['m'], 'angular_dispersion': d['g']*d['c']/d['m'], 'linear_dispersion': d['g']*d['c']/(d['m']*d['F']), 'inferred_diffraction_sine': d['m']*d['line']/d['g']-d['a'], 'next_order_wavelength': d['g']*(d['a']+d['b'])/(d['m']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'g': 120, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.0, 'littrow_wavelength': 40.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': -0.25, 'next_order_wavelength': 22.5}), ({'g': 120, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.0, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': 0.25, 'next_order_wavelength': 7.5}), ({'g': 120, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.0, 'littrow_wavelength': 40.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': -0.25, 'next_order_wavelength': 7.5}), ({'g': 120, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 90.0, 'littrow_wavelength': 120.0, 'angular_dispersion': 60.0, 'linear_dispersion': 6.0, 'inferred_diffraction_sine': -0.4166666666666667, 'next_order_wavelength': 45.0}), ({'g': 120, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.0, 'littrow_wavelength': 20.0, 'angular_dispersion': 20.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': 0.0, 'next_order_wavelength': 15.0}), ({'g': 120, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.0, 'littrow_wavelength': 40.0, 'angular_dispersion': 40.0, 'linear_dispersion': 2.0, 'inferred_diffraction_sine': -0.25, 'next_order_wavelength': 22.5})], 2: [({'g': 121, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.25, 'littrow_wavelength': 40.333333333333336, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.25206611570247933, 'next_order_wavelength': 22.6875}), ({'g': 121, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.083333333333334, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': 0.24793388429752067, 'next_order_wavelength': 7.5625}), ({'g': 121, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.083333333333334, 'littrow_wavelength': 40.333333333333336, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.25206611570247933, 'next_order_wavelength': 7.5625}), ({'g': 121, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 90.75, 'littrow_wavelength': 121.0, 'angular_dispersion': 60.5, 'linear_dispersion': 6.05, 'inferred_diffraction_sine': -0.41735537190082644, 'next_order_wavelength': 45.375}), ({'g': 121, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.166666666666668, 'littrow_wavelength': 20.166666666666668, 'angular_dispersion': 20.166666666666668, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.002066115702479332, 'next_order_wavelength': 15.125}), ({'g': 121, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.25, 'littrow_wavelength': 40.333333333333336, 'angular_dispersion': 40.333333333333336, 'linear_dispersion': 2.0166666666666666, 'inferred_diffraction_sine': -0.25206611570247933, 'next_order_wavelength': 22.6875})], 3: [({'g': 122, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.5, 'littrow_wavelength': 40.666666666666664, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.2540983606557377, 'next_order_wavelength': 22.875}), ({'g': 122, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.166666666666666, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': 0.2459016393442623, 'next_order_wavelength': 7.625}), ({'g': 122, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.166666666666666, 'littrow_wavelength': 40.666666666666664, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.2540983606557377, 'next_order_wavelength': 7.625}), ({'g': 122, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 91.5, 'littrow_wavelength': 122.0, 'angular_dispersion': 61.0, 'linear_dispersion': 6.1, 'inferred_diffraction_sine': -0.4180327868852459, 'next_order_wavelength': 45.75}), ({'g': 122, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.333333333333332, 'littrow_wavelength': 20.333333333333332, 'angular_dispersion': 20.333333333333332, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.0040983606557377095, 'next_order_wavelength': 15.25}), ({'g': 122, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.5, 'littrow_wavelength': 40.666666666666664, 'angular_dispersion': 40.666666666666664, 'linear_dispersion': 2.033333333333333, 'inferred_diffraction_sine': -0.2540983606557377, 'next_order_wavelength': 22.875})], 4: [({'g': 123, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 30.75, 'littrow_wavelength': 41.0, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.25609756097560976, 'next_order_wavelength': 23.0625}), ({'g': 123, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.25, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': 0.24390243902439024, 'next_order_wavelength': 7.6875}), ({'g': 123, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.25, 'littrow_wavelength': 41.0, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.25609756097560976, 'next_order_wavelength': 7.6875}), ({'g': 123, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 92.25, 'littrow_wavelength': 123.0, 'angular_dispersion': 61.5, 'linear_dispersion': 6.15, 'inferred_diffraction_sine': -0.4186991869918699, 'next_order_wavelength': 46.125}), ({'g': 123, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.5, 'littrow_wavelength': 20.5, 'angular_dispersion': 20.5, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.0060975609756097615, 'next_order_wavelength': 15.375}), ({'g': 123, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 30.75, 'littrow_wavelength': 41.0, 'angular_dispersion': 41.0, 'linear_dispersion': 2.05, 'inferred_diffraction_sine': -0.25609756097560976, 'next_order_wavelength': 23.0625})], 5: [({'g': 124, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 31.0, 'littrow_wavelength': 41.333333333333336, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.25806451612903225, 'next_order_wavelength': 23.25}), ({'g': 124, 'a': 0, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.333333333333334, 'littrow_wavelength': 0.0, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': 0.24193548387096775, 'next_order_wavelength': 7.75}), ({'g': 124, 'a': 0.5, 'b': -0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 10.333333333333334, 'littrow_wavelength': 41.333333333333336, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.25806451612903225, 'next_order_wavelength': 7.75}), ({'g': 124, 'a': 0.5, 'b': 0.25, 'm': 1, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 93.0, 'littrow_wavelength': 124.0, 'angular_dispersion': 62.0, 'linear_dispersion': 6.2, 'inferred_diffraction_sine': -0.41935483870967744, 'next_order_wavelength': 46.5}), ({'g': 124, 'a': 0.25, 'b': 0.25, 'm': 3, 'F': 10, 'c': 0.5, 'line': 10}, {'wavelength': 20.666666666666668, 'littrow_wavelength': 20.666666666666668, 'angular_dispersion': 20.666666666666668, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.008064516129032251, 'next_order_wavelength': 15.5}), ({'g': 124, 'a': 0.5, 'b': 0.25, 'm': 3, 'F': 20, 'c': 1, 'line': 10}, {'wavelength': 31.0, 'littrow_wavelength': 41.333333333333336, 'angular_dispersion': 41.333333333333336, 'linear_dispersion': 2.066666666666667, 'inferred_diffraction_sine': -0.25806451612903225, 'next_order_wavelength': 23.25})]}
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 wavelength while other fields remain valid.

A stipulated grating adapter supplies spacing g, signed sine of incidence a, signed sine of diffraction b, positive order m, focal length F, and separate calibration line wavelength line. Wavelength is g*(a+b)/m. A Littrow reference has b=a; supplied diffraction cosine c permits a local angular dispersion derivative. Output fields are defined by: wavelength = d['g']*(d['a']+d['b'])/d['m']; littrow_wavelength = 2*d['g']*d['a']/d['m']; angular_dispersion = d['g']*d['c']/d['m']; linear_dispersion = d['g']*d['c']/(d['m']*d['F']); inferred_diffraction_sine = d['m']*d['line']/d['g']-d['a']; next_order_wavelength = d['g']*(d['a']+d['b'])/(d['m']+1)

split: open-access