Skip to content

Commit

Permalink
Merge pull request #103 from CURENT/misc
Browse files Browse the repository at this point in the history
Rerun all examples
  • Loading branch information
jinningwang authored Nov 24, 2024
2 parents fca17e5 + 0c9e070 commit 6268774
Show file tree
Hide file tree
Showing 13 changed files with 742 additions and 494 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Use the following resources to get involved.
- Version **0.9.9** has known issues and has been yanked from PyPI
- `kvxopt` is recommended to install via `conda` as sometimes ``pip`` struggles to set the correct path for compiled libraries
- `cvxpy` versions **below 1.5** are incompatible with `numpy` versions **2.0 and above**
- If solver `SCIP` run into import error, try to reinstall its Python interface by running `pip install pyscipopt --no-binary scip`

AMS is released as ``ltbams`` on PyPI and conda-forge.
Install from PyPI using pip:
Expand Down
18 changes: 9 additions & 9 deletions docs/source/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,20 @@ Outage Distribution Factors".
- Add a loss factor in ``RTED.dc2ac``
- Add ``DCOPF.dc2ac``
- Fix OModel parse status to ensure no_parsed params can be updated
- Fix and rerun ex2
- Fix and rerun ``ex2``
- Format ``Routine.get`` return type to be consistent with input idx type
- Remove unused ``Routine.prepare``
- Refactor ``MatProcessor`` to separate matrix building
- Add Var ``plf`` in ``DCPF``, ``PFlow``, and ``ACOPF`` to store the line flow
- Add ``build_ptdf``, ``build_lodf``, and ``build_otdf``
- Fix ``Routine.get`` to support pd.Series type idx input
- Reserve ``exec_time`` after ``dc2ac``
- Adjust kloss to fix ex2
- Adjust kloss to fix ``ex2``

v0.9.5 (2024-03-25)
-------------------

- Add more plots in demo_AGC
- Add more plots in ``demo_AGC``
- Improve line rating adjustment
- Adjust static import sequence in ``models.__init__.py``
- Adjust pjm5bus case line rate_a
Expand All @@ -143,34 +143,34 @@ v0.9.4 (2024-03-16)

- Add Var ``pi`` and ExpressionCalc ``pic`` to store the dual of constraint power balance
- Add Param ``M`` and ``D`` to model ``REGCV1``
- Add CPS1 score calculation in demo_AGC
- Add CPS1 score calculation in ``demo_AGC``

v0.9.3 (2024-03-06)
-------------------

- Major improvemets on demo_AGC
- Major improvemets on ``demo_AGC``
- Bug fix in ``RTED.dc2ac``

v0.9.2 (2024-03-04)
-------------------

- Add demo_AGC to demonstrate detailed SFR study
- Add ``demo_AGC`` to demonstrate detailed secondary frequency regulation study
- Add ``ExpressionCalc`` to handle post-solving calculation
- Rename ``type='eq'`` to ``is_eq=False`` in ``Constraint`` to avoid overriding built-in attribute
- Several formatting improvements

v0.9.1 (2024-03-02)
-------------------

- Change sphinx extension myst_nb to nbsphinx for math rendering in ex8
- Change sphinx extension myst_nb to nbsphinx for math rendering in ``ex8``
- Improve ``symprocessor`` to include routine config
- Add config to Routine reference
- Fix symbol processor issue with power operator

v0.9.0 (2024-02-27)
-------------------

- Add ex8 to demonstrate customize existing formulations via API
- Add ``ex8`` for formulation customization via API
- Improve Development documentation
- Fix ``addService``, ``addVars``
- Rename ``RoutineModel`` to ``RoutineBase`` for better naming
Expand All @@ -197,7 +197,7 @@ v0.8.2 (2024-01-30)
-------------------

- Improve examples
- Add report module and export_csv for results export
- Add module ``report`` and func ``RoutineBase.export_csv`` for results export

v0.8.1 (2024-01-20)
-------------------
Expand Down
112 changes: 70 additions & 42 deletions examples/demonstration/demo_AGC.ipynb

Large diffs are not rendered by default.

