Metadata-Version: 2.4
Name: atomref
Version: 0.2.1
Summary: Curated atomic reference data, proatomic densities, and transfer policies for structure algorithms.
Project-URL: Homepage, https://delonecommons.github.io/atomref/
Project-URL: Documentation, https://delonecommons.github.io/atomref/
Project-URL: Repository, https://github.com/DeloneCommons/atomref
Project-URL: Issues, https://github.com/DeloneCommons/atomref/issues
Project-URL: Changelog, https://github.com/DeloneCommons/atomref/blob/main/CHANGELOG.md
Project-URL: Citation, https://github.com/DeloneCommons/atomref/blob/main/CITATION.cff
Author-email: "Ivan Yu. Chernyshov" <ivan.chernyshoff@gmail.com>
License:                    GNU LESSER GENERAL PUBLIC LICENSE
                               Version 3, 29 June 2007
        
         Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
         Everyone is permitted to copy and distribute verbatim copies
         of this license document, but changing it is not allowed.
        
        
          This version of the GNU Lesser General Public License incorporates
        the terms and conditions of version 3 of the GNU General Public
        License, supplemented by the additional permissions listed below.
        
          0. Additional Definitions.
        
          As used herein, "this License" refers to version 3 of the GNU Lesser
        General Public License, and the "GNU GPL" refers to version 3 of the GNU
        General Public License.
        
          "The Library" refers to a covered work governed by this License,
        other than an Application or a Combined Work as defined below.
        
          An "Application" is any work that makes use of an interface provided
        by the Library, but which is not otherwise based on the Library.
        Defining a subclass of a class defined by the Library is deemed a mode
        of using an interface provided by the Library.
        
          A "Combined Work" is a work produced by combining or linking an
        Application with the Library.  The particular version of the Library
        with which the Combined Work was made is also called the "Linked
        Version".
        
          The "Minimal Corresponding Source" for a Combined Work means the
        Corresponding Source for the Combined Work, excluding any source code
        for portions of the Combined Work that, considered in isolation, are
        based on the Application, and not on the Linked Version.
        
          The "Corresponding Application Code" for a Combined Work means the
        object code and/or source code for the Application, including any data
        and utility programs needed for reproducing the Combined Work from the
        Application, but excluding the System Libraries of the Combined Work.
        
          1. Exception to Section 3 of the GNU GPL.
        
          You may convey a covered work under sections 3 and 4 of this License
        without being bound by section 3 of the GNU GPL.
        
          2. Conveying Modified Versions.
        
          If you modify a copy of the Library, and, in your modifications, a
        facility refers to a function or data to be supplied by an Application
        that uses the facility (other than as an argument passed when the
        facility is invoked), then you may convey a copy of the modified
        version:
        
           a) under this License, provided that you make a good faith effort to
           ensure that, in the event an Application does not supply the
           function or data, the facility still operates, and performs
           whatever part of its purpose remains meaningful, or
        
           b) under the GNU GPL, with none of the additional permissions of
           this License applicable to that copy.
        
          3. Object Code Incorporating Material from Library Header Files.
        
          The object code form of an Application may incorporate material from
        a header file that is part of the Library.  You may convey such object
        code under terms of your choice, provided that, if the incorporated
        material is not limited to numerical parameters, data structure
        layouts and accessors, or small macros, inline functions and templates
        (ten or fewer lines in length), you do both of the following:
        
           a) Give prominent notice with each copy of the object code that the
           Library is used in it and that the Library and its use are
           covered by this License.
        
           b) Accompany the object code with a copy of the GNU GPL and this license
           document.
        
          4. Combined Works.
        
          You may convey a Combined Work under terms of your choice that,
        taken together, effectively do not restrict modification of the
        portions of the Library contained in the Combined Work and reverse
        engineering for debugging such modifications, if you also do each of
        the following:
        
           a) Give prominent notice with each copy of the Combined Work that
           the Library is used in it and that the Library and its use are
           covered by this License.
        
           b) Accompany the Combined Work with a copy of the GNU GPL and this license
           document.
        
           c) For a Combined Work that displays copyright notices during
           execution, include the copyright notice for the Library among
           these notices, as well as a reference directing the user to the
           copies of the GNU GPL and this license document.
        
           d) Do one of the following:
        
               0) Convey the Minimal Corresponding Source under the terms of this
               License, and the Corresponding Application Code in a form
               suitable for, and under terms that permit, the user to
               recombine or relink the Application with a modified version of
               the Linked Version to produce a modified Combined Work, in the
               manner specified by section 6 of the GNU GPL for conveying
               Corresponding Source.
        
               1) Use a suitable shared library mechanism for linking with the
               Library.  A suitable mechanism is one that (a) uses at run time
               a copy of the Library already present on the user's computer
               system, and (b) will operate properly with a modified version
               of the Library that is interface-compatible with the Linked
               Version.
        
           e) Provide Installation Information, but only if you would otherwise
           be required to provide such information under section 6 of the
           GNU GPL, and only to the extent that such information is
           necessary to install and execute a modified version of the
           Combined Work produced by recombining or relinking the
           Application with a modified version of the Linked Version. (If
           you use option 4d0, the Installation Information must accompany
           the Minimal Corresponding Source and Corresponding Application
           Code. If you use option 4d1, you must provide the Installation
           Information in the manner specified by section 6 of the GNU GPL
           for conveying Corresponding Source.)
        
          5. Combined Libraries.
        
          You may place library facilities that are a work based on the
        Library side by side in a single library together with other library
        facilities that are not Applications and are not covered by this
        License, and convey such a combined library under terms of your
        choice, if you do both of the following:
        
           a) Accompany the combined library with a copy of the same work based
           on the Library, uncombined with any other library facilities,
           conveyed under the terms of this License.
        
           b) Give prominent notice with the combined library that part of it
           is a work based on the Library, and explaining where to find the
           accompanying uncombined form of the same work.
        
          6. Revised Versions of the GNU Lesser General Public License.
        
          The Free Software Foundation may publish revised and/or new versions
        of the GNU Lesser General Public License from time to time. Such new
        versions will be similar in spirit to the present version, but may
        differ in detail to address new problems or concerns.
        
          Each version is given a distinguishing version number. If the
        Library as you received it specifies that a certain numbered version
        of the GNU Lesser General Public License "or any later version"
        applies to it, you have the option of following the terms and
        conditions either of that published version or of any later version
        published by the Free Software Foundation. If the Library as you
        received it does not specify a version number of the GNU Lesser
        General Public License, you may choose any version of the GNU Lesser
        General Public License ever published by the Free Software Foundation.
        
          If the Library as you received it specifies that a proxy can decide
        whether future versions of the GNU Lesser General Public License shall
        apply, that proxy's public statement of acceptance of any version is
        permanent authorization for you to choose that version for the
        Library.
License-File: COPYING
License-File: LICENSE
License-File: NOTICE.md
Keywords: IAS,atomic radii,chemistry,crystallography,electron density,interatomic surfaces,materials,proatomic density,reference data
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: build>=1.2; extra == 'all'
Requires-Dist: cffconvert==2.0.0; extra == 'all'
Requires-Dist: flake8>=7; extra == 'all'
Requires-Dist: ipykernel>=6.29; extra == 'all'
Requires-Dist: matplotlib>=3.8; extra == 'all'
Requires-Dist: mkdocs-jupyter<0.27,>=0.26; extra == 'all'
Requires-Dist: mkdocs-material>=9.5; extra == 'all'
Requires-Dist: mkdocs<2,>=1.6; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'all'
Requires-Dist: mypy<3,>=2.3; extra == 'all'
Requires-Dist: nbclient<0.12,>=0.10; extra == 'all'
Requires-Dist: nbformat<6,>=5.10; extra == 'all'
Requires-Dist: pymdown-extensions>=10.0; extra == 'all'
Requires-Dist: pytest>=7; extra == 'all'
Requires-Dist: tomli>=2; (python_version < '3.11') and extra == 'all'
Requires-Dist: twine>=5; extra == 'all'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: cffconvert==2.0.0; extra == 'dev'
Requires-Dist: flake8>=7; extra == 'dev'
Requires-Dist: mypy<3,>=2.3; extra == 'dev'
Requires-Dist: twine>=5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs<2,>=1.6; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.0; extra == 'docs'
Provides-Extra: notebooks
Requires-Dist: ipykernel>=6.29; extra == 'notebooks'
Requires-Dist: matplotlib>=3.8; extra == 'notebooks'
Requires-Dist: mkdocs-jupyter<0.27,>=0.26; extra == 'notebooks'
Requires-Dist: mkdocs<2,>=1.6; extra == 'notebooks'
Requires-Dist: nbclient<0.12,>=0.10; extra == 'notebooks'
Requires-Dist: nbformat<6,>=5.10; extra == 'notebooks'
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Requires-Dist: tomli>=2; (python_version < '3.11') and extra == 'test'
Description-Content-Type: text/markdown

# atomref

