Skip to content

Commit 56ac5b9

Browse files
Jammy2211claude
authored andcommitted
Add AI agent configs, contributing guide, and issue templates
- AGENTS.md, .github/copilot-instructions.md for AI agent support - CONTRIBUTING.md with AI-first workflow explanation and code example guidance - Issue templates for feature requests and bug reports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6709fc6 commit 56ac5b9

File tree

5 files changed

+223
-0
lines changed

5 files changed

+223
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug or unexpected behaviour
4+
title: 'fix: '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
<!-- Clear description of the bug -->
12+
13+
## Steps to Reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected Behaviour
20+
21+
<!-- What should happen -->
22+
23+
## Actual Behaviour
24+
25+
<!-- What actually happens -->
26+
27+
## Environment
28+
29+
- OS:
30+
- Python version:
31+
- Package version:
32+
33+
## Original Prompt
34+
35+
<details>
36+
<summary>Click to expand starting prompt</summary>
37+
38+
<!-- If this issue was created from an AI prompt, paste the original prompt here -->
39+
40+
</details>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Feature / Task Request
3+
about: Propose a new feature, improvement, or task
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Overview
10+
11+
<!-- 2-4 sentence summary of what this task is and why it matters -->
12+
13+
## Plan
14+
15+
<!-- High-level bullet-point plan, human readable, no code -->
16+
17+
<details>
18+
<summary>Detailed implementation plan</summary>
19+
20+
### Affected Repositories
21+
<!-- List repos this touches, mark primary -->
22+
23+
### Implementation Steps
24+
<!-- Step-by-step with file paths and specifics -->
25+
26+
### Key Files
27+
<!-- List files that will be modified -->
28+
29+
</details>
30+
31+
## Example Code
32+
33+
<!-- If your feature involves a specific calculation, algorithm, or small piece of functionality,
34+
include example code here. Even a rough script, a working prototype, or a snippet showing
35+
the existing behaviour you want changed helps enormously.
36+
37+
Code gives AI agents and human contributors concrete context and dramatically reduces
38+
misunderstandings. Delete this section if not applicable. -->
39+
40+
```python
41+
# Paste your example code here
42+
```
43+
44+
## Original Prompt
45+
46+
<details>
47+
<summary>Click to expand starting prompt</summary>
48+
49+
<!-- If this issue was created from an AI prompt, paste the original prompt here -->
50+
51+
</details>

.github/copilot-instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copilot Coding Agent Instructions
2+
3+
You are working on **PyAutoArray**, the low-level data structures and numerical utilities package for the PyAuto ecosystem.
4+
5+
## Key Rules
6+
7+
- Run tests after every change: `python -m pytest test_autoarray/`
8+
- Format code with `black autoarray/`
9+
- All files must use Unix line endings (LF, `\n`)
10+
- Decorated functions (`@to_array`, `@to_grid`, `@to_vector_yx`) must return **raw arrays**, not autoarray wrappers
11+
- The `xp` parameter controls NumPy (`xp=np`) vs JAX (`xp=jnp`) — never import JAX at module level
12+
- If changing public API, clearly document what changed in your PR description — downstream packages depend on this
13+
14+
## Architecture
15+
16+
- `autoarray/structures/``Array2D`, `Grid2D`, `Grid2DIrregular`, `VectorYX2D`, decorators
17+
- `autoarray/dataset/``Imaging`, `Interferometer` containers
18+
- `autoarray/inversion/` — Pixelization and linear inversion machinery
19+
- `autoarray/operators/``Convolver`, over-sampling utilities
20+
- `test_autoarray/` — Test suite
21+
22+
## Sandboxed runs
23+
24+
```bash
25+
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autoarray/
26+
```

AGENTS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# PyAutoArray — Agent Instructions
2+
3+
**PyAutoArray** is the low-level data structures and numerical utilities package for the PyAuto ecosystem. It provides grids, masks, arrays, datasets, inversions, and the decorator system used throughout PyAutoGalaxy and PyAutoLens.
4+
5+
## Setup
6+
7+
```bash
8+
pip install -e ".[dev]"
9+
```
10+
11+
## Running Tests
12+
13+
```bash
14+
python -m pytest test_autoarray/
15+
python -m pytest test_autoarray/structures/test_arrays.py
16+
python -m pytest test_autoarray/structures/test_arrays.py -s
17+
```
18+
19+
### Sandboxed / Codex runs
20+
21+
```bash
22+
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autoarray/
23+
```
24+
25+
## Key Architecture
26+
27+
- **Data structures**: `Array2D`, `Grid2D`, `Grid2DIrregular`, `VectorYX2D` — all inherit from `AbstractNDArray`
28+
- **Decorator system** (`structures/decorators/`): `@to_array`, `@to_grid`, `@to_vector_yx`, `@transform` — ensures output type matches input grid type
29+
- **Datasets**: `Imaging`, `Interferometer` — containers for observational data
30+
- **Inversions** (`inversion/`): sparse linear algebra for source reconstruction via pixelizations
31+
- **Operators**: `Convolver` (PSF convolution), over-sampling utilities
32+
33+
## Key Rules
34+
35+
- The `xp` parameter pattern controls NumPy vs JAX: `xp=np` (default) or `xp=jnp`
36+
- Autoarray types are **not** JAX pytrees — they cannot be returned from `jax.jit` functions
37+
- Decorated functions must return **raw arrays**, not autoarray wrappers
38+
- All files must use Unix line endings (LF)
39+
- Format with `black autoarray/`
40+
41+
## Working on Issues
42+
43+
1. Read the issue description and any linked plan.
44+
2. Identify affected files and write your changes.
45+
3. Run the full test suite: `python -m pytest test_autoarray/`
46+
4. Ensure all tests pass before opening a PR.
47+
5. If changing public API, note the change in your PR description — downstream packages (PyAutoGalaxy, PyAutoLens) and workspaces may need updates.

CONTRIBUTING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# AI-Assisted Development
2+
3+
This project uses an AI-first development workflow. Most features, bug fixes, and improvements are implemented through AI coding agents (Claude Code, GitHub Copilot, OpenAI Codex) working from structured issue descriptions.
4+
5+
## How It Works
6+
7+
1. **Issues are the starting point** — Every task begins as a GitHub issue with a structured format: an overview, a human-readable plan, a detailed implementation plan (in a collapsible block), and optionally the original prompt that generated the issue.
8+
9+
2. **AI agents pick up issues** — Issues can be assigned to AI coding agents (e.g. GitHub Copilot) which read the issue description, `AGENTS.md`, and `CLAUDE.md` for context, then implement the changes autonomously.
10+
11+
3. **Human review** — All AI-generated pull requests are reviewed by maintainers before merging.
12+
13+
## Creating an Issue
14+
15+
When opening an issue, please use the provided issue templates. The **Feature / Task Request** template follows our standard format:
16+
17+
- **Overview** — What and why, in 2-4 sentences
18+
- **Plan** — High-level bullet points (human-readable)
19+
- **Detailed implementation plan** — File paths, steps, key files (in a collapsible block)
20+
- **Original Prompt** — If you used an AI to help draft the issue, include the original prompt
21+
22+
If your feature involves a specific calculation, algorithm, or small piece of functionality — **include example code**. Even a rough script, a working prototype, or a snippet showing the existing behaviour you want to change makes a huge difference. Code examples give AI agents and human contributors concrete context to work from, and dramatically reduce misunderstandings about what you're asking for.
23+
24+
This structure ensures that both human contributors and AI agents can understand and act on the issue effectively.
25+
26+
## Contributing Without AI
27+
28+
Traditional contributions are equally welcome! If you prefer to work without AI tools, simply follow the development setup and pull request guidelines below. The issue templates are helpful for any contributor, AI or human.
29+
30+
---
31+
32+
# Contributing
33+
34+
Contributions are welcome and greatly appreciated!
35+
36+
## Getting Started
37+
38+
1. Install from source:
39+
```
40+
pip install -e ".[dev]"
41+
```
42+
43+
2. Create a feature branch:
44+
```
45+
git checkout -b feature/name-of-your-branch
46+
```
47+
48+
3. Make your changes and run tests:
49+
```
50+
python -m pytest test_autoarray/
51+
```
52+
53+
4. Commit, push, and submit a pull request.
54+
55+
### Pull Request Guidelines
56+
57+
1. The pull request should include tests for new functionality.
58+
2. If the pull request adds functionality, update docs accordingly.
59+
3. If changing public API, clearly document what changed — downstream packages depend on this.

0 commit comments

Comments
 (0)