Skip to content

v2.3.0: pyaermod in the browser, with nothing to install

pyaermod and AERMOD now run in a web browser. The documentation site has an app with the seven steps of the pyaermod GUI and a set of Jupyter notebooks, both running AERMOD's own Fortran source compiled to WebAssembly. Nothing is installed or downloaded to run them, and nothing entered is sent to a server. The browser AERMOD reproduces EPA's AERTEST results exactly, but it is not EPA's executable: use it to learn, teach and explore, and use EPA's executable for permit and compliance work.

The stand-alone desktop downloads are retired. The GUI installs from PyPI, and a conda-forge recipe is ready for submission.

Highlights

  • The app (/app/). Project, Sources, Receptors, Meteorology, Output, Review & Run and Results, as in pyaermod-app, and the same project files in both. It imports AERMOD decks, offers two sample met data sets (Albany, NY, 1988 and Houston, TX, 1996) or uploaded AERMET files, and takes receptor and source elevations from AERMAP output or a CSV. AERMOD runs in a background worker, so the page stays usable and Cancel stops a run. A practice deck for classes is in the teaching section.
  • The notebooks (/lite/). JupyterLite with pyaermod and AERMOD installed: build a project in Python, run AERMOD and map the result, or reproduce EPA's AERTEST.
  • How it is checked. CI compiles AERMOD 26135 with LLVM Flang and Emscripten, runs pyaermod's real-AERMOD tests against that build, runs AERTEST through pyaermod inside Pyodide, and drives the published app in Chromium, Cancel included.
  • The GUI from PyPI. pyaermod-app takes --host, --port and --no-browser; pyaermod gui and python -m pyaermod.gui_v2 start it too; a missing extra or a busy port gives one line saying what to do. Every release is now installed with the gui extra on Linux, macOS and Windows, through pip, pipx and uv tool, before it is uploaded.

Fixes worth knowing about

  • read_aermod_input(..., sandbox=True) let a quoted path such as "../../etc/passwd" through; it now judges the path AERMOD opens.
  • Quoted file names with blanks are read whole and written back as they were; SURFDATA written as reals (14735.0 1988.0) is read.
  • RECTABLE reads every rank on every line, as AERMOD does.
  • The GUI's plan view no longer freezes the server on a coordinate typo far from the origin.
  • SO BACKGRND keeps every value of a temporal profile (SEASON 1 2 3 4 used to become SEASON 1), joins a profile continued over lines, and is checked as AERMOD checks it: flag names and counts, one flag per sector, values for every sector, sector IDs 1 to N, 2 to 6 BGSECTOR directions. A uniform background is written BACKGRND ANNUAL v; the bare BACKGRND v pyaermod used to write stops AERMOD (E201).
  • A sector's hourly background file is no longer dropped from a deck; a background pyaermod cannot model whole is kept verbatim.
  • PROFBASE 328 FEET was read as 328 metres; it is converted.
  • The annual NO2 design value is one calendar year's mean (40 CFR 50.11(e), Appendix S): naaqs_compliance_report("NO2_annual", ...) reports the highest complete year (at least 75% of its hours) and refuses AERMOD's multi-year ANNUAL value, which is a lower bound on it. The GUIs show that value as a lower bound.
  • The binary POSTFILE reader labels each record by itself and reads ANNUAL and PERIOD files given averaging_period=.

The full list is in CHANGELOG.md.

Upgrade notes

  • No public API was removed. Some results change, deliberately:
  • naaqs_compliance_report("NO2_annual", ...) now gives the highest complete year's mean; pass no2_annual="multi_year_mean" for the old average of the years' means. A multi-year ANNUAL POSTFILE is refused under the default.
  • The validator refuses background settings AERMOD refuses (an averaging period such as "24" used as a BACKGRND flag, sectors without values, two flags for one sector).
  • read_postfile raises for a binary POSTFILE whose ANNUAL or PERIOD records cannot be told from short-term ones; pass averaging_period="ANNUAL" or "PERIOD".
  • Deck numbers are read as AERMOD reads them: D exponents are accepted, nan, inf and underscores are not.
  • add_background warns when some hours have no background value.
  • pyaermod[all] now includes pywebview, for pyaermod-desktop.
  • Building from source needs setuptools>=77.0.3 (SPDX license metadata).
  • The desktop bundles attached to v1.9.0 and v2.0.0 get no fixes. To keep a window of its own, install "pyaermod[gui-desktop]" and run pyaermod-desktop.

Install

pip install pyaermod==2.3.0
pip install "pyaermod[gui]"          # the GUI, opened in a browser tab
pip install "pyaermod[all]"          # everything

Or nothing: open the app or the notebooks on the documentation site.