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
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You are working on the **autofit_workspace**, a tutorial/example repository for

## Testing

`run_scripts.sh` sets `PYAUTOFIT_TEST_MODE=1` automatically. Every script should pass in this mode. A script that fails in test mode indicates a real problem (broken import, wrong function name, etc.).
`run_scripts.sh` sets `PYAUTO_TEST_MODE=1` automatically. Every script should pass in this mode. A script that fails in test mode indicates a real problem (broken import, wrong function name, etc.).

## Notebook Generation

Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ python scripts/overview/overview_1_the_basics.py

## Testing

Set `PYAUTOFIT_TEST_MODE=1` so non-linear searches skip actual sampling (fast test run).
Set `PYAUTO_TEST_MODE=1` so non-linear searches skip actual sampling (fast test run).

Run all scripts:

```
bash run_scripts.sh
```

This sets `PYAUTOFIT_TEST_MODE=1` automatically, runs every script in `scripts/`, and reports pass/fail/skipped counts. Failure logs are written to `failed/<relative_path>.log`.
This sets `PYAUTO_TEST_MODE=1` automatically, runs every script in `scripts/`, and reports pass/fail/skipped counts. Failure logs are written to `failed/<relative_path>.log`.

### Script ordering

Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ python scripts/searches/nest/dynesty/uniform.py

## Testing All Scripts

`PYAUTOFIT_TEST_MODE=1` causes non-linear searches to skip actual sampling (fast test run).
`PYAUTO_TEST_MODE=1` causes non-linear searches to skip actual sampling (fast test run).

Run all scripts using the provided runner:

Expand All @@ -52,7 +52,7 @@ bash run_scripts.sh
To run a single script in test mode:

```
PYAUTOFIT_TEST_MODE=1 python3 scripts/overview/overview_1_the_basics.py
PYAUTO_TEST_MODE=1 python3 scripts/overview/overview_1_the_basics.py
```

After a full run, inspect failures:
Expand Down
11 changes: 7 additions & 4 deletions config/build/env_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
# - Patterns without '/' match the file stem exactly

defaults:
PYAUTOFIT_TEST_MODE: "2" # 0=normal, 1=reduced iterations, 2=skip sampler (fastest)
PYAUTO_WORKSPACE_SMALL_DATASETS: "1" # Cap grids/masks to 15x15, reduce MGE gaussians
PYAUTO_TEST_MODE: "2" # 0=normal, 1=reduced iterations, 2=skip sampler (fastest)
PYAUTO_SKIP_FIT_OUTPUT: "1" # Skip pre/post-fit I/O, VRAM profiling, result text
PYAUTO_SKIP_VISUALIZATION: "1" # Skip fit visualization and plotting
PYAUTO_SKIP_CHECKS: "1" # Skip mesh validation, position checks, weight thresholds
PYAUTO_SMALL_DATASETS: "1" # Cap grids/masks to 15x15, reduce MGE gaussians
PYAUTO_DISABLE_JAX: "1" # Force use_jax=False, avoid JIT compilation overhead
PYAUTO_FAST_PLOTS: "1" # Skip tight_layout() + critical curve/caustic overlays
JAX_ENABLE_X64: "True" # Enable 64-bit precision in JAX
Expand All @@ -21,6 +24,6 @@ overrides:
# Plotter scripts need the real search to run so `result.search_internal` is
# populated — bypass mode skips the sampler and returns None.
- pattern: "plot/EmceePlotter"
unset: [PYAUTOFIT_TEST_MODE]
unset: [PYAUTO_TEST_MODE, PYAUTO_SKIP_FIT_OUTPUT]
- pattern: "plot/ZeusPlotter"
unset: [PYAUTOFIT_TEST_MODE]
unset: [PYAUTO_TEST_MODE, PYAUTO_SKIP_FIT_OUTPUT]
9 changes: 6 additions & 3 deletions run_scripts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Run all scripts in scripts/ with PYAUTOFIT_TEST_MODE=1.
# Run all scripts in scripts/ with PYAUTO_TEST_MODE=1.
#
# Rules:
# - start_here.py in a folder runs before all other scripts and subfolders in that folder
Expand All @@ -12,8 +12,11 @@ FAILED_DIR="$SCRIPT_DIR/failed"
NO_RUN_YAML="$SCRIPT_DIR/../PyAutoBuild/autobuild/config/no_run.yaml"
PROJECT_KEY="autofit"

export PYAUTOFIT_TEST_MODE=1
export PYAUTO_WORKSPACE_SMALL_DATASETS=1
export PYAUTO_TEST_MODE=1
export PYAUTO_SKIP_FIT_OUTPUT=1
export PYAUTO_SKIP_VISUALIZATION=1
export PYAUTO_SKIP_CHECKS=1
export PYAUTO_SMALL_DATASETS=1
export PYAUTO_FAST_PLOTS=1

# ---------------------------------------------------------------------------
Expand Down