Skip to content

Dependabot/GitHub actions/davidslusser/actions python ruff 1.0.3 - #83

Merged
AadilLatif merged 5 commits into
mainfrom
dependabot/github_actions/davidslusser/actions_python_ruff-1.0.3
Jul 15, 2026
Merged

AadilLatif merged 5 commits into
mainfrom
dependabot/github_actions/davidslusser/actions_python_ruff-1.0.3

Conversation

@AadilLatif

Copy link
Copy Markdown
Collaborator

This pull request introduces a high-performance, DuckDB-powered simulation engine to ERAD, enabling scalable, vectorized computations for simulations involving millions of assets. It adds new documentation, updates dependencies, and provides multiple ways to load assets and export results, all while maintaining the existing API for backward compatibility.

Major feature: DuckDB-powered simulation engine

  • Added SimulationEngine in src/erad/engine/core.py and exposed it via src/erad/engine/__init__.py, enabling vectorized, parallelized hazard simulations using DuckDB. This engine replaces Python loops with SQL operations and custom UDFs, supporting direct loading from arrays or DataFrames, and multiple export formats. [1] [2]

Documentation updates

  • Added a new "What's New" section to the documentation table of contents (docs/_toc.yml) and a comprehensive new_features.ipynb notebook describing major features, usage examples, and dependency changes for recent versions. [1] [2]

Dependency and configuration updates

  • Added duckdb and pyarrow as core dependencies in pyproject.toml to support the new simulation engine.
  • Configured per-file lint ignores for complexity in the new engine and runner files.

These changes significantly improve ERAD's scalability, performance, and usability for large-scale hazard simulations.

- New src/erad/engine/ module with vectorized computation via DuckDB
- Custom UDFs: haversine, Holland wind model, earthquake MMI/PGA/PGV, CDF eval
- Hazard vector computation as SQL CROSS JOINs (all assets x all models at once)
- Fragility curve evaluation via vectorized CDF UDFs
- Monte Carlo scenario generation (vectorized numpy path for 50K+ assets)
- Export: Parquet (ZSTD), SQLite, CSV, Arrow, DataFrame
- Direct array/DataFrame loading path (bypasses Pydantic for 1M+ scale)
- Preserves existing API: HazardSimulator.run() with engine='duckdb'|'legacy'
- hydrate=False option skips Pydantic object creation for scale workloads
- Benchmark: 1M assets x 1 earthquake in ~60s (load + compute + export)
@AadilLatif
AadilLatif merged commit c66fa1a into main Jul 15, 2026
3 checks passed
@AadilLatif
AadilLatif deleted the dependabot/github_actions/davidslusser/actions_python_ruff-1.0.3 branch July 15, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant