From cd809b7c301a1bac95f9530b921ab5aa56ba07bc Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 23 Jun 2026 09:00:02 +0100 Subject: [PATCH 1/2] docs: consolidate PyAutoLens agent instructions into canonical AGENTS.md Replace the duplicated Key Rules / Architecture / sandbox content in .github/copilot-instructions.md with a thin pointer to AGENTS.md, the single source of truth. CLAUDE.md already @-imports AGENTS.md; this brings the Copilot instructions to the same convention and drops slightly stale decorator names (@to_array/@to_grid/@to_vector_yx) in favour of AGENTS.md's accurate aa.decorators.* guidance. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/copilot-instructions.md | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 1f610bf69..b104143fb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,27 +1,9 @@ # Copilot Coding Agent Instructions -You are working on **PyAutoLens**, a Python library for strong gravitational lens modeling built on PyAutoGalaxy. +You are working on **PyAutoLens**, a Python library for strong gravitational lens +modeling built on PyAutoGalaxy. -## Key Rules - -- Run tests after every change: `python -m pytest test_autolens/` -- Format code with `black autolens/` -- All files must use Unix line endings (LF, `\n`) -- Decorated functions (`@to_array`, `@to_grid`, `@to_vector_yx`) must return **raw arrays**, not autoarray wrappers -- The `xp` parameter controls NumPy (`xp=np`) vs JAX (`xp=jnp`) — never import JAX at module level -- Functions called inside `jax.jit` must guard autoarray wrapping with `if xp is np:` -- If changing public API, clearly document what changed in your PR description — downstream workspaces depend on this - -## Architecture - -- `autolens/lens/` — `Tracer`, multi-plane ray-tracing, deflection logic -- `autolens/imaging/`, `interferometer/`, `point/` — Dataset-specific fit and analysis classes -- `autolens/plot/` — Visualisation for all data types -- `autolens/aggregator/` — Results scraping -- `test_autolens/` — Test suite - -## Sandboxed runs - -```bash -NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autolens/ -``` +The canonical, agent-agnostic instructions for this repo live in **`AGENTS.md`** at +the repository root — build and test commands, architecture, the JAX / `xp` backend +pattern, and the decorator conventions. Read it directly (Copilot does not process +`@`-imports) and treat it as the single source of truth. From a923f7d4453c1abcac8b70c2f7f623a9bfdc03f3 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 23 Jun 2026 09:00:18 +0100 Subject: [PATCH 2/2] docs: add signpost llms.txt routing to docs, workspace and HowToLens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thin front-door llms.txt at the repo root following the llms.txt convention (H1 + blockquote summary, then sections of one-line links). It only points — no source-tree catalogue, no AGENTS.md/docs duplication — routing an LLM by intent: use the API (workspace navigator), learn lensing (HowToLens), read the docs (ReadTheDocs), work on the library (AGENTS.md), or follow the upstream ecosystem repos. Co-Authored-By: Claude Opus 4.8 (1M context) --- llms.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 llms.txt diff --git a/llms.txt b/llms.txt new file mode 100644 index 000000000..8bc7b2046 --- /dev/null +++ b/llms.txt @@ -0,0 +1,20 @@ +# PyAutoLens + +> PyAutoLens (package `autolens`) is the open-source strong gravitational-lensing modelling library, built on PyAutoGalaxy and using JAX to accelerate lens modelling on GPUs. This file is a signpost: it points you to the right ecosystem resource depending on your intent — use the API, learn lensing, or work on the library itself. + +## Use it (examples & tutorials) + +- [autolens_workspace navigator](https://github.com/PyAutoLabs/autolens_workspace/blob/main/llms.txt): end-to-end example scripts and notebooks per science case — the paste-friendly task router. Send any "how do I model / simulate / analyse X?" question here. +- [HowToLens](https://github.com/PyAutoLabs/HowToLens): from-first-principles lecture series for beginners new to gravitational lensing. + +## API reference & docs + +- [PyAutoLens documentation (ReadTheDocs)](https://pyautolens.readthedocs.io/en/latest/): API reference, feature overviews, and the installation guide. + +## Work on PyAutoLens itself (contributors / coding agents) + +- [AGENTS.md](./AGENTS.md): build, tests, architecture, and the JAX / decorator conventions. + +## Ecosystem (libraries this builds on) + +- [PyAutoGalaxy](https://github.com/PyAutoLabs/PyAutoGalaxy), [PyAutoArray](https://github.com/PyAutoLabs/PyAutoArray), [PyAutoFit](https://github.com/PyAutoLabs/PyAutoFit), [PyAutoConf](https://github.com/PyAutoLabs/PyAutoConf): the upstream layers PyAutoLens is built on.