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
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ numerical-utility layer: masks, arrays, (y,x) grids, imaging/interferometer
datasets, inversions/pixelizations, convolution/over-sampling operators, and
the grid decorators used throughout PyAutoGalaxy and PyAutoLens.

Dependency direction: autoarray depends on **autoconf** only. It does **not**
Dependency direction: autoarray depends on **autonerves** only. It does **not**
import `autofit`, `autogalaxy`, or `autolens` — never add such an import.
Shared utilities (e.g. `test_mode`, `jax_wrapper`) belong in autoconf.
Shared utilities (e.g. `test_mode`, `jax_wrapper`) belong in autonerves.

## Related repos

Expand Down Expand Up @@ -55,7 +55,7 @@ is no black/ruff/flake8 gate — formatting is advisory. (`requires-python` in

## Configuration & defaults

autoconf supplies the packaged defaults under `autoarray/config/`. Workspaces
autonerves supplies the packaged defaults under `autoarray/config/`. Workspaces
override them via their own `config/` directory; the test suite pushes a local
config dir via `conf.instance.push(...)` in `test_autoarray/conftest.py`. When
a change adds a new config key, mirror it into the packaged defaults so
Expand Down Expand Up @@ -97,7 +97,7 @@ from `AbstractNDArray`; `.array` returns the raw `numpy.ndarray` / `jax.Array`.

## Key rules / footguns

- Import direction: autoconf only — never `autofit` / `autogalaxy` / `autolens`.
- Import direction: autonerves only — never `autofit` / `autogalaxy` / `autolens`.
- Grid-consuming functions decorated with `@aa.decorators.to_array` / `to_grid`
/ `to_vector_yx` must return a **raw array** — the decorator wraps it. (Write
`aa.decorators.*`; `aa.grid_dec` is a deprecated alias.)
Expand Down
40 changes: 20 additions & 20 deletions autoarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from autoconf import jax_wrapper
from autoconf.dictable import register_parser
from autoconf import conf
from autonerves import jax_wrapper
from autonerves.dictable import register_parser
from autonerves import conf

conf.instance.register(__file__)

Expand Down Expand Up @@ -97,40 +97,40 @@
from .structures.visibilities import Visibilities
from .structures.visibilities import VisibilitiesNoiseMap

from autoconf import conf
from autoconf.fitsable import ndarray_via_hdu_from
from autoconf.fitsable import ndarray_via_fits_from
from autoconf.fitsable import header_obj_from
from autoconf.fitsable import output_to_fits
from autoconf.fitsable import hdu_list_for_output_from
from autonerves import conf
from autonerves.fitsable import ndarray_via_hdu_from
from autonerves.fitsable import ndarray_via_fits_from
from autonerves.fitsable import header_obj_from
from autonerves.fitsable import output_to_fits
from autonerves.fitsable import hdu_list_for_output_from

conf.instance.register(__file__)

__version__ = "2026.7.9.1"

# ---------------------------------------------------------------------------
# Public re-export of the autoconf configuration / serialization surface.
# Public re-export of the autonerves configuration / serialization surface.
#
# Workspaces, tutorials and downstream code import these names from the science
# library (e.g. ``from autolens import conf``) rather than depending on the
# ``autoconf`` package directly, so the underlying configuration / serialization
# ``autonerves`` package directly, so the underlying configuration / serialization
# layer stays an implementation detail of the library.
# ---------------------------------------------------------------------------
from autoconf import conf
from autoconf import jax_wrapper
from autoconf import fitsable
from autoconf import setup_colab
from autoconf import setup_notebook
from autoconf.conf import with_config
from autoconf.dictable import from_dict, from_json, to_dict, output_to_json
from autoconf.fitsable import (
from autonerves import conf
from autonerves import jax_wrapper
from autonerves import fitsable
from autonerves import setup_colab
from autonerves import setup_notebook
from autonerves.conf import with_config
from autonerves.dictable import from_dict, from_json, to_dict, output_to_json
from autonerves.fitsable import (
output_to_fits,
hdu_list_for_output_from,
ndarray_via_fits_from,
ndarray_via_hdu_from,
header_obj_from,
)
from autoconf.test_mode import (
from autonerves.test_mode import (
with_test_mode_segment,
skip_visualization,
skip_fit_output,
Expand Down
12 changes: 6 additions & 6 deletions autoarray/abstract_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if TYPE_CHECKING:
from autoarray.structures.abstract_structure import Structure

from autoconf import conf
from autonerves import conf


def to_new_array(func):
Expand Down Expand Up @@ -66,7 +66,7 @@ def wrapper(self, other):


def _register_as_pytree(cls):
"""Register ``cls`` with ``jax.tree_util`` via the lazy autoconf wrapper.
"""Register ``cls`` with ``jax.tree_util`` via the lazy autonerves wrapper.

Gated: only called when a subclass instance is constructed on the JAX path
(``xp is not np``). The registration is class-scoped via
Expand All @@ -75,7 +75,7 @@ def _register_as_pytree(cls):
"""
if cls in _pytree_registered_classes:
return
from autoconf.jax_wrapper import register_pytree_node
from autonerves.jax_wrapper import register_pytree_node

register_pytree_node(cls, cls.instance_flatten, cls.instance_unflatten)
_pytree_registered_classes.add(cls)
Expand All @@ -101,8 +101,8 @@ def register_instance_pytree(cls, no_flatten=()):
"""
if cls in _pytree_registered_classes:
return
from autoconf.jax_wrapper import register_pytree_node
from autoconf.tools.decorators import cached_property_names
from autonerves.jax_wrapper import register_pytree_node
from autonerves.tools.decorators import cached_property_names

# Extend the caller-supplied no_flatten set with every
# ``cached_property``-style descriptor on ``cls`` so derived caches
Expand Down Expand Up @@ -180,7 +180,7 @@ def instance_flatten(cls, instance):
"""
Flatten an instance of an autoarray class into a tuple of its attributes (i.e.. a pytree)
"""
from autoconf.tools.decorators import cached_property_names
from autonerves.tools.decorators import cached_property_names

# Union the class-level ``__no_flatten__`` opt-out with any
# ``cached_property`` descriptor names so derived caches don't
Expand Down
4 changes: 2 additions & 2 deletions autoarray/dataset/interferometer/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import numpy as np
from typing import Optional

from autoconf.fitsable import ndarray_via_fits_from
from autoconf import cached_property
from autonerves.fitsable import ndarray_via_fits_from
from autonerves import cached_property

from autoarray.dataset.abstract.dataset import AbstractDataset
from autoarray.dataset.grids import GridsDataset
Expand Down
2 changes: 1 addition & 1 deletion autoarray/dataset/plot/imaging_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def fits_imaging(
overwrite : bool
If ``True`` existing files are replaced.
"""
from autoconf.fitsable import output_to_fits, hdu_list_for_output_from, write_hdu_list
from autonerves.fitsable import output_to_fits, hdu_list_for_output_from, write_hdu_list

header_dict = dataset.data.mask.header_dict if hasattr(dataset.data.mask, "header_dict") else None

Expand Down
2 changes: 1 addition & 1 deletion autoarray/dataset/plot/interferometer_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def fits_interferometer(
overwrite : bool
If ``True`` existing files are replaced.
"""
from autoconf.fitsable import output_to_fits, hdu_list_for_output_from, write_hdu_list
from autonerves.fitsable import output_to_fits, hdu_list_for_output_from, write_hdu_list

if file_path is not None:
values_list = []
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/inversion/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from typing import Dict, List, Optional, Type, Union

from autoconf import cached_property, is_test_mode
from autonerves import cached_property, is_test_mode

from autoarray.dataset.imaging.dataset import Imaging
from autoarray.dataset.interferometer.dataset import Interferometer
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/inversion/imaging/mapping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from typing import Dict, List, Optional, Union

from autoconf import cached_property
from autonerves import cached_property

from autoarray.dataset.imaging.dataset import Imaging
from autoarray.inversion.inversion.dataset_interface import DatasetInterface
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/inversion/imaging/sparse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from typing import Dict, List, Optional, Union

from autoconf import cached_property
from autonerves import cached_property

from autoarray.dataset.imaging.dataset import Imaging
from autoarray.inversion.inversion.dataset_interface import DatasetInterface
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/inversion/imaging_numba/sparse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from typing import Dict, List, Optional, Union

from autoconf import cached_property
from autonerves import cached_property

from autoarray.dataset.imaging.dataset import Imaging
from autoarray.inversion.inversion.dataset_interface import DatasetInterface
Expand Down
4 changes: 2 additions & 2 deletions autoarray/inversion/inversion/inversion_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import List, Optional, Type

from autoconf import is_test_mode
from autonerves import is_test_mode

from autoarray.settings import Settings

Expand Down Expand Up @@ -288,7 +288,7 @@ def reconstruction_positive_only_from(
"""
if xp.__name__.startswith("jax"):

from autoconf import conf
from autonerves import conf

from autoarray.util.jax_nnls import solve_nnls_primal

Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/linear_obj/func_list.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from typing import Optional

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.linear_obj.linear_obj import LinearObj
from autoarray.inversion.linear_obj.neighbors import Neighbors
Expand Down
4 changes: 2 additions & 2 deletions autoarray/inversion/mappers/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import numpy as np
from typing import List, Optional, Tuple

from autoconf import conf
from autoconf import cached_property
from autonerves import conf
from autonerves import cached_property

from autoarray.inversion.linear_obj.linear_obj import LinearObj
from autoarray.inversion.linear_obj.func_list import UniqueMappings
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/mesh/border_relocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
from typing import Tuple, Union

from autoconf import cached_property
from autonerves import cached_property

from autoarray.mask.mask_2d import Mask2D
from autoarray.structures.arrays.uniform_2d import Array2D
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/mesh/image_mesh/hilbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from autoarray.structures.grids.irregular_2d import Grid2DIrregular

from autoarray import exc
from autoconf.test_mode import skip_checks
from autonerves.test_mode import skip_checks


def gilbert2d(width, height):
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/mesh/interpolator/delaunay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.abstract import AbstractInterpolator
from autoarray.inversion.regularization.regularization_util import (
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/mesh/interpolator/knn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.delaunay import InterpolatorDelaunay

Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/mesh/interpolator/rectangular.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from functools import partial

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.abstract import AbstractInterpolator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from functools import partial
from typing import Optional

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.rectangular import (
InterpolatorRectangular,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import numpy as np

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.rectangular_spline import (
SPLINE_CDF_DEFAULT_DEG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import numpy as np

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.abstract import AbstractInterpolator
from autoarray.inversion.mesh.interpolator.rectangular import InterpolatorRectangular
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Tuple
import numpy as np

from autoconf import cached_property
from autonerves import cached_property

from autoarray.inversion.mesh.interpolator.abstract import AbstractInterpolator
from autoarray.geometry.geometry_2d import Geometry2D
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/mesh/mesh_geometry/delaunay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import scipy.spatial
from typing import Tuple

from autoconf import cached_property
from autonerves import cached_property

from autoarray.geometry.geometry_2d_irregular import Geometry2DIrregular
from autoarray.inversion.linear_obj.neighbors import Neighbors
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/plot/inversion_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import Optional, Union

from autoconf import conf
from autonerves import conf

from autoarray.inversion.mappers.abstract import Mapper
from autoarray.plot.array import plot_array
Expand Down
4 changes: 2 additions & 2 deletions autoarray/mask/mask_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List, Tuple, Union

from autoconf import cached_property
from autonerves import cached_property

from autoarray.structures.abstract_structure import Structure

if TYPE_CHECKING:
from autoarray.structures.arrays.uniform_2d import Array2D


from autoconf.fitsable import ndarray_via_fits_from
from autonerves.fitsable import ndarray_via_fits_from

from autoarray.mask.abstract_mask import Mask

Expand Down
2 changes: 1 addition & 1 deletion autoarray/numba_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from autoconf import conf
from autonerves import conf


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion autoarray/operators/convolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Optional, Tuple, Union
import warnings

from autoconf import conf
from autonerves import conf
from autoarray.structures.arrays.uniform_2d import Array2D
from autoarray.structures.grids.uniform_2d import Grid2D

Expand Down
4 changes: 2 additions & 2 deletions autoarray/operators/over_sampling/over_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import Union

from autoconf import conf
from autoconf import cached_property
from autonerves import conf
from autonerves import cached_property

from autoarray.mask.mask_2d import Mask2D
from autoarray.structures.arrays.uniform_2d import Array2D
Expand Down
2 changes: 1 addition & 1 deletion autoarray/plot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def _set_backend():
try:
import matplotlib
from autoconf import conf
from autonerves import conf

backend = conf.get_matplotlib_backend()
if backend != "default":
Expand Down
Loading
Loading