Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enforce Linux-style line endings for all text files
* text=auto eol=lf
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Lint
run: flake8 src tests tools
- name: Validate packaged registry
run: python tools/check_registry.py
- name: Validate notebooks
run: python tools/check_notebooks.py
- name: Check notebook exports
run: python tools/export_notebooks.py --check
- name: Check README sync
run: python tools/gen_readme.py --check

docs-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install docs extras
run: |
python -m pip install --upgrade pip
python -m pip install .[docs]
- name: Export notebooks and README
run: |
python tools/export_notebooks.py --check
python tools/gen_readme.py --check
- name: Build docs
run: mkdocs build --strict

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test
run: pytest

build-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build distributions
run: python -m build
- name: Validate metadata
run: python -m twine check dist/*
- name: Check packaged files
run: python tools/check_dist.py dist
- name: Install built wheel and smoke-test it
run: |
python -m pip install --force-reinstall --no-deps dist/*.whl
python - <<'PY'
import atomref as ar

assert ar.get_covalent_radius('C') == 0.76
assert ar.get_vdw_radius('C') == 1.77
assert 'atomic_radius' in ar.list_quantities()
assert 'rahm2016' in ar.list_dataset_ids('atomic_radius', usage_role='support')
PY
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docs

on:
push:
branches: [main, master]
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install docs extras
run: |
python -m pip install --upgrade pip
python -m pip install .[docs]
- name: Check generated files
run: |
python tools/export_notebooks.py --check
python tools/gen_readme.py --check
- name: Build docs
run: mkdocs build --strict
127 changes: 127 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Changelog

## 0.1.4 - 2026-03-15

### Added

- `LookupResult.transfer_depth`, which records how many transfer steps were
involved in the returned numeric value.
- Explicit nested-policy safeguards for `LinearTransfer` via:
- `fit_sources`
- `fit_max_depth`
- `prediction_sources`
- `prediction_max_depth`
- Regression tests covering generic-policy cycles, wrapper-policy cycles,
conservative nested-fit defaults, and explicit opt-in for deeper nested
linear workflows.

### Changed

- Nested policy-backed linear transfers are now guarded in two phases:
conservative defaults are used for fit training, while one additional nested
completion step remains allowed at prediction time.
- Linear-transfer fitting now distinguishes direct predictor values from nested
policy-derived predictor values.
- Cycle detection now tracks both generic policies and wrapper policies using a
context-local activation stack, so recursion through freshly materialized
wrapper policies is detected reliably and safely.
- Radii and X–H convenience helpers now resolve through wrapper-aware cycle
tracking rather than materializing a fresh generic policy for each public
lookup call.

### Documentation

- Expanded the transfer and policy docs to explain nested-policy safeguards,
`transfer_depth`, and cycle detection.
- Added guidance on when chained correlations are scientifically reasonable and
how to opt in deliberately when broader fit training is desired.

## 0.1.3 - 2026-03-15

### Added

- Support for using generic policies and wrapper policies as transfer sources in
`SubstitutionTransfer` and `LinearTransfer`.
- Public `atomref.xh` module docs and examples for policy-backed predictor
workflows.

### Changed

- `LinearTransfer` now treats predictors as **sources** rather than only raw
datasets, while still keeping the current runtime to one predictor at a time.
- Generic policy resolution now supports blocked element keys, which is used by
the X–H helper to prevent invalid `H` parent-element lookups.
- Transfer results now preserve nested-policy provenance through
`resolved_from` and explanatory notes when a policy source is involved.

## 0.1.2 - 2026-03-15

### Added

- New `xh_bond_length` quantity family.
- Packaged provisional X–H dataset `csd_legacy_xh_cno` with ConQuest/CSD
hydrogen-normalisation targets for `C`, `N`, and `O`.
- New `atomref.xh` convenience layer with `XHPolicy`, `DEFAULT_XH_POLICY`, set
listing helpers, and X–H lookup helpers.

### Documentation

- Added X–H dataset and API pages.
- Documented the provisional scope of X–H support in `0.1.x` and the planned
broader follow-up in `0.2.x`.

## 0.1.1 - 2026-03-15

### Added

- Public generic lookup helpers `lookup_value(...)` and `get_value(...)`.
- Tests for alias normalization, immutable metadata, non-finite-value rejection,
collision detection, and explicit placeholder notes.

### Changed

- Registry metadata returned by `get_dataset_info(...)` is now frozen so callers
cannot mutate the cached registry state.
- Dataset-alias resolution now normalizes Unicode and dash variants more
robustly.
- Custom-set construction and policy configuration now reject normalized-key
collisions and non-finite numeric values.
- Radii-specific wrappers now reject negative override and fallback values.
- Base and substitution lookups now emit explicit placeholder notes when the
returned numeric value is a dataset placeholder.
- `LinearTransfer` now validates empty-predictor and invalid-`min_points`
configurations eagerly.
- The docs now explain the distinction between quantity, domain, dataset, and
policy, and clarify that the current runtime supports only the `element`
domain.

## 0.1.0 - 2026-03-15

First public release.

### Added

- Packaged element metadata and curated radii tables.
- Quantity-aware registry metadata that separates operational lookup quantity
from scientific classification and dataset usage role.
- Provenance-aware radii policies with deterministic resolution order.
- Substitution and linear-transfer support for restoring missing values from
curated support datasets.
- Public helpers for inspecting quantities, dataset metadata, and packaged
built-in sets.
- Runnable notebooks together with generated Markdown notebook pages in the
documentation.
- Validation and maintenance tools for registry checks, notebook export, README
generation, and distribution-artifact inspection.

### Documentation

- Expanded dataset guides with citations and selection-oriented descriptions.
- Added module-level API pages and notebook walkthroughs.
- Added developer-facing curation and tooling notes.

### Packaging

- Built and validated wheel and source-distribution artifacts.
- Added CI coverage for linting, tests, docs builds, notebook sync, and
distribution checks.
Loading
Loading