🧩 Pyxel Contribution: charge_to_volt Capacitance Key in the JSON Schema
Summary: Names the capacitance form of charge_to_volt from_capacitance in the JSON Schema, the key Pyxel's loader reads.
URL:
https://gitlab.com/esa/pyxel/-/merge_requests/1255
✨ Overview
ChargeToVoltSettings.from_dict reads value or from_capacitance,
and to_dict writes the same keys. The JSON Schema listed value and
capacitance instead, so the capacitance form had no spelling that worked in both places.
📄 YAML Before
charge_to_volt:
capacitance: 30.0 # valid in the schema, then pyxel.load() fails (KeyError)
charge_to_volt:
from_capacitance: 30.0 # loads, but the schema refuses it 🔧 Technical Changes
- The schema generator's
ChargeToVoltSettingsnow hasfrom_capacitance. pyxel/static/pyxel_schema.jsonis regenerated with the two commandstox -e json_schemaruns. That one key is the only change in it.- Regenerating from master reproduces the committed schema exactly.
🧪 Validation
- ✅ New tests check that each form the loader reads is valid in the schema.
- ✅ They also check that
capacitanceis refused by both the schema and the loader. - ✅ The tests fail without the change and pass with it.
🦕 Authored by: Doby Baxter
🌌 Contribution for: ESA Pyxel Project