diff --git a/docs/new_features.ipynb b/docs/new_features.ipynb index 0db0036c..9e7a1c2e 100644 --- a/docs/new_features.ipynb +++ b/docs/new_features.ipynb @@ -8,6 +8,65 @@ "# Recent Feature Additions" ] }, + { + "cell_type": "markdown", + "id": "570dd7ea", + "metadata": {}, + "source": [ + "## Version 0.1.14\n", + "\n", + "### CLI engine commands\n", + "\n", + "New `erad engine` sub-commands for working with the DuckDB simulation engine from the command line:\n", + "\n", + "- **`erad engine run -o results.parquet`** — Run a simulation using the DuckDB engine and export directly to Parquet, SQLite, or CSV.\n", + "- **`erad engine convert input.parquet output.db`** — Convert simulation results between formats (auto-detects from file extension).\n", + "- **`erad engine query results.parquet --sql \"SELECT ...\"`** — Run SQL queries against result files.\n", + "- **`erad engine info results.parquet`** — Display summary statistics (asset count, survival probability distribution, high-risk asset count).\n", + "\n", + "### Conversion utilities\n", + "\n", + "Bidirectional conversion between Pydantic models and DuckDB engine:\n", + "\n", + "- **`SimulationEngine.from_asset_system(asset_system)`** — Convert existing Pydantic results into DuckDB for fast export and analysis.\n", + "- **`AssetSystem.from_engine(engine)`** — Convert DuckDB engine results back to a full Pydantic AssetSystem (for plotting, GDM integration, etc.).\n", + "- **`SimulationEngine.from_parquet(path)`** — Load previously exported Parquet results into DuckDB for querying.\n", + "- **`engine.to_asset_states()`** — Extract DuckDB results as a list of `(asset_id, AssetState)` tuples.\n", + "\n", + "### Organization rename\n", + "\n", + "- Updated references from \"National Renewable Energy Laboratory (NREL)\" to \"National Laboratory of the Rockies (NLR)\".\n", + "- Author/maintainer emails updated to `@nlr.gov`.\n", + "- PyPI package name remains `NREL-erad` for backward compatibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4d4e37e8", + "metadata": {}, + "outputs": [], + "source": [ + "from erad.engine import SimulationEngine\n", + "from erad.systems.asset_system import AssetSystem\n", + "\n", + "# Conversion utilities overview\n", + "print(\"Pydantic → DuckDB:\")\n", + "print(\" engine = SimulationEngine.from_asset_system(asset_system)\")\n", + "print()\n", + "print(\"DuckDB → Pydantic:\")\n", + "print(\" asset_system = AssetSystem.from_engine(engine)\")\n", + "print()\n", + "print(\"Parquet → DuckDB:\")\n", + "print(\" engine = SimulationEngine.from_parquet('results.parquet')\")\n", + "print()\n", + "print(\"CLI commands:\")\n", + "print(\" erad engine run -o results.parquet\")\n", + "print(\" erad engine convert results.parquet results.db\")\n", + "print(\" erad engine query results.parquet --sql 'SELECT ...'\")\n", + "print(\" erad engine info results.parquet\")" + ] + }, { "cell_type": "markdown", "id": "ef39d41b",