Skip to content

Harden Electron Perception for Missing Valence Metals #17

@TKanX

Description

@TKanX

Description:

This task improves the robustness of electron perception when encountering elements without defined valence data. Today, assign_general errors whenever valence_electrons is absent, which breaks on isolated transition-metal ions (e.g., Au⁺) that appear as degree-0 nodes in crystal or biomolecular inputs. We will allow degree=0 atoms with unknown valence to default to valence 0 while preserving errors for any bonded cases. This keeps perception deterministic, maintains existing behavior for connected atoms, and broadens support for common crystallographic metals.

Tasks:

  • Logic Update

    • In perception::electrons::assign_general, branch on valence_electrons():
      • If Some(v), keep existing behavior.
      • If None and degree == 0, treat valence = 0 (no lone pairs, formal charge 0) without error.
      • If None and degree > 0, retain the current error path.
  • Tests

    • Add unit test for isolated Au (or similar transition metal) with degree 0: expect formal_charge = 0, lone_pairs = 0, no error.
    • Add test to confirm bonded unknown-valence element still errors.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions