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
32 changes: 21 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,31 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
pip install -e ".[dev]"
```

### Run Tests
```bash
# All tests
python -m pytest test_autolens/
### Run Tests
```bash
# All tests
python -m pytest test_autolens/

# Single test file
python -m pytest test_autolens/lens/test_tracer.py

# With output
python -m pytest test_autolens/imaging/test_fit_imaging.py -s
```

### Formatting
```bash
black autolens/
# With output
python -m pytest test_autolens/imaging/test_fit_imaging.py -s
```

### Codex / sandboxed runs

When running Python from Codex or any restricted environment, set writable cache directories so `numba` and `matplotlib` do not fail on unwritable home or source-tree paths:

```bash
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autolens/
```

This workspace is often imported from `/mnt/c/...` and Codex may not be able to write to module `__pycache__` directories or `/home/jammy/.cache`, which can cause import-time `numba` caching failures without this override.

### Formatting
```bash
black autolens/
```

## Architecture
Expand Down
6 changes: 4 additions & 2 deletions autolens/point/solver/point_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import logging
from typing import Tuple, Optional

import numpy as np
import autoarray as aa
from autoarray.structures.triangles.shape import Point

Expand Down Expand Up @@ -66,7 +67,8 @@ def solve(

Returns
-------
A list of image plane coordinates that are traced to the source plane coordinate.
A ``Grid2DIrregular`` of image-plane coordinates, always numpy-backed even when the
solver uses a JAX backend internally.
"""
kept_triangles = super().solve_triangles(
tracer=tracer,
Expand All @@ -90,4 +92,4 @@ def solve(

solution = solution[~self._xp.isinf(solution).any(axis=1)]

return aa.Grid2DIrregular(solution)
return aa.Grid2DIrregular(np.asarray(solution))
Loading