From 026466b62eea56c0676823e036a08f474f683f98 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 21:02:08 +0000 Subject: [PATCH 1/2] refactor: re-export autoconf config surface from library __init__ Expose the autoconf (Nerves) configuration/serialization surface as a deliberate public API of each science library, so workspaces and downstream code can `from autolens import conf` (and jax_wrapper, setup_colab, setup_notebook, fitsable, with_config, dictable/fitsable/test_mode helpers) rather than importing the `autoconf` package directly. This keeps the config layer an implementation detail behind the library namespace. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_013ciVftxvYpefh59wSkR7jN --- autofit/__init__.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/autofit/__init__.py b/autofit/__init__.py index cbde7a74d..ac6d4d1b2 100644 --- a/autofit/__init__.py +++ b/autofit/__init__.py @@ -148,4 +148,35 @@ def save_abc(pickler, obj): from autoconf import check_version -check_version(__version__) \ No newline at end of file +check_version(__version__) + +# --------------------------------------------------------------------------- +# Public re-export of the autoconf 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 +# 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 ( + output_to_fits, + hdu_list_for_output_from, + ndarray_via_fits_from, + ndarray_via_hdu_from, + header_obj_from, +) +from autoconf.test_mode import ( + with_test_mode_segment, + skip_visualization, + skip_fit_output, + skip_checks, + is_test_mode, + test_mode_level, +) From 17cda085c119b8102135517237f13c1ea8cb2e64 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 21:09:10 +0000 Subject: [PATCH 2/2] refactor: keep autofit's existing conf export, drop redundant re-bind autofit already exposes `conf` via `from . import conf`; the added re-export block re-bound it to `autoconf.conf`. Leave autofit's own conf binding intact and re-export only the remaining config/serialization names. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_013ciVftxvYpefh59wSkR7jN --- autofit/__init__.py | 65 +++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/autofit/__init__.py b/autofit/__init__.py index ac6d4d1b2..ae4516a37 100644 --- a/autofit/__init__.py +++ b/autofit/__init__.py @@ -148,35 +148,36 @@ def save_abc(pickler, obj): from autoconf import check_version -check_version(__version__) - -# --------------------------------------------------------------------------- -# Public re-export of the autoconf 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 -# 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 ( - output_to_fits, - hdu_list_for_output_from, - ndarray_via_fits_from, - ndarray_via_hdu_from, - header_obj_from, -) -from autoconf.test_mode import ( - with_test_mode_segment, - skip_visualization, - skip_fit_output, - skip_checks, - is_test_mode, - test_mode_level, -) +check_version(__version__) + +# --------------------------------------------------------------------------- +# Public re-export of the autoconf 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 +# layer stays an implementation detail of the library. +# --------------------------------------------------------------------------- +# ``conf`` is already exported above (``from . import conf``); the names below +# complete the surface. +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 ( + output_to_fits, + hdu_list_for_output_from, + ndarray_via_fits_from, + ndarray_via_hdu_from, + header_obj_from, +) +from autoconf.test_mode import ( + with_test_mode_segment, + skip_visualization, + skip_fit_output, + skip_checks, + is_test_mode, + test_mode_level, +)