RayCrafter 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- raycrafter-0.0.1/.github/workflows/test_and_deploy.yml +71 -0
- raycrafter-0.0.1/.gitignore +86 -0
- raycrafter-0.0.1/CLAUDE.md +110 -0
- raycrafter-0.0.1/LICENSE +21 -0
- raycrafter-0.0.1/MANIFEST.in +8 -0
- raycrafter-0.0.1/PKG-INFO +68 -0
- raycrafter-0.0.1/README.md +32 -0
- raycrafter-0.0.1/RayCrafter.egg-info/PKG-INFO +68 -0
- raycrafter-0.0.1/RayCrafter.egg-info/SOURCES.txt +44 -0
- raycrafter-0.0.1/RayCrafter.egg-info/dependency_links.txt +1 -0
- raycrafter-0.0.1/RayCrafter.egg-info/entry_points.txt +2 -0
- raycrafter-0.0.1/RayCrafter.egg-info/requires.txt +16 -0
- raycrafter-0.0.1/RayCrafter.egg-info/scm_file_list.json +51 -0
- raycrafter-0.0.1/RayCrafter.egg-info/scm_version.json +8 -0
- raycrafter-0.0.1/RayCrafter.egg-info/top_level.txt +1 -0
- raycrafter-0.0.1/log.md +88 -0
- raycrafter-0.0.1/pyproject.toml +144 -0
- raycrafter-0.0.1/raycrafter/__init__.py +7 -0
- raycrafter-0.0.1/raycrafter/__main__.py +5 -0
- raycrafter-0.0.1/raycrafter/core/__init__.py +5 -0
- raycrafter-0.0.1/raycrafter/core/analysis.py +420 -0
- raycrafter-0.0.1/raycrafter/core/model.py +306 -0
- raycrafter-0.0.1/raycrafter/core/optic_builder.py +110 -0
- raycrafter-0.0.1/raycrafter/core/plot_geometry.py +93 -0
- raycrafter-0.0.1/raycrafter/core/prescription.py +118 -0
- raycrafter-0.0.1/raycrafter/core/state.py +111 -0
- raycrafter-0.0.1/raycrafter/gui/__init__.py +1 -0
- raycrafter-0.0.1/raycrafter/gui/analysis_panels.py +260 -0
- raycrafter-0.0.1/raycrafter/gui/app.py +24 -0
- raycrafter-0.0.1/raycrafter/gui/main_window.py +483 -0
- raycrafter-0.0.1/raycrafter/gui/side_view.py +468 -0
- raycrafter-0.0.1/raycrafter/gui/style.py +183 -0
- raycrafter-0.0.1/raycrafter/lenscatalog/__init__.py +1 -0
- raycrafter-0.0.1/raycrafter/lenscatalog/catalog.py +103 -0
- raycrafter-0.0.1/raycrafter/lenscatalog/data/thorlabs_achromats.json +544 -0
- raycrafter-0.0.1/raycrafter/lenscatalog/thorlabs.py +85 -0
- raycrafter-0.0.1/raycrafter/palette.py +22 -0
- raycrafter-0.0.1/raycrafter/report/__init__.py +5 -0
- raycrafter-0.0.1/raycrafter/report/assets/report.css +49 -0
- raycrafter-0.0.1/raycrafter/report/assets/report.js +57 -0
- raycrafter-0.0.1/raycrafter/report/explanations.py +73 -0
- raycrafter-0.0.1/raycrafter/report/figures.py +286 -0
- raycrafter-0.0.1/raycrafter/report/html_report.py +209 -0
- raycrafter-0.0.1/scripts/make_thorlabs_subset.py +59 -0
- raycrafter-0.0.1/setup.cfg +4 -0
- raycrafter-0.0.1/uv.lock +2229 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- '*'
|
|
7
|
+
tags:
|
|
8
|
+
- '*'
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
linting:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: neuroinformatics-unit/actions/lint@v2
|
|
16
|
+
|
|
17
|
+
test:
|
|
18
|
+
needs: [linting]
|
|
19
|
+
name: ${{ matrix.os }} py${{ matrix.python-version }}
|
|
20
|
+
runs-on: ${{ matrix.os }}
|
|
21
|
+
strategy:
|
|
22
|
+
matrix:
|
|
23
|
+
# Early development: one Python version on Linux only. The wider matrix (all supported
|
|
24
|
+
# Python versions, macOS and Windows) comes back before the first non-preview release.
|
|
25
|
+
python-version: ["3.12"]
|
|
26
|
+
os: [ubuntu-latest]
|
|
27
|
+
# include:
|
|
28
|
+
# - os: macos-latest
|
|
29
|
+
# python-version: "3.13"
|
|
30
|
+
# - os: windows-latest
|
|
31
|
+
# python-version: "3.13"
|
|
32
|
+
|
|
33
|
+
# The GUI tests run Qt off screen, so no display (XVFB) is needed, but Qt still needs
|
|
34
|
+
# these system libraries, which the Ubuntu runner does not have.
|
|
35
|
+
env:
|
|
36
|
+
QT_QPA_PLATFORM: offscreen
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- name: Install Qt system libraries
|
|
40
|
+
if: runner.os == 'Linux'
|
|
41
|
+
run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1 libxkbcommon0 libfontconfig1 libdbus-1-3
|
|
42
|
+
|
|
43
|
+
# Run tests
|
|
44
|
+
- uses: neuroinformatics-unit/actions/test@v2
|
|
45
|
+
with:
|
|
46
|
+
python-version: ${{ matrix.python-version }}
|
|
47
|
+
|
|
48
|
+
build_sdist_wheels:
|
|
49
|
+
name: Build source distribution
|
|
50
|
+
needs: [test]
|
|
51
|
+
if: github.event_name == 'push' && github.ref_type == 'tag'
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
upload_all:
|
|
58
|
+
name: Publish build distributions
|
|
59
|
+
needs: [build_sdist_wheels]
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
environment: # use Trusted Publisher route
|
|
62
|
+
name: pypi
|
|
63
|
+
url: https://pypi.org/p/${{ github.event.repository.name }}
|
|
64
|
+
permissions:
|
|
65
|
+
id-token: write # mandatory for trusted publishing
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/download-artifact@v8
|
|
68
|
+
with:
|
|
69
|
+
name: artifact
|
|
70
|
+
path: dist
|
|
71
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
|
|
27
|
+
# PyInstaller
|
|
28
|
+
# Usually these files are written by a python script from a template
|
|
29
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.coverage.*
|
|
42
|
+
.cache
|
|
43
|
+
nosetests.xml
|
|
44
|
+
coverage.xml
|
|
45
|
+
*,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
|
|
48
|
+
# Translations
|
|
49
|
+
*.mo
|
|
50
|
+
*.pot
|
|
51
|
+
|
|
52
|
+
# Django stuff:
|
|
53
|
+
*.log
|
|
54
|
+
local_settings.py
|
|
55
|
+
|
|
56
|
+
# Flask instance folder
|
|
57
|
+
instance/
|
|
58
|
+
|
|
59
|
+
# Sphinx documentation
|
|
60
|
+
docs/_build/
|
|
61
|
+
|
|
62
|
+
# MkDocs documentation
|
|
63
|
+
/site/
|
|
64
|
+
|
|
65
|
+
# PyBuilder
|
|
66
|
+
target/
|
|
67
|
+
|
|
68
|
+
# Pycharm and VSCode
|
|
69
|
+
.idea/
|
|
70
|
+
venv/
|
|
71
|
+
.vscode/
|
|
72
|
+
|
|
73
|
+
# IPython Notebook
|
|
74
|
+
.ipynb_checkpoints
|
|
75
|
+
|
|
76
|
+
# pyenv
|
|
77
|
+
.python-version
|
|
78
|
+
|
|
79
|
+
# OS
|
|
80
|
+
.DS_Store
|
|
81
|
+
|
|
82
|
+
# written by setuptools-scm
|
|
83
|
+
**/_version.py
|
|
84
|
+
|
|
85
|
+
# uv virtual environment (normally kept outside Dropbox, see CLAUDE.md)
|
|
86
|
+
.venv/
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# RayCrafter: instructions for coding agents (and humans)
|
|
2
|
+
|
|
3
|
+
RayCrafter is a lens-level optical design tool: users place off-the-shelf lenses on an optical
|
|
4
|
+
axis and see spots, MTF, aberrations and so on update live. Optiland does the optics. The code
|
|
5
|
+
is written mainly by coding agents, but it must be readable and maintainable by people who use
|
|
6
|
+
little or no AI. If something would confuse a careful human reader, it is wrong.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Architecture rules
|
|
10
|
+
|
|
11
|
+
- **`raycrafter.core` never imports Qt.** It holds the optical model and the analyses. The GUI,
|
|
12
|
+
the HTML report, scripts and (later) an MCP server for AI agents all use the same core API.
|
|
13
|
+
- **Model/view.** The GUI (`raycrafter.gui`) displays the core model and turns user actions into
|
|
14
|
+
calls on it. It holds no optical state of its own beyond what it needs to draw.
|
|
15
|
+
- **Object-oriented, modular.** One clear responsibility per module. Subpackages must be usable
|
|
16
|
+
on their own, e.g. `from raycrafter.lenscatalog import thorlabs` must not pull in Qt or the GUI.
|
|
17
|
+
- **File size.** Aim for files under about 1000 lines. This is a soft limit: if a file has to be
|
|
18
|
+
bigger, say why in `log.md`.
|
|
19
|
+
- **Optiland.** It is pinned to a tested minor version in `pyproject.toml`. Any workaround for an
|
|
20
|
+
Optiland bug goes in one clearly marked place, with a comment that links to the upstream issue.
|
|
21
|
+
Delete the workaround once the fix is released. When new versions of Optiland are released:
|
|
22
|
+
test them and upgrade as soon as possible.
|
|
23
|
+
|
|
24
|
+
Package layout:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
raycrafter/
|
|
28
|
+
core/ Qt-free model, building the Optiland system, analyses
|
|
29
|
+
lenscatalog/ lens catalogues (JSON data plus loaders)
|
|
30
|
+
report/ HTML report (matplotlib figures)
|
|
31
|
+
gui/ PyQt6 + pyqtgraph application
|
|
32
|
+
palette.py colours shared by the GUI and the report
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# Code style
|
|
37
|
+
|
|
38
|
+
- Use descriptive variable names; avoid abbreviations that a newcomer would have to guess.
|
|
39
|
+
- Use white space well, including blank lines between functions and between logical blocks.
|
|
40
|
+
- Aim for lines of at most 100 chars. Up to 120 is allowed where it helps readability.
|
|
41
|
+
`ruff format` wraps at 100 and the linter complains only above 120.
|
|
42
|
+
- Every public module, class and function gets a docstring in the NumPy style. Keep it short
|
|
43
|
+
for simple functions.
|
|
44
|
+
- Add type hints to public functions and methods.
|
|
45
|
+
- Where the intent of a piece of code is not obvious (physics, Qt quirks, Optiland workarounds),
|
|
46
|
+
explain it in a comment.
|
|
47
|
+
- Physical units go in names or comments (`_mm`, `_um`, degrees, dioptres).
|
|
48
|
+
- Once a feature is complete, remove any dead code.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Tests
|
|
52
|
+
|
|
53
|
+
- Run them with `uv run pytest`. Tests live in `tests/test_unit` (fast, no display) and
|
|
54
|
+
`tests/test_integration` (GUI, packaging, slower). GUI tests run headless.
|
|
55
|
+
- Every change to the optics must keep the physics checks passing (e.g. the ACT508-200-A back
|
|
56
|
+
focal length). A new analysis needs at least one check against a known value.
|
|
57
|
+
- A bug fix comes with a test that would have caught the bug.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# Workflow
|
|
61
|
+
|
|
62
|
+
- For now, work directly on `main`. Use a branch only when there is a real need (e.g. a risky
|
|
63
|
+
experiment that may be abandoned). Once the project has users we will probably move to
|
|
64
|
+
feature branches and pull requests; that will be decided then and recorded in log.md.
|
|
65
|
+
- Use GitHub issues for substantial bugs, features and design questions, so there is a public
|
|
66
|
+
record of what was done and why. Reference the issue in commits and PRs.
|
|
67
|
+
- Before committing, run `uv run pre-commit run --all-files` and `uv run pytest`.
|
|
68
|
+
- Agents may create or comment on issues, and push branches and open pull requests when a
|
|
69
|
+
branch is used.
|
|
70
|
+
- Work done on `main` may be committed and pushed without asking. Merging a feature branch
|
|
71
|
+
into `main` (i.e. bigger or possibly problematic work), tagging and releasing need explicit
|
|
72
|
+
approval from Rob.
|
|
73
|
+
- Versions come from git tags via setuptools-scm, using semantic versioning. Pushing a
|
|
74
|
+
`vX.Y.Z` tag publishes to PyPI.
|
|
75
|
+
- Stop and ask at natural check-points rather than finishing large pieces of work in one go.
|
|
76
|
+
- Expect that people may have changed files you recently worked on or are working on now.
|
|
77
|
+
Re-read a file before modifying it; otherwise you risk reverting a human developer's saved
|
|
78
|
+
changes.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# Environment
|
|
82
|
+
|
|
83
|
+
- Use `uv`. The virtual environment lives **outside Dropbox**, because a venv cannot be shared
|
|
84
|
+
between machines or operating systems. On the Mac, run:
|
|
85
|
+
`export UV_PROJECT_ENVIRONMENT=~/uv_venvs/raycrafter_mac` and then `uv sync --extra dev`.
|
|
86
|
+
- `uv.lock` is committed so that every developer gets the same environment.
|
|
87
|
+
- `rm` and `mv` are aliased to interactive versions on Rob's machines, so use `rm -f` / `mv -f`.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# Decision log (`log.md`)
|
|
91
|
+
|
|
92
|
+
`log.md` records significant decisions and why they were made, so the history of the project
|
|
93
|
+
can be traced later (e.g. for a paper). Keep it short so it stays cheap to search.
|
|
94
|
+
|
|
95
|
+
- **Before starting work**, search the log for the topic, e.g.
|
|
96
|
+
`grep -n -i -A6 "catalog" log.md`. Read the matching entries only, not the whole file.
|
|
97
|
+
- **Add an entry** for a decision someone might later ask "why?" about: architecture,
|
|
98
|
+
dependencies, tooling, physics approximations, Optiland workarounds, or something tried and
|
|
99
|
+
abandoned. Do not log routine changes or bug fixes; git and the issues record those.
|
|
100
|
+
- **Append only.** Add new entries at the end and never rewrite old ones. If a decision is
|
|
101
|
+
reversed, add a new entry that says which entry it supersedes.
|
|
102
|
+
- **Format.** Each entry is at most about 8 lines:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
## YYYY-MM-DD: Short title
|
|
106
|
+
**Decision:** what was decided.
|
|
107
|
+
**Why:** the reason, including alternatives rejected.
|
|
108
|
+
**Supersedes:** (optional) the date and title of the earlier entry.
|
|
109
|
+
```
|
|
110
|
+
- Ask Rob before logging a decision that he has not made or agreed to.
|
raycrafter-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 RayCrafter contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RayCrafter
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Raytracing GUI for simple optical systems using off-the-shelf lenses and Optiland
|
|
5
|
+
Author-email: Rob Campbell <git@raacampbell.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Source Code, https://github.com/raycrafter-optical-design/raycrafter
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/raycrafter-optical-design/raycrafter/issues
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
17
|
+
Requires-Python: >=3.11.0
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: optiland<0.7,>=0.6.3
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: scipy
|
|
23
|
+
Requires-Dist: matplotlib
|
|
24
|
+
Requires-Dist: PyQt6
|
|
25
|
+
Requires-Dist: pyqtgraph>=0.14
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
29
|
+
Requires-Dist: coverage; extra == "dev"
|
|
30
|
+
Requires-Dist: tox; extra == "dev"
|
|
31
|
+
Requires-Dist: mypy; extra == "dev"
|
|
32
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff; extra == "dev"
|
|
34
|
+
Requires-Dist: setuptools-scm; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# RayCrafter
|
|
38
|
+
|
|
39
|
+
RayCrafter is an early proof of principle for a lens-level optical design tool. You place
|
|
40
|
+
off-the-shelf lenses on an optical axis, drag them around, and see the spot diagram,
|
|
41
|
+
through-focus curve, MTF, ray fan and field curvature update as you go. The ray tracing is
|
|
42
|
+
done by [Optiland](https://github.com/HarrisonKramer/optiland).
|
|
43
|
+
|
|
44
|
+
At present it offers a short list of Thorlabs achromats, a single wavelength (555 nm) and a
|
|
45
|
+
single beam. It can export the system as a Zemax `.zmx` file and write an HTML report.
|
|
46
|
+
|
|
47
|
+
**Status:** pre-alpha. Expect anything to change, including the API.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Install and run
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
pip install raycrafter
|
|
54
|
+
raycrafter
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or, with [uv](https://docs.astral.sh/uv/): `uvx raycrafter`.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## An agent-generated project
|
|
61
|
+
|
|
62
|
+
The code in this repository is written by AI coding agents, working with the project's
|
|
63
|
+
developers. Due to time constraints, the project is only possible because of agentic
|
|
64
|
+
coding.
|
|
65
|
+
|
|
66
|
+
We nonetheless aim for well-designed, readable code that people who use little or no AI can
|
|
67
|
+
understand and contribute to. The rules the agents follow are in [CLAUDE.md](CLAUDE.md), and
|
|
68
|
+
significant decisions, with their reasons, are recorded in [log.md](log.md).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# RayCrafter
|
|
2
|
+
|
|
3
|
+
RayCrafter is an early proof of principle for a lens-level optical design tool. You place
|
|
4
|
+
off-the-shelf lenses on an optical axis, drag them around, and see the spot diagram,
|
|
5
|
+
through-focus curve, MTF, ray fan and field curvature update as you go. The ray tracing is
|
|
6
|
+
done by [Optiland](https://github.com/HarrisonKramer/optiland).
|
|
7
|
+
|
|
8
|
+
At present it offers a short list of Thorlabs achromats, a single wavelength (555 nm) and a
|
|
9
|
+
single beam. It can export the system as a Zemax `.zmx` file and write an HTML report.
|
|
10
|
+
|
|
11
|
+
**Status:** pre-alpha. Expect anything to change, including the API.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Install and run
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
pip install raycrafter
|
|
18
|
+
raycrafter
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or, with [uv](https://docs.astral.sh/uv/): `uvx raycrafter`.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## An agent-generated project
|
|
25
|
+
|
|
26
|
+
The code in this repository is written by AI coding agents, working with the project's
|
|
27
|
+
developers. Due to time constraints, the project is only possible because of agentic
|
|
28
|
+
coding.
|
|
29
|
+
|
|
30
|
+
We nonetheless aim for well-designed, readable code that people who use little or no AI can
|
|
31
|
+
understand and contribute to. The rules the agents follow are in [CLAUDE.md](CLAUDE.md), and
|
|
32
|
+
significant decisions, with their reasons, are recorded in [log.md](log.md).
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RayCrafter
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Raytracing GUI for simple optical systems using off-the-shelf lenses and Optiland
|
|
5
|
+
Author-email: Rob Campbell <git@raacampbell.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Source Code, https://github.com/raycrafter-optical-design/raycrafter
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/raycrafter-optical-design/raycrafter/issues
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
17
|
+
Requires-Python: >=3.11.0
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: optiland<0.7,>=0.6.3
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: scipy
|
|
23
|
+
Requires-Dist: matplotlib
|
|
24
|
+
Requires-Dist: PyQt6
|
|
25
|
+
Requires-Dist: pyqtgraph>=0.14
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
29
|
+
Requires-Dist: coverage; extra == "dev"
|
|
30
|
+
Requires-Dist: tox; extra == "dev"
|
|
31
|
+
Requires-Dist: mypy; extra == "dev"
|
|
32
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff; extra == "dev"
|
|
34
|
+
Requires-Dist: setuptools-scm; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# RayCrafter
|
|
38
|
+
|
|
39
|
+
RayCrafter is an early proof of principle for a lens-level optical design tool. You place
|
|
40
|
+
off-the-shelf lenses on an optical axis, drag them around, and see the spot diagram,
|
|
41
|
+
through-focus curve, MTF, ray fan and field curvature update as you go. The ray tracing is
|
|
42
|
+
done by [Optiland](https://github.com/HarrisonKramer/optiland).
|
|
43
|
+
|
|
44
|
+
At present it offers a short list of Thorlabs achromats, a single wavelength (555 nm) and a
|
|
45
|
+
single beam. It can export the system as a Zemax `.zmx` file and write an HTML report.
|
|
46
|
+
|
|
47
|
+
**Status:** pre-alpha. Expect anything to change, including the API.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Install and run
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
pip install raycrafter
|
|
54
|
+
raycrafter
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or, with [uv](https://docs.astral.sh/uv/): `uvx raycrafter`.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## An agent-generated project
|
|
61
|
+
|
|
62
|
+
The code in this repository is written by AI coding agents, working with the project's
|
|
63
|
+
developers. Due to time constraints, the project is only possible because of agentic
|
|
64
|
+
coding.
|
|
65
|
+
|
|
66
|
+
We nonetheless aim for well-designed, readable code that people who use little or no AI can
|
|
67
|
+
understand and contribute to. The rules the agents follow are in [CLAUDE.md](CLAUDE.md), and
|
|
68
|
+
significant decisions, with their reasons, are recorded in [log.md](log.md).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
CLAUDE.md
|
|
3
|
+
LICENSE
|
|
4
|
+
MANIFEST.in
|
|
5
|
+
README.md
|
|
6
|
+
log.md
|
|
7
|
+
pyproject.toml
|
|
8
|
+
uv.lock
|
|
9
|
+
.github/workflows/test_and_deploy.yml
|
|
10
|
+
RayCrafter.egg-info/PKG-INFO
|
|
11
|
+
RayCrafter.egg-info/SOURCES.txt
|
|
12
|
+
RayCrafter.egg-info/dependency_links.txt
|
|
13
|
+
RayCrafter.egg-info/entry_points.txt
|
|
14
|
+
RayCrafter.egg-info/requires.txt
|
|
15
|
+
RayCrafter.egg-info/scm_file_list.json
|
|
16
|
+
RayCrafter.egg-info/scm_version.json
|
|
17
|
+
RayCrafter.egg-info/top_level.txt
|
|
18
|
+
raycrafter/__init__.py
|
|
19
|
+
raycrafter/__main__.py
|
|
20
|
+
raycrafter/palette.py
|
|
21
|
+
raycrafter/core/__init__.py
|
|
22
|
+
raycrafter/core/analysis.py
|
|
23
|
+
raycrafter/core/model.py
|
|
24
|
+
raycrafter/core/optic_builder.py
|
|
25
|
+
raycrafter/core/plot_geometry.py
|
|
26
|
+
raycrafter/core/prescription.py
|
|
27
|
+
raycrafter/core/state.py
|
|
28
|
+
raycrafter/gui/__init__.py
|
|
29
|
+
raycrafter/gui/analysis_panels.py
|
|
30
|
+
raycrafter/gui/app.py
|
|
31
|
+
raycrafter/gui/main_window.py
|
|
32
|
+
raycrafter/gui/side_view.py
|
|
33
|
+
raycrafter/gui/style.py
|
|
34
|
+
raycrafter/lenscatalog/__init__.py
|
|
35
|
+
raycrafter/lenscatalog/catalog.py
|
|
36
|
+
raycrafter/lenscatalog/thorlabs.py
|
|
37
|
+
raycrafter/lenscatalog/data/thorlabs_achromats.json
|
|
38
|
+
raycrafter/report/__init__.py
|
|
39
|
+
raycrafter/report/explanations.py
|
|
40
|
+
raycrafter/report/figures.py
|
|
41
|
+
raycrafter/report/html_report.py
|
|
42
|
+
raycrafter/report/assets/report.css
|
|
43
|
+
raycrafter/report/assets/report.js
|
|
44
|
+
scripts/make_thorlabs_subset.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".github/workflows/test_and_deploy.yml",
|
|
4
|
+
".gitignore",
|
|
5
|
+
".pre-commit-config.yaml",
|
|
6
|
+
"CLAUDE.md",
|
|
7
|
+
"LICENSE",
|
|
8
|
+
"MANIFEST.in",
|
|
9
|
+
"README.md",
|
|
10
|
+
"log.md",
|
|
11
|
+
"pyproject.toml",
|
|
12
|
+
"raycrafter/__init__.py",
|
|
13
|
+
"raycrafter/__main__.py",
|
|
14
|
+
"raycrafter/core/__init__.py",
|
|
15
|
+
"raycrafter/core/analysis.py",
|
|
16
|
+
"raycrafter/core/model.py",
|
|
17
|
+
"raycrafter/core/optic_builder.py",
|
|
18
|
+
"raycrafter/core/plot_geometry.py",
|
|
19
|
+
"raycrafter/core/prescription.py",
|
|
20
|
+
"raycrafter/core/state.py",
|
|
21
|
+
"raycrafter/gui/__init__.py",
|
|
22
|
+
"raycrafter/gui/analysis_panels.py",
|
|
23
|
+
"raycrafter/gui/app.py",
|
|
24
|
+
"raycrafter/gui/main_window.py",
|
|
25
|
+
"raycrafter/gui/side_view.py",
|
|
26
|
+
"raycrafter/gui/style.py",
|
|
27
|
+
"raycrafter/lenscatalog/__init__.py",
|
|
28
|
+
"raycrafter/lenscatalog/catalog.py",
|
|
29
|
+
"raycrafter/lenscatalog/data/thorlabs_achromats.json",
|
|
30
|
+
"raycrafter/lenscatalog/thorlabs.py",
|
|
31
|
+
"raycrafter/palette.py",
|
|
32
|
+
"raycrafter/report/__init__.py",
|
|
33
|
+
"raycrafter/report/assets/report.css",
|
|
34
|
+
"raycrafter/report/assets/report.js",
|
|
35
|
+
"raycrafter/report/explanations.py",
|
|
36
|
+
"raycrafter/report/figures.py",
|
|
37
|
+
"raycrafter/report/html_report.py",
|
|
38
|
+
"scripts/make_thorlabs_subset.py",
|
|
39
|
+
"tests/__init__.py",
|
|
40
|
+
"tests/conftest.py",
|
|
41
|
+
"tests/test_integration/__init__.py",
|
|
42
|
+
"tests/test_integration/test_gui.py",
|
|
43
|
+
"tests/test_integration/test_report.py",
|
|
44
|
+
"tests/test_unit/__init__.py",
|
|
45
|
+
"tests/test_unit/test_bench_editing.py",
|
|
46
|
+
"tests/test_unit/test_lenscatalog.py",
|
|
47
|
+
"tests/test_unit/test_physics.py",
|
|
48
|
+
"tests/test_unit/test_prescription.py",
|
|
49
|
+
"uv.lock"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
raycrafter
|