[![CI](https://github.com/DeloneCommons/atomref/actions/workflows/ci.yml/badge.svg)](https://github.com/DeloneCommons/atomref/actions/workflows/ci.yml)
[![Docs](https://github.com/DeloneCommons/atomref/actions/workflows/docs.yml/badge.svg)](https://github.com/DeloneCommons/atomref/actions/workflows/docs.yml)
[![PyPI](https://img.shields.io/pypi/v/atomref.svg)](https://pypi.org/project/atomref/)
[![Python Versions](https://img.shields.io/pypi/pyversions/atomref.svg)](https://pypi.org/project/atomref/)
[![License](https://img.shields.io/pypi/l/atomref.svg)](https://github.com/DeloneCommons/atomref/blob/main/LICENSE)

Documentation: https://delonecommons.github.io/atomref

`atomref` provides cited atomic properties and frozen spherical free-atom
electron densities through a small Python API for crystallographic,
quantum-chemical, and molecular-structure algorithms.

Use it when your software needs dependable atomic radii, X–H reference lengths,
neutral proatomic densities, or pairwise reference-atom boundaries without
embedding another project-local table and its fallback rules. The core runtime
is pure Python and has **no required third-party dependencies**.

## Install and get a useful result

```bash
pip install atomref
```

```python
import atomref as ar

covalent_c = ar.get_covalent_radius("C")
xh_n = ar.get_xh_bond_length("N")
rho_o = ar.get_proatomic_density("O", 0.75)
boundary = ar.estimate_proatomic_boundary("C", "O", 1.43)
minimum = ar.estimate_promolecular_density_minimum("C", "O", 1.43)
```

The scalar results above are in documented units: radii and X–H lengths use
angstrom, while the density call returns electron/bohr³ by default. Pairwise
coordinates are measured from the first atom toward the second. For this C–O
example, `boundary` is the stable equal-proatom divider and `minimum` is the
optional, resolution-limited minimum of the summed promolecular line density.

[Start with the quickstart](https://delonecommons.github.io/atomref/guide/quickstart/)
or open the [complete API reference](https://delonecommons.github.io/atomref/api/).

## What it solves

- **Bond and contact geometry:** select named covalent and van der Waals radii
  instead of scattering constants through structure code.
- **Hydrogen normalization:** obtain provisional, provenance-aware X–H target
  lengths keyed by the parent element.
- **Incomplete reference tables:** use explicit substitution or fitted transfer
  policies and inspect how a value was obtained.
- **Free-atom density sampling:** evaluate immutable neutral H–Lr spherical
  profiles with explicit coordinate and density units over a strict 0–20 bohr
  domain.
- **Pairwise reference-atom models:** choose a stable proatomic boundary or an
  explicitly cutoff-bounded promolecular-minimum proxy without presenting
  either as an exact molecular QTAIM surface.

Most convenience functions come in two forms:

```pycon
>>> import atomref as ar
>>> ar.get_vdw_radius("Pm")
2.8972265395148358
>>> result = ar.lookup_vdw_radius("Pm")
>>> result.source, result.transfer_depth
('transfer_linear', 1)
>>> result.resolved_from
(DatasetRef(quantity='atomic_radius', set_id='rahm2016'),)
```

`get_*` returns the selected number. `lookup_*` returns a typed `LookupResult`
with the source, supporting datasets, placeholder state, fit information, and
transfer depth.

## Why adopt `atomref`?

A local constants file is easy to start and difficult to maintain. It usually
accumulates uncited values, silent replacements for missing elements, ambiguous
units, and behavior that cannot be reviewed independently of the consuming
algorithm. `atomref` keeps those concerns in one versioned layer:

- every packaged dataset has a stable identifier, coverage metadata, and
  bibliographic provenance;
- lookup rules are explicit and deterministic rather than hidden in callers;
- direct, substituted, fitted, fallback, placeholder, and missing results stay
  distinguishable;
- public types, units, valid ranges, and failure behavior are documented;
- packaged data and attribution are checked in both wheel and source
  distributions;
- the dependency-free runtime can be embedded in lightweight scientific tools.

The package does not claim that one table or policy is universally correct. It
makes the selected reference and the assumptions around it visible.

## Installation choices

The base install is sufficient for every runtime API:

```bash
pip install atomref
```

Install the `notebooks` extra to execute or render the shipped Jupyter examples
and their plots:

```bash
pip install "atomref[notebooks]"
```

Install every optional dependency declared by the project with:

```bash
pip install "atomref[all]"
```

`all` is the exact union of `test`, `notebooks`, `docs`, and `dev`, so it is
appropriate for a complete contributor or release environment. See the
[installation guide](https://delonecommons.github.io/atomref/guide/install/)
for the narrower groups.

## Data, provenance, and scientific scope

The scalar catalog includes named covalent, van der Waals, atomic-isodensity,
and provisional X–H datasets. Registry metadata separates the requested
quantity from scientific classification and from whether a dataset is a direct
target or transfer support.

The neutral proatomic profiles are a deterministic packaged snapshot of the
`atomref-proatoms` 2.0.0 dataset
`pbe0_sfx2c_dyallv4z_h-lr_spherical_v2`. They cover H–Lr and record the PBE0,
self-consistent spherical fractional-occupation UKS, spin-free one-electron
X2C, and dyall-v4z definition, source hashes, CC BY 4.0 data license, and both
concept and version-specific DOIs.

These profiles are isolated, neutral, spherical reference atoms—not molecular
electron densities. Density evaluation is scalar, and the public radius domain
is exactly 0–20 bohr. Pairwise `boundary` mode is the stable default. Optional
`minimum` mode searches only where both proatoms remain above
`1e-4 electron/bohr^3`, has a declared `0.01 bohr` resolution, and may return a
typed diagnostic without a coordinate.

- [Dataset catalog and provenance](https://delonecommons.github.io/atomref/datasets/)
- [Proatomic-density and pairwise scientific guide](https://delonecommons.github.io/atomref/guide/proatomic_density/)
- [Policy guide](https://delonecommons.github.io/atomref/guide/policies/)
- [Explicit non-goals](https://delonecommons.github.io/atomref/guide/non_goals/)

## Citation and licenses

Cite `atomref` as software using the repository-level
[`CITATION.cff`](https://github.com/DeloneCommons/atomref/blob/main/CITATION.cff).
There is no preferred paper citation; the versioned software release is the
canonical object to cite.

Except for separately identified material, the software and accompanying
repository content are licensed under LGPL-3.0-or-later. The bundled neutral
proatomic-density snapshot is licensed separately under CC BY 4.0.
[`NOTICE.md`](https://github.com/DeloneCommons/atomref/blob/main/NOTICE.md)
records the exact boundary, attribution, and source DOIs. The packaged registry
metadata records the exact source commit and SHA-256 hashes.

## Executable notebook documentation

The documentation renders the actual committed `.ipynb` files directly,
including Markdown, code, mathematics, saved text, and saved PNG plots. Site
builds do not execute or rewrite them; separate bounded Jupyter workers verify
temporary copies without retaining their results.

- [Notebook overview](https://delonecommons.github.io/atomref/guide/notebooks/)
- [Quickstart notebook](https://delonecommons.github.io/atomref/notebooks/01-quickstart/)
- [Policies and assessment notebook](https://delonecommons.github.io/atomref/notebooks/02-policies-and-assessment/)
- [Custom sets and discovery notebook](https://delonecommons.github.io/atomref/notebooks/03-custom-sets-and-discovery/)
- [IAS method-selection study](https://delonecommons.github.io/atomref/notebooks/04-ias-method-selection-study/)
- [Proatomic density and IAS workflows](https://delonecommons.github.io/atomref/notebooks/05-proatomic-density-and-ias/)

## Dataset and policy discovery

The lower-level registry is available when an application needs to choose or
report an exact source:

```pycon
>>> import atomref as ar
>>> ar.list_quantities()
('covalent_radius', 'van_der_waals_radius', 'atomic_radius', 'xh_bond_length', 'proatomic_density')
>>> [info.ref.set_id for info in ar.list_dataset_infos(
...     "van_der_waals_radius", usage_role="target"
... )]
['bondi1964', 'rowland_taylor1996', 'alvarez2013', 'chernyshov2020']
>>> profile_info = ar.get_proatomic_density_set_info()
>>> profile_info.ref.set_id
'pbe0_sfx2c_dyallv4z_h-lr_neutral_v2'
```

Custom element-indexed scalar sets can participate in the same policy layer.
Radial profiles deliberately do not: no scalar `ValuePolicy`, neighboring-
element substitution, or fitted correlation is applied to density data.

## Use in scientific software

`atomref` is a standalone package for physicochemical and structural-analysis
software that needs curated atomic properties, proatomic densities, or explicit
reference-data policy. Purely mathematical packages can remain independent of
those choices until a consuming application needs atomic context.

## Maintainer checks

The repository keeps a small set of release tools:

- `python tools/check_registry.py` validates registry metadata against every
  packaged scalar and radial payload;
- `python tools/check_notebooks.py` smoke-executes each temporary notebook copy
  in its own bounded standard Jupyter process, then discards the results;
- `python tools/gen_readme.py` regenerates this README from `docs/index.md`;
- `python tools/release_check.py` runs lint, tests, strict docs, distribution
  checks, and clean artifact-installation checks.

See the [tools README](https://github.com/DeloneCommons/atomref/blob/main/tools/README.md)
for the maintainer-only data snapshot workflow and command details.

---

This README is generated from `docs/index.md`.

To regenerate it:

```bash
python tools/gen_readme.py
```

Edit the documentation sources instead of editing `README.md` directly.
