diff --git a/CLAUDE.md b/CLAUDE.md index 856b497..3a99ade 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -143,7 +143,7 @@ When multiple valid approaches exist, choose based on: **NEVER**: - Use `--no-verify` to bypass commit hooks - Disable tests instead of fixing them -- Commit code that doesn't compile +- *Commit code yourself* - Make assumptions - verify with existing code **ALWAYS**: @@ -151,3 +151,4 @@ When multiple valid approaches exist, choose based on: - Update plan documentation as you go - Learn from existing implementations - Stop after 3 failed attempts and reassess +- *Let the user commit changes* diff --git a/lib/ai/unit_list.dart b/lib/ai/unit_list.dart index 8203509..64e8e8b 100644 --- a/lib/ai/unit_list.dart +++ b/lib/ai/unit_list.dart @@ -51,10 +51,10 @@ class _UnitListState extends State { final sampleFormula = Formula( name: "Kinetic Energy", input: [ - VariableSpec(name: 'mass', magnitude: 'kilograms'), + VariableSpec(name: 'mass', magnitude: 'kilogram'), VariableSpec(name: 'velocity', magnitude: 'meters_per_second'), ], - output: VariableSpec(name: 'energy', magnitude: 'joules'), + output: VariableSpec(name: 'energy', magnitude: 'joule'), d4rtCode: "energy = 0.5 * mass * velocity * velocity;", ); diff --git a/lib/corpus.dart b/lib/corpus.dart index 0ec89e8..3510927 100644 --- a/lib/corpus.dart +++ b/lib/corpus.dart @@ -36,6 +36,11 @@ class UnitCorpus { } } + List unitsOfSameMagnitude(String unit){ + final base = this[unit].baseUnit; + return _baseToUnits[base] as List; + } + UnitSpec operator [](String unit) { if (!_allUnits.containsKey(unit)) { throw ArgumentError("Unit not found:$unit");