Commit 0e2aa1a
Soc renaming (#709)
## Related Issue
Closes #525
## Description
This pull request standardizes the handling of energy storage units
across the codebase by consistently using a normalized state of charge
(`soc` between 0 and 1) and a new `capacity` field (in MWh) instead of
the previously used `max_soc`. It updates storage models, strategies,
and scenario loaders to use these new conventions, ensuring calculations
and constraints are based on normalized values and absolute capacity.
This improves clarity, correctness, and interoperability between
different modules.
**Core data model updates:**
* Replaced `max_soc` with `capacity` in the `SupportsMinMaxCharge` class
and related storage classes, and updated all references accordingly. The
`soc` is now always a float between 0 and 1, and all calculations are
adjusted to use `capacity` for absolute values.
* Updated docstrings and function arguments to clarify that `soc` is
normalized and to document the new `capacity` field.
**Calculation and logic changes:**
* Adjusted all calculations involving state of charge,
charging/discharging, and energy deltas to use normalized `soc` and
scale by `capacity`. This affects dispatch planning, bid calculations,
and reward functions.
* Updated optimization models and constraints to use `capacity` and
normalized `soc`, including Pyomo model bounds and initializations.
**Scenario and loader updates:**
* Modified all scenario loaders (`loader_amiris.py`, `loader_csv.py`,
`loader_oeds.py`, `loader_pypsa.py`, `oeds/infrastructure.py`) to output
`capacity` and normalized `initial_soc`, and to require the `capacity`
field in input data.
These changes make the codebase more robust and less error-prone by
enforcing a clear separation between normalized and absolute values for
storage units.
## Checklist
- [x] Documentation updated (docstrings, READMEs, user guides, inline
comments, `doc` folder updates etc.)
- New unit/integration tests added (not applicable)
- [x] Changes noted in release notes (if any)
- [x] Consent to release this PR's code under the GNU Affero General
Public License v3.0
---------
Co-authored-by: mthede <[email protected]>
Co-authored-by: kim-mskw <[email protected]>1 parent 971f652 commit 0e2aa1a
File tree
35 files changed
+658
-557
lines changed- assume
- common
- scenario
- oeds
- strategies
- units
- docker_configs/dashboard-definitions
- docs/source
- examples
- inputs
- example_01c
- example_01g
- example_01h
- example_02e
- example_03c
- example_03
- notebooks
- tests
35 files changed
+658
-557
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| |||
489 | 490 | | |
490 | 491 | | |
491 | 492 | | |
492 | | - | |
| 493 | + | |
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
| |||
509 | 510 | | |
510 | 511 | | |
511 | 512 | | |
512 | | - | |
| 513 | + | |
513 | 514 | | |
514 | 515 | | |
515 | 516 | | |
| |||
524 | 525 | | |
525 | 526 | | |
526 | 527 | | |
527 | | - | |
| 528 | + | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| |||
660 | 661 | | |
661 | 662 | | |
662 | 663 | | |
663 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
664 | 667 | | |
665 | 668 | | |
666 | 669 | | |
| |||
669 | 672 | | |
670 | 673 | | |
671 | 674 | | |
672 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
673 | 678 | | |
674 | 679 | | |
675 | 680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
| 288 | + | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
| 519 | + | |
518 | 520 | | |
519 | 521 | | |
520 | 522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
| 679 | + | |
| 680 | + | |
680 | 681 | | |
681 | | - | |
| 682 | + | |
| 683 | + | |
682 | 684 | | |
683 | 685 | | |
684 | 686 | | |
685 | 687 | | |
686 | 688 | | |
687 | 689 | | |
688 | | - | |
| 690 | + | |
689 | 691 | | |
690 | 692 | | |
691 | 693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
| |||
546 | 551 | | |
547 | 552 | | |
548 | 553 | | |
549 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
550 | 561 | | |
551 | 562 | | |
552 | 563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | | - | |
162 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
| |||
329 | 337 | | |
330 | 338 | | |
331 | 339 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
| |||
440 | 451 | | |
441 | 452 | | |
442 | 453 | | |
443 | | - | |
| 454 | + | |
444 | 455 | | |
445 | 456 | | |
446 | 457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
| 909 | + | |
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | | - | |
| 914 | + | |
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
1072 | | - | |
| 1072 | + | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1079 | 1081 | | |
1080 | | - | |
| 1082 | + | |
1081 | 1083 | | |
1082 | 1084 | | |
1083 | 1085 | | |
| |||
0 commit comments