Skip to main content

Foton

Annual daylight results for Honeybee models in about a second, on your computer's GPU.

PyPI Python CI License: MIT

Foton computes daylight autonomy (DA), useful daylight illuminance (UDI), spatial daylight autonomy (sDA) and daylight factor for Honeybee models. It does the expensive ray tracing on the GPU, so a full year of hourly results for a typical model takes about a second. You keep your Honeybee model and your Ladybug result components. Only the slow step changes.

Animation: as the window of a room is widened and narrowed in Grasshopper, daylight autonomy on the floor and the sDA, cDA, UDI and daylight factor plans update with it

Live mode in Grasshopper (new in 0.3.2). Each time the window changes, Foton reruns the annual study and every metric updates in about a third of a second.

Who it is for

  • Teachers and students who want daylight results to update while they move a wall, a window or a shading fin.
  • Designers comparing many early options, where waiting minutes per run means testing fewer ideas.
  • Researchers who need thousands of annual runs for a parameter study.

At a glance

Bar chart: a full annual daylight run takes 0.14 s for a 96-sensor room, 1.07 s for 2,020 sensors and 5.77 s for a 9,216-sensor office block

The four benchmark models drawn in 3D with the roof off: a single teaching office, four rooms around a courtyard, the three-room acceptance model and a four-storey office block with 256 rooms. Every sensor is a small square coloured by its daylight autonomy

Scatter plot: sDA from Foton against sDA from Radiance for 119 sensor grids, all close to the diagonal

On a typical room Foton's daylight autonomy is within 0.2 percentage points of converged Radiance. Details are under Accuracy and Speed below.

Quick start

pip install "foton-daylight[honeybee]"

That is all an annual study needs: from version 0.3.2, Radiance does not have to be installed.

from foton.honeybee import run_annual_daylight

run = run_annual_daylight(
    model="my_building.hbjson",   # any Honeybee model with sensor grids
    wea="my_city.epw",            # any EnergyPlus weather file
    output_folder="foton-results",
)

for grid in run.grids:
    print(f"{grid.identifier}: sDA {grid.sda:.0f} %, mean DA {grid.da.mean():.0f} %")

The foton-results folder has the same layout as a Honeybee annual daylight run, so Honeybee's own metric and visualisation components can read it. To check which GPU Foton will use, run foton-honeybee capabilities.

In Rhino 8 and Grasshopper: download foton-grasshopper-<version>.zip from the releases page and follow the Grasshopper quickstart. It takes about five minutes. Foton's results go straight into Ladybug's own components, such as the spatial heatmap below.

Daylight autonomy of a shaded room computed by Foton in Grasshopper and drawn by Ladybug's spatial heatmap

How it works

Diagram: your Honeybee model and weather file go into Foton, which builds a GPU scene, traces light from every sky patch to every sensor, applies the year's hourly skies, and writes results in Honeybee's format

Foton uses the same daylight-coefficient method as Radiance's matrix workflow. It traces, once, how much light from each patch of the sky reaches each sensor. It then combines those coefficients with the 8,760 hourly skies of a weather file. Foton does both steps on the GPU: Metal on Apple silicon, Vulkan on Windows and Linux. A slower CPU version gives the same answer on any machine. More in architecture.

Accuracy

Foton is checked against Radiance 5.4a on 106 test models, each at two sky resolutions: 212 cases with 234 sensor grids. The Radiance results are repeated with more rays until they stop changing, so they serve as the correct answer. Metal and Vulkan give the same figures to two decimal places.

Compared with Radiance Typical grid (median) 95 % of grids within
Daylight reaching the sensors from the sky, total difference 0.5 % 1.2 %
Annual hourly illuminance, total difference 0.1 % 0.6 %
Annual hourly illuminance, hour-by-hour scatter (CV(RMSE)) 2.4 % 7.1 %
Daylight autonomy (DA), average error per grid 0.2 pp 0.5 pp
Useful daylight illuminance (UDI), average error per grid 0.2 pp 0.6 pp
Spatial daylight autonomy (sDA) 0 pp 2.8 pp (one sensor in 36)

pp means percentage points. 204 of the 212 cases pass every check. The eight that don't are rooms lit only through glass from another room, plus one very bright deep room where Radiance itself changes by 3.6 % between 8 and 12 bounces. They are explained in the accuracy notes. Raw results: Metal, Vulkan.

Speed

Measured on 3 November 2026 on a MacBook Pro with an Apple M4 Pro (24 GB), using Metal and Foton's default final quality (8 bounces, 146-patch sky, Gothenburg weather). An annual run starts from a model Foton has not seen before: loading it, building the GPU scene, tracing, and writing DA and UDI for all 8,760 hours. The Grasshopper round trip adds writing the HBJSON, starting Foton and reading the results back. Times are the median of five runs.

Model Rooms Sensors Annual run Grasshopper round trip
Teaching office 1 96 0.14 s 0.49 s
Courtyard with four rooms 4 112 0.17 s –
Acceptance model 3 2,020 1.07 s 1.37 s
Four-storey office block 256 9,216 5.77 s 6.39 s

Raw data: annual runs, Grasshopper round trips.

On an NVIDIA Tesla T4 with Vulkan, a small model takes about 1.5 s against 0.25 s on the M4 Pro.

What it does

  • Annual DA, continuous DA, UDI (low, useful, high) and sDA, plus daylight factor
  • Hourly illuminance for every sensor, in Honeybee's result format
  • Its own annual sky model (Perez all-weather), so Radiance is not needed
  • Diffuse surfaces with several light bounces, thin glass, and shading devices
  • 146-patch (Tregenza) and 578-patch (Reinhart) skies
  • preview and final quality settings
  • Metal (macOS), Vulkan (Windows, Linux) and a CPU fallback that gives the same answer
  • A Python API, a command-line tool and three Grasshopper components

What it does not do

Foton covers ordinary architectural daylighting: matte surfaces, ordinary glazing, shading devices and building-scale sensor grids. Use Radiance for:

  • glossy or mirror-like materials, and other Radiance material types
  • complex fenestration (BSDF), prismatic films and other light-redirecting systems
  • glare, annual sunlight exposure (ASE) and dynamic shading
  • certification or compliance reports

One known difference: Foton treats the sun as part of its sky patch, as Radiance's rfluxmtx method does, rather than tracing it as a separate disc. On south-facing rooms in Phoenix, Seattle and Gothenburg this changed DA by about 1 percentage point (measured).

Documentation

Live teaching demo

A clone of this repository also includes a one-minute animated teaching demo that runs live on your GPU. It needs Node.js 20 or newer:

pip install -e ".[viewer]"
cd viewer && npm ci && npm run dev:demo

Then open http://127.0.0.1:5173/demo.html. See the demo guide.

Status

Foton is young (version 0.3) and still changing. The accuracy figures above hold for the kinds of rooms in the test set. They are not a claim that Foton matches Radiance on any model. Please open an issue if you find a model where the two disagree.

How this was built

This project is basically an exercise in using LLMs to create reimplementations within a tight scope against a deterministic target. In this case, we wanted to have fast GPU based daylighting calculations for teaching purposes, so we built it! (or asked an LLM to). The code and documentation were generated by an LLM. Radiance served as the deterministic target: every result above comes from comparing Foton with it.

Citing Foton

If you use Foton in research, please cite it. GitHub's Cite this repository button gives the reference, from CITATION.cff.

License and credits

Foton is released under the MIT License. NOTICE credits the published methods and data it builds on, and THIRD_PARTY_LICENSES.md lists the open-source libraries inside the Python package.

Foton works alongside Ladybug Tools and is tested against Radiance. It is not affiliated with either project. The optional Honeybee packages are licensed separately under AGPL-3.0 and GPL-3.0, and Foton does not include their code.

Author

Foton is written and maintained by Sanjay Somanath at Chalmers University of Technology.

Metadata

Release files for foton-daylight 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foton-daylight 0.3.3
File Size Uploaded Provenance Actions
foton_daylight-0.3.3.tar.gz 7.8 MB With provenance Details for foton_daylight-0.3.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for foton-daylight 0.3.3
File Actions
foton_daylight-0.3.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for foton_daylight-0.3.3-cp310-abi3-win_amd64.whl
foton_daylight-0.3.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for foton_daylight-0.3.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
foton_daylight-0.3.3-cp310-abi3-macosx_11_0_x86_64.whl CPython 3.10 abi3 macOS 11.0+ x86-64 Details for foton_daylight-0.3.3-cp310-abi3-macosx_11_0_x86_64.whl
foton_daylight-0.3.3-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for foton_daylight-0.3.3-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 11.4 MB

Release files / foton_daylight-0.3.3.tar.gz

Download URL foton_daylight-0.3.3.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
9b87636196cd5ce9516788f65e123cdc9c0b0b789d0c51af01261c6da9dc96f6
BLAKE2b-256 checksum
How to use checksums
37cc9952d1aa7d3ab3c92115c9b6b34dd0f7e45dc6ff088cbfea8879e409adad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / foton_daylight-0.3.3-cp310-abi3-win_amd64.whl

Download URL foton_daylight-0.3.3-cp310-abi3-win_amd64.whl
Size 793.8 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0876a4f3171d7c3b1b5b4020a42abf6f3d8dbddfae4edf3a786fcf69bd770dd8
BLAKE2b-256 checksum
How to use checksums
b17511b72796e150ae4c0701ef18fe0b1b33c681c63583d1728782e7e68dfab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / foton_daylight-0.3.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL foton_daylight-0.3.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 932.7 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
96f58fe9971b219120dab8d40aed15426be5b9cc6e3e3550b4237bac847d7e0f
BLAKE2b-256 checksum
How to use checksums
0c16595bb8013e4391d9fa3b489884a3c0d9940da9fb108eae543cb1a7500d88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / foton_daylight-0.3.3-cp310-abi3-macosx_11_0_x86_64.whl

Download URL foton_daylight-0.3.3-cp310-abi3-macosx_11_0_x86_64.whl
Size 941.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
4c8d814ba868affb1a9cdb3eb9e4648631a8a65898b6baea041efc3dc0169c4c
BLAKE2b-256 checksum
How to use checksums
14a55c733d982dd4ebe4ca492c0d574b0823fc3f901f058a3d69c5f726f52eb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / foton_daylight-0.3.3-cp310-abi3-macosx_11_0_arm64.whl

Download URL foton_daylight-0.3.3-cp310-abi3-macosx_11_0_arm64.whl
Size 932.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
61d12de421580a6e7247290f619073ee7ace01a358ebd1e6857530e0cef0fea0
BLAKE2b-256 checksum
How to use checksums
d365cb1a7ff6c82881c28f19daad1c5ffb612589fe431e87aa02d0a098242764
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for foton-daylight 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for foton_daylight-0.3.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page