egonw / cdkbook

Groovy Cheminformatics with the Chemistry Development Kit
https://egonw.github.io/cdkbook/
Creative Commons Attribution Share Alike 4.0 International
40 stars 11 forks source link

Update atomsbonds.i.md #4

Closed johnmay closed 5 years ago

johnmay commented 5 years ago

Saw it on the blog and thought it should be updated. Atom's (or actually elements) only store the atomic number and not the symbol. It's this way because the symbol can be derived from a direct int -> string lookup (efficient), the reverse string -> int is less efficient.

Either way the ""best"" way to create atoms is with the atomic number (the Enum isn't terrible).

egonw commented 5 years ago

Thanks. I will pick it up tomorrow. I was already hoping to see pull requests from you, but I will make updates myself too, but I want to migrate all (old) content first.

johnmay commented 5 years ago

Yeah I'll have a look through over the holiday, thanks for uploading/converting this great resource. I just spotted this one from the blog post so decided to make/suggest the change. This is actually relatively recent but still useful to note.

egonw commented 5 years ago

See https://github.com/egonw/cdkbook/commit/b70a13736798bb6e8e4e4e5d6f01345a9b7e01d1