Skip to main content

PyAutoNerves

PyAutoNerves

PyAutoScientist GitHub PyAutoScientist ReadTheDocs

PyAutoNerves is the Nerves of the PyAutoScientist — the configuration, serialization, and I/O foundation (package autonerves) connecting the workspace's conventions to every library. It provides a layered configuration system with workspace overrides, dict / JSON / CSV serialization of arbitrary objects, and FITS I/O.

PyAutoFit, PyAutoArray, PyAutoGalaxy, and PyAutoLens all depend on autonerves: it supplies their packaged default config, the object-serialization used to persist models and results, and shared utilities (test_mode, jax_wrapper). Centralising these here keeps a single, consistent config and I/O layer beneath every library. As a released library it ships with every nightly train — see the PyAutoHands release board for the current version.

Install

pip install autonerves

Examples

Layered config — read a directory of YAML into a queryable Config:

from autonerves.conf import Config

config = Config("path/to/config")          # directory of YAML files
value = config["general"]["model"]["section"]["value"]

JSON serialization — round-trip arbitrary Python objects:

from autonerves.dictable import output_to_json, from_json

data = {"sersic_index": 4.0, "centre": [0.0, 0.0]}
output_to_json(data, "model.json")
restored = from_json("model.json")         # == data

FITS I/O — write and read a NumPy array:

import numpy as np
from autonerves.fitsable import output_to_fits, ndarray_via_fits_from

arr = np.arange(12.0).reshape(3, 4)
output_to_fits(values=arr, file_path="demo.fits", overwrite=True)
loaded = ndarray_via_fits_from(file_path="demo.fits", hdu=0)   # np.allclose(arr, loaded)

Nerves board

https://pyautolabs.github.io/PyAutoNerves/ — a read-only browser of every config file and option across the organism: each library's <package>/config/ (PyAutoFit, PyAutoArray, PyAutoGalaxy, PyAutoLens, PyAutoCTI) and each workspace's config/ that overrides them.

  • Per repo (repos/<Repo>.html): every YAML file with its top-level keys, its source line-numbered with the comments kept (the comments are the option docs) and a GitHub link; prior files render as a table (Class · param · type · mean/σ or bounds · width modifier · limits).
  • Search: the index page's box searches every key, file and comment across all repos and jumps to the line.
  • Override map: autonerves resolves a key workspace → last-imported library → … → PyAutoFit (Config.push(keep_first=True), keys lowercased), so each workspace file is compared, by relative path, against the same file across its library stack in that order (lens → galaxy → array → fit; cti → array → fit). Keys whose value differs, keys no library defines (orphans) and keys that fall through to the libraries are listed per file. build/*.yaml is workspace tooling and is grouped apart.
  • Possibly unused config keys: each library's Python (and autonerves' own) is scanned for conf.instance[...] lookups, and every key of a library settings file is classed used (a lookup reads it, or reads a key under it — PyAutoLens reading a PyAutoFit key counts, since autonerves merges every layer), section-read (a lookup reads an ancestor section whole, or a non-literal subscript such as ["plots"][section][name] ends the chain above it) or unused (nothing references it). Unused keys get a chip on the repo page, per-file counts and an index section grouped by library with GitHub links. Prior files are exempt (looked up by class name). Limits: the scan is static — it follows literal subscript chains (including multi-line ones and .get("k")), sections bound to a local and indexed later in the same function or a closure, and the should_output helper; a key read any other way (built key strings, getattr, a section passed to another function and indexed there) shows as section-read at best and may show as unused. Treat the list as candidates, not a verdict.
  • Environment variables: the PYAUTO_* switches autonerves reads.
  • Cockpit feed (state.json): green when every file parses and no workspace key is orphaned; yellow with one item per unparseable file or orphan-carrying workspace file; grey when nothing was collected. Never red. Possibly unused keys add one info item per library — never yellow, until the scan is trusted.

Rendered daily by .github/workflows/nerves_board.yml from sparse checkouts of the config folders (plus each library's package .py files, for the lookup scan); the renderer is scripts/board.py (not part of the autonerves package). Nothing on the board edits config.

JAX compatibility

PyAutoNerves requires JAX and JAXlib 0.12 (>=0.12.0,<0.13). Both are pinned, because jax 0.12.0 on its own would still accept the older jaxlib 0.11.2.

Why 0.12: on the CPU, jax 0.11.2 can freeze a likelihood. A call never returns and the process sits at 0 % CPU. It happened every time on 4 cores, sometimes on 8 and never on 16, so laptops, CI runners and small containers are the most exposed (PyAutoNerves#213; the evidence is in PyAutoDNA decisions/jax-cpu-policy-2026-11.md). jax 0.12.0 and 0.12.0.1 ran 30,000 calls with no freeze. Part of the fix is upstream (jax-ml/jax#41265, fixed in XLA for 0.12.0).

No XLA flag is set for you. On 0.12 none is needed, and the --xla_cpu_multi_thread_eigen=false flag that hid the problem on 0.11 slows pixelized likelihoods by roughly 20-50 %.

What this means for your install:

  • Python 3.12 or newer (unchanged).
  • NumPy 2.2 or newer, because jax 0.12 requires it.
  • x86-64 CPUs must be Intel Haswell / AMD equivalent (2013) or newer; jaxlib 0.12 wheels use those instructions. Apple Silicon and Linux on ARM are fine.
  • Intel macOS still installs without JAX (there are no jaxlib wheels for it) and runs the NumPy path.
  • Google Colab ships an older jax. The PyAuto Colab setup cell upgrades jax, jaxlib and NumPy, and asks you to restart the runtime once if they were already loaded.

Updated family packages require a PyAutoNerves newer than 2026.11.9.1, the last release that still allowed jax 0.11, so pip cannot pair them with the old range. Publish this Nerves before the family packages. Existing published wheels are not repaired; if you pin old family releases, upgrade them together.

Keep JAX, JAXlib and any CUDA plugin on a mutually compatible version. Use pip's resolver rather than --no-deps, and verify the resulting environment with python -m pip check. Existing lockfiles need regeneration to adopt the policy.

sometimes i wanna feel the pain

Metadata

Release files for autonerves 2026.11.19.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autonerves 2026.11.19.1
File Size Uploaded Provenance Actions
autonerves-2026.11.19.1.tar.gz 180.6 kB Without provenance Details for autonerves-2026.11.19.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autonerves 2026.11.19.1
File Interpreter ABI Platform Actions
autonerves-2026.11.19.1-py3-none-any.whl Python 3 none any Details for autonerves-2026.11.19.1-py3-none-any.whl

Total release size: 235.5 kB

Release files / autonerves-2026.11.19.1.tar.gz

Download URL autonerves-2026.11.19.1.tar.gz
Size 180.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f76213c4713b7b3af60134a36d77f7db70e6e18a55340f5869502a976b75fc9
BLAKE2b-256 checksum
How to use checksums
650852aeccbc40d136a5566ac8594d7b6a541629a10e0a19db7d6c43fe236c20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.16

Release files / autonerves-2026.11.19.1-py3-none-any.whl

Download URL autonerves-2026.11.19.1-py3-none-any.whl
Size 54.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29726bf672d475b02b6cf21cc68a74a9c77069fdb1906946a75b114bdde82f2e
BLAKE2b-256 checksum
How to use checksums
75a15608382b0da06ade14c9c9641e378be9d1ba538aab65e1e606b18fbad1ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.16

Security for autonerves 2026.11.19.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2026.11.19.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page