Quickstart
The two most important user-facing ideas in atomref are:
get_*returns only the selected number,lookup_*returns the number and provenance metadata.
>>> import atomref as ar
>>> ar.get_covalent_radius("C")
0.76
>>> ar.get_vdw_radius("O")
1.5
>>> ar.get_xh_bond_length("N")
1.015
>>> lookup = ar.lookup_vdw_radius("Pm")
>>> lookup.value
2.8972265395148358
>>> lookup.source
'transfer_linear'
>>> lookup.resolved_from
(DatasetRef(quantity='atomic_radius', set_id='rahm2016'),)
Use get_* when you only need the value. Use lookup_* when you want to know
whether the result came from the preferred dataset, a support dataset, a policy
override, or a fallback.
You can inspect the packaged quantity layer directly:
>>> import atomref as ar
>>> ar.list_quantities()
('covalent_radius', 'van_der_waals_radius', 'atomic_radius', 'xh_bond_length')
>>> ar.get_quantity_info("xh_bond_length")
QuantityInfo(quantity='xh_bond_length', domain='element', units='angstrom', description='Element-indexed reference X-H bond lengths keyed by parent element X and intended for hydrogen-position normalisation or related geometry workflows.')
>>> [info.ref.set_id for info in ar.list_radii_set_infos("van_der_waals", usage_role="target")]
['bondi1964', 'rowland_taylor1996', 'alvarez2013', 'chernyshov2020']
And you can load a packaged set object directly:
>>> import atomref as ar
>>> vdw = ar.get_radii_set("van_der_waals", "alvarez2013")
>>> vdw.get("O")
1.5
>>> raw = ar.get_builtin_set(ar.DatasetRef("atomic_radius", "rahm2016"))
>>> raw.get("Pm")
2.83
>>> xh = ar.get_xh_set("csd_legacy_xh_cno")
>>> xh.get("C")
1.089
For longer, runnable examples see:
- the notebook overview,
- the quickstart notebook page,
- the policies notebook page,
- the custom sets notebook page.