franciscoadasme / chem.cr

Library for dealing with computational chemistry files
https://franciscoadasme.github.io/chem.cr/
MIT License
23 stars 1 forks source link

Refactor #guess_bonds implementation #214

Open franciscoadasme opened 2 months ago

franciscoadasme commented 2 months ago

The Structure#guess_bonds method is a complex method that does a ton of stuff, which was merged from several methods. We should split this into simpler methods, and keep #guess_bonds as the convenient helper:

class Chem::Structure
  def guess_bonds : Nil
    reset_bonds
    guess_connectivity
    guess_bond_orders
    guess_formal_charges
  end
end

Even more, this could be potentially moved to the Chem namespace.