46 changes: 26 additions & 20 deletions examples/demonstration/demo_ESD1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last run time: 2024-06-18 20:15:02\n",
"ams:0.9.8\n"
"Last run time: 2024-11-24 17:51:59\n",
"ams:0.9.12\n"
]
}
],
Expand Down Expand Up @@ -76,10 +76,11 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Parsing input file \"/Users/jinningwang/Documents/work/mambaforge/envs/amsre/lib/python3.9/site-packages/ams/cases/5bus/pjm5bus_uced_esd1.xlsx\"...\n",
"Input file parsed in 0.1104 seconds.\n",
"Working directory: \"/Users/jinningwang/work/ams/examples/demonstration\"\n",
"Parsing input file \"/Users/jinningwang/work/miniconda3/envs/amsre/lib/python3.12/site-packages/ams/cases/5bus/pjm5bus_uced_esd1.xlsx\"...\n",
"Input file parsed in 0.0237 seconds.\n",
"Zero line rates detacted in rate_b, rate_c, adjusted to 999.\n",
"System set up in 0.0027 seconds.\n"
"System set up in 0.0020 seconds.\n"
]
}
],
Expand Down Expand Up @@ -218,8 +219,12 @@
"name": "stderr",
"output_type": "stream",
"text": [
"<RTEDES> initialized in 0.0205 seconds.\n",
"<RTEDES> solved as optimal in 0.0260 seconds, converged in -1 iteration with SCIP.\n"
"Building system matrices\n",
"Parsing OModel for <RTEDES>\n",
"Evaluating OModel for <RTEDES>\n",
"Finalizing OModel for <RTEDES>\n",
"<RTEDES> initialized in 0.0148 seconds.\n",
"<RTEDES> solved as optimal in 0.0380 seconds, converged in -1 iteration with SCIP.\n"
]
},
{
Expand Down Expand Up @@ -315,8 +320,11 @@
"name": "stderr",
"output_type": "stream",
"text": [
"<EDES> initialized in 0.0268 seconds.\n",
"<EDES> solved as optimal in 0.0457 seconds, converged in -1 iteration with SCIP.\n"
"Parsing OModel for <EDES>\n",
"Evaluating OModel for <EDES>\n",
"Finalizing OModel for <EDES>\n",
"<EDES> initialized in 0.0196 seconds.\n",
"<EDES> solved as optimal in 0.0857 seconds, converged in -1 iteration with SCIP.\n"
]
},
{
Expand Down Expand Up @@ -377,9 +385,12 @@
"output_type": "stream",
"text": [
"All generators are online at initial, make initial guess for commitment.\n",
"Turn off StaticGen ['PV_1'] as initial commitment guess.\n",
"<UCES> initialized in 0.0289 seconds.\n",
"<UCES> solved as optimal in 0.0850 seconds, converged in -1 iteration with SCIP.\n"
"As initial commitment guess, turn off StaticGen: PV_1\n",
"Parsing OModel for <UCES>\n",
"Evaluating OModel for <UCES>\n",
"Finalizing OModel for <UCES>\n",
"<UCES> initialized in 0.0379 seconds.\n",
"<UCES> solved as optimal in 0.0646 seconds, converged in -1 iteration with SCIP.\n"
]
},
{
Expand Down Expand Up @@ -433,7 +444,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "ams",
"display_name": "amsre",
"language": "python",
"name": "python3"
},
Expand All @@ -447,14 +458,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.12.0"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "d2b3bf80176349caa68dc4a3c77bd06eaade8abc678330f7d1c813c53380e5d2"
}
}
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
33 changes: 14 additions & 19 deletions examples/demonstration/demo_debug.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Generating code for 1 models on 12 processes.\n"
]
}
],
"outputs": [],
"source": [
"import ams"
]
Expand All @@ -36,7 +28,7 @@
{
"data": {
"text/plain": [
"'0.9.12rc1.post5.dev0+gc3478b86'"
"'0.9.12'"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -73,15 +65,18 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Parsing input file \"/Users/jinningwang/work/ams/ams/cases/matpower/case14.m\"...\n",
"Input file parsed in 0.0042 seconds.\n",
"Working directory: \"/Users/jinningwang/work/ams/examples/demonstration\"\n",
"Parsing input file \"/Users/jinningwang/work/miniconda3/envs/amsre/lib/python3.12/site-packages/ams/cases/matpower/case14.m\"...\n",
"CASE14 Power flow data for IEEE 14 bus test case.\n",
"Input file parsed in 0.0034 seconds.\n",
"Zero line rates detacted in rate_a, rate_b, rate_c, adjusted to 999.\n",
"System set up in 0.0020 seconds.\n"
]
}
],
"source": [
"sp = ams.load(ams.get_case('matpower/case14.m'))"
"sp = ams.load(ams.get_case('matpower/case14.m'),\n",
" no_output=True)"
]
},
{
Expand All @@ -97,8 +92,8 @@
"Parsing OModel for <DCOPF>\n",
"Evaluating OModel for <DCOPF>\n",
"Finalizing OModel for <DCOPF>\n",
"<DCOPF> initialized in 0.0104 seconds.\n",
"<DCOPF> solved as optimal in 0.0084 seconds, converged in 11 iterations with CLARABEL.\n"
"<DCOPF> initialized in 0.0305 seconds.\n",
"<DCOPF> solved as optimal in 0.0113 seconds, converged in 11 iterations with CLARABEL.\n"
]
},
{
Expand Down Expand Up @@ -276,8 +271,8 @@
"text": [
"Disabled constraints: pglb, pgub\n",
"Finalizing OModel for <DCOPF>\n",
"<DCOPF> initialized in 0.0012 seconds.\n",
"<DCOPF> solved as optimal in 0.0066 seconds, converged in 9 iterations with CLARABEL.\n"
"<DCOPF> initialized in 0.0013 seconds.\n",
"<DCOPF> solved as optimal in 0.0055 seconds, converged in 9 iterations with CLARABEL.\n"
]
},
{
Expand Down Expand Up @@ -365,7 +360,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "ams",
"display_name": "amsre",
"language": "python",
"name": "python3"
},
Expand All @@ -379,7 +374,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 6268774

Please sign in to comment.