Skip to content

Commit ba67bec

Browse files
author
Mihou
committed
refactor(examples): move numbered examples into scripts
1 parent 18e569f commit ba67bec

10 files changed

Lines changed: 11 additions & 5 deletions

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ Run the demo code:
127127
python 0_hello_geolens.py
128128
```
129129

130+
Additional examples are in [`scripts/`](scripts/). Run them from the repository root as modules:
131+
132+
```bash
133+
python -m scripts.1_design_geolens
134+
```
135+
130136
## In-House Extensions
131137

132138
The modules below are implemented and working in house, but are not part of the public release yet. If your project needs one, get in touch and we are happy to grant access or collaborate.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def config():
7777
yaml.dump(args, f)
7878

7979
with open(f"{result_dir}/1_design_hybridlens.py", "w") as f:
80-
with open("1_design_hybridlens.py", "r") as code:
80+
with open(__file__, "r") as code:
8181
f.write(code.read())
8282

8383
return args
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def config():
6060
yaml.dump(args, f)
6161

6262
with open(f"{result_dir}/2_autolens_rms.py", "w") as f:
63-
with open("2_autolens_rms.py", "r") as code:
63+
with open(__file__, "r") as code:
6464
f.write(code.read())
6565

6666
return args
File renamed without changes.

4f_system.py renamed to scripts/4f_system.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
stopped down to ``APERTURE_MM`` via ``point_wave(valid_r=...)`` -- keeping every
2424
surface well-sampled while still resolving the Airy spot and the DOE's blur.
2525
26-
Run:
27-
python 4f_system.py # default device (CUDA on the GPU machine)
28-
python 4f_system.py cpu # force CPU (local smoke test)
26+
Run from the repository root:
27+
python -m scripts.4f_system # default device (CUDA on the GPU machine)
28+
python -m scripts.4f_system cpu # force CPU (local smoke test)
2929
"""
3030

3131
import os

0 commit comments

Comments
 (0)