$ show santoshphilip/eppy
eppy is a Python library for programmatic manipulation of EnergyPlus input files (IDF) and simulation output. It provides an object-oriented API to read, write, search, modify, and create IDF objects (materials, constructions, zones, HVAC loops, surfaces, etc.), run EnergyPlus simulations from Python, and parse HTML tabular results. The core architecture centers on the `IDF` class (`eppy.modeleditor`) and the `EpBunch` class (`eppy.bunch_subclass`), which represents individual IDF objects with attribute-based field access, type conversion, unit-aware read/write (SI and IP), and automatic extensible field handling. The library also includes subsystems for building geometry calculations (surface area, tilt, azimuth, zone volume), thermal property computations (R-value, U-factor), HVAC loop construction, fan power calculations, and lazy HTML table extraction. Key entry points are `eppy.easyopen.easyopen()` for opening IDF files with automatic IDD detection, `IDF` for full file management, and `run_functions.run()` for simulation execution. External dependencies include EnergyPlus (for running simulations), plus Python packages like beautifulsoup4, lxml, pydot, and pyparsing. While primarily a library for building energy modeling workflows, it also contains reusable data-oriented components (geometry, thermal calculations, unit conversion) that can be applied to other energy simulation or engineering domains. The codebase has some legacy code from early Python 2 days and a high number of open issues, but remains actively developed with ongoing fixes for extensible fields and new EnergyPlus versions.
The LLM identified 3 files worth highlighting for reuse:
Provides functions to compute geometric properties of building surfaces from 3D coordinates: area, tilt, azimuth, width, height, as well as polygon utility functions (clockwise check, angle between vectors). These calculations are independent of EnergyPlus semantics and can be extracted as a standalone geometry toolkit for any application that processes building or polygonal surface data. The implementation demonstrates clean use of vector cross products, dot products, and normalization without heavy framework dependencies.
Implements `UnitsProxy`, a descriptor that attaches `.ip`, `.ipv`, `.si`, and `.siv` properties to `EpBunch` objects, enabling transparent reading/writing of fields in either SI or IP units using the IDD-defined conversion factors. The proxy pattern is reusable for any object that needs unit-aware field access with minimal couplingβit could be adapted to other engineering data formats (e.g., OpenStudio, gbXML) by providing a compatible field-to-conversion mapping.
Contains pure functions (`fanpower_bhp`, `fanpower_watts`, `fan_maxcfm`) to convert between SI and IP units for fan power and flow rate, and to calculate brake horsepower and watts from airflow and pressure rise. This module has zero internal dependencies on eppy and relies only on standard math. It can be reused directly in any HVAC or fluid dynamics context without modification; the conversion constants and formulas are well-documented inline.