Skip to content

Commit 927c199

Browse files
authored
Merge pull request #21 from John-Ragland/claudemd
added claude.md
2 parents f744f61 + 7b6422a commit 927c199

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# PyGenRay
2+
3+
Python package for simulated 2D ray-based acoustic propagation modeling in underwater environments, designed for acoustic tomography applications.
4+
5+
## Environment
6+
7+
Use `uv` for all environment and package management — never `pip` or `python` directly.
8+
9+
```bash
10+
uv sync --group dev # install with dev dependencies
11+
uv run pytest tests/ # run tests
12+
```
13+
14+
## Testing
15+
16+
```bash
17+
uv run pytest tests/ # full suite
18+
uv run pytest tests/ --cov=pygenray # with coverage
19+
uv run pytest --regenerate-physics tests/ # regenerate physics regression fixtures
20+
```
21+
22+
## Architecture
23+
24+
Source lives in `src/pygenray/`. Key modules:
25+
26+
- `environment.py``OceanEnvironment2D`, sound speed profiles (e.g. `munk_ssp()`)
27+
- `launch_rays.py``shoot_rays()` (fan, parallel), `shoot_ray()` (single)
28+
- `ray_objects.py``Ray` and `RayFan` data classes with plotting methods
29+
- `eigenrays.py``find_eigenrays()` using regula falsi root-finding
30+
- `integration_processes.py` — core ray ODEs (`derivsrd()`), Numba JIT-compiled
31+
32+
## Coordinate Convention
33+
34+
There is a sign flip between the user-facing API and internal ODE integration:
35+
36+
- **User-facing:** positive `z` = downward (ocean depth), positive launch angle = toward surface
37+
- **Internal ODE:** negative `z` convention
38+
39+
Respect this distinction when modifying ray integration or `Ray`/`RayFan` attribute handling.
40+
41+
## Performance
42+
43+
`derivsrd()` in `integration_processes.py` is JIT-compiled with Numba (`fastmath=True`). Avoid introducing pure-Python loops in hot paths. `shoot_rays()` uses multiprocessing — be careful with shared state.

0 commit comments

Comments
 (0)