Skip to main content

frads: Framework for Radiance and EnergyPlus Simulation

Install + Test PyPI Downloads Python

frads is a Python library for building lighting and energy simulation. It provides high-level abstractions over Radiance and EnergyPlus, automating matrix-based annual daylight simulation workflows and enabling Radiance–EnergyPlus co-simulation.

Features

  • Matrix-based daylight simulation — automates 2-phase, 3-phase, and 5-phase Radiance workflows for fast, accurate annual simulations
  • EnergyPlus co-simulation — couples Radiance illuminance calculations with EnergyPlus at each timestep via the EnergyPlus Python API
  • Complex fenestration systems — creates and manages BSDF glazing systems (electrochromic, venetian blinds, fabric shades) using pyWinCalc
  • Dynamic shading control — implements occupancy-based daylight dimming, glare control, and thermal pre-cooling in a single simulation loop
  • Sky and weather — parses EPW/WEA files and generates Perez all-weather and CIE sky models

Installation

pip install frads

All dependencies, including Radiance (via pyradiance) and EnergyPlus (via pyenergyplus_lbnl), are installed automatically.

Quick Start

Run a Radiance three-phase annual simulation:

import frads as fr

cfg = fr.WorkflowConfig.from_dict({
    "settings": {
        "method": "3phase",
        "wea_file": "weather.wea",
    },
    "model": {
        "scene": {"files": ["walls.rad", "floor.rad", "ceiling.rad"]},
        "windows": {"window1": {"file": "window.rad", "matrix_name": "bsdf1"}},
        "materials": {
            "files": ["materials.mat"],
            "matrices": {"bsdf1": {"matrix_file": "window.xml"}},
        },
        "sensors": {"workplane": {"file": "grid.txt"}},
    },
})

workflow = fr.ThreePhaseMethod(cfg)
workflow.generate_matrices()
illuminance = workflow.calculate_sensor(
    sensor="workplane",
    bsdf={"window1": "bsdf1"},
    time=..., dni=800, dhi=100,
)

Run an EnergyPlus simulation with Radiance daylighting:

import frads as fr

epmodel = fr.load_energyplus_model("office.idf")
epmodel.add_glazing_system(
    fr.create_glazing_system("clear", [fr.LayerInput("clear.json")])
)

with fr.EnergyPlusSetup(epmodel, "weather.epw", enable_radiance=True) as eps:
    def controller(state):
        if not eps.api.exchange.api_data_fully_ready(state):
            return
        wpi = eps.calculate_wpi(zone="Zone1", cfs_name={"Window1": "clear"})
        eps.actuate_lighting_power("Zone1_Lights", (1 - min(wpi.mean() / 500, 1)) * 1000)

    eps.set_callback("callback_begin_system_timestep_before_predictor", controller)
    eps.run(annual=True)

Documentation

Full documentation, how-to guides, and API reference are at lbnl-eta.github.io/frads.

Citation

Wang, T., Ward, G., and Lee, E.S. (2021). A Python Library for Radiance Matrix-based Simulation Control and EnergyPlus Integration. Proceedings of Building Simulation 2021, IBPSA, Bruges. PDF

License

Framework for Radiance Simulation Control (frads) Copyright (c) 2019, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Intellectual Property Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.

Release files for frads 2.1.16

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

Source distribution (sdist)

Source distribution for frads 2.1.16
File Size Uploaded
frads-2.1.16.tar.gz 76.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for frads 2.1.16
File Interpreter ABI Platform
frads-2.1.16-py3-none-any.whl Python 3 none any Details

Total release size: 144.9 kB

Release files / frads-2.1.16.tar.gz

Download URL frads-2.1.16.tar.gz
Size 76.2 kB
Tags Source
SHA-256 checksum
How to use checksums
62e25056e3b74b33418ff25ae4293317d69528834903fe8df9b3719c4536fdbd
BLAKE2b-256 checksum
How to use checksums
4646ee747eaa97e951a0d130a84be8d35c7a87ce71a09d6e20d40852c71ea2d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / frads-2.1.16-py3-none-any.whl

Download URL frads-2.1.16-py3-none-any.whl
Size 68.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b34eb78553d32c7585120f34ce0c10049590896c5de449bb8836c289f57a840
BLAKE2b-256 checksum
How to use checksums
b9763cd1c8ab44235d61101877f99a00082a14659f596a48fa6797a250adb46c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

2.1.16 This release

2 release files

2.1.15

2 release files

2.1.14

2 release files

2.1.10

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.11

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.10

2 release files

0.2.8

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.1

2 release files

0.1

2 release files

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