scr-screen 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. scr_screen-0.1.0/LICENSE +21 -0
  2. scr_screen-0.1.0/PKG-INFO +273 -0
  3. scr_screen-0.1.0/README.md +239 -0
  4. scr_screen-0.1.0/pyproject.toml +59 -0
  5. scr_screen-0.1.0/setup.cfg +4 -0
  6. scr_screen-0.1.0/src/scr_screen/__init__.py +3 -0
  7. scr_screen-0.1.0/src/scr_screen/__main__.py +7 -0
  8. scr_screen-0.1.0/src/scr_screen/check.py +138 -0
  9. scr_screen-0.1.0/src/scr_screen/classical.py +256 -0
  10. scr_screen-0.1.0/src/scr_screen/cli.py +368 -0
  11. scr_screen-0.1.0/src/scr_screen/cost.py +225 -0
  12. scr_screen-0.1.0/src/scr_screen/data/ieee39_assumed.json +2367 -0
  13. scr_screen-0.1.0/src/scr_screen/data/ieee39_sites_example.csv +5 -0
  14. scr_screen-0.1.0/src/scr_screen/data/plants_template.csv +4 -0
  15. scr_screen-0.1.0/src/scr_screen/examples.py +54 -0
  16. scr_screen-0.1.0/src/scr_screen/io.py +144 -0
  17. scr_screen-0.1.0/src/scr_screen/loaders.py +91 -0
  18. scr_screen-0.1.0/src/scr_screen/metrics.py +189 -0
  19. scr_screen-0.1.0/src/scr_screen/netmap.py +176 -0
  20. scr_screen-0.1.0/src/scr_screen/network.py +177 -0
  21. scr_screen-0.1.0/src/scr_screen/report.py +742 -0
  22. scr_screen-0.1.0/src/scr_screen/screening.py +108 -0
  23. scr_screen-0.1.0/src/scr_screen/settings.py +46 -0
  24. scr_screen-0.1.0/src/scr_screen.egg-info/PKG-INFO +273 -0
  25. scr_screen-0.1.0/src/scr_screen.egg-info/SOURCES.txt +40 -0
  26. scr_screen-0.1.0/src/scr_screen.egg-info/dependency_links.txt +1 -0
  27. scr_screen-0.1.0/src/scr_screen.egg-info/entry_points.txt +2 -0
  28. scr_screen-0.1.0/src/scr_screen.egg-info/requires.txt +10 -0
  29. scr_screen-0.1.0/src/scr_screen.egg-info/top_level.txt +1 -0
  30. scr_screen-0.1.0/tests/test_bundled_examples.py +36 -0
  31. scr_screen-0.1.0/tests/test_classical.py +160 -0
  32. scr_screen-0.1.0/tests/test_cli.py +91 -0
  33. scr_screen-0.1.0/tests/test_cost.py +141 -0
  34. scr_screen-0.1.0/tests/test_examples.py +39 -0
  35. scr_screen-0.1.0/tests/test_interactive.py +119 -0
  36. scr_screen-0.1.0/tests/test_io.py +135 -0
  37. scr_screen-0.1.0/tests/test_metrics.py +157 -0
  38. scr_screen-0.1.0/tests/test_netmap.py +132 -0
  39. scr_screen-0.1.0/tests/test_network.py +103 -0
  40. scr_screen-0.1.0/tests/test_notebook.py +30 -0
  41. scr_screen-0.1.0/tests/test_own_network.py +166 -0
  42. scr_screen-0.1.0/tests/test_report.py +65 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaibu Ibrahim, P.E.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,273 @@
1
+ Metadata-Version: 2.4
2
+ Name: scr-screen
3
+ Version: 0.1.0
4
+ Summary: Short-circuit ratio (SCR/WSCR) screening for inverter-based resource interconnection
5
+ Author-email: "Shaibu Ibrahim, P.E." <ishaibu136@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/ishaibu/scr-screen
8
+ Project-URL: Documentation, https://github.com/ishaibu/scr-screen#readme
9
+ Project-URL: Issues, https://github.com/ishaibu/scr-screen/issues
10
+ Project-URL: Changelog, https://github.com/ishaibu/scr-screen/blob/main/CHANGELOG.md
11
+ Keywords: power-systems,short-circuit-ratio,grid-interconnection,inverter-based-resources
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: pandapower>=3.5
26
+ Requires-Dist: openpyxl
27
+ Requires-Dist: xlsxwriter
28
+ Requires-Dist: matpowercaseframes
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=8; extra == "dev"
31
+ Provides-Extra: notebook
32
+ Requires-Dist: ipykernel; extra == "notebook"
33
+ Dynamic: license-file
34
+
35
+ # SCR-Screen
36
+
37
+ [![tests](https://github.com/ishaibu/scr-screen/actions/workflows/tests.yml/badge.svg)](https://github.com/ishaibu/scr-screen/actions/workflows/tests.yml)
38
+ ![Python](https://img.shields.io/badge/python-3.10%E2%80%933.13-blue)
39
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
40
+
41
+ **Open-source short-circuit ratio (SCR) screening for solar, wind, and battery storage interconnection.**
42
+
43
+ SCR-Screen helps interconnection, planning, and siting engineers find weak-grid locations **early**, before detailed studies are commissioned. It calculates short-circuit strength from a network model, screens single plants (SCR) and groups of nearby plants (WSCR), and produces a clear, self-contained HTML report.
44
+
45
+ > **Screening only.** SCR-Screen provides screening-level indicators of system strength. Results do not replace interconnection studies, detailed positive-sequence or EMT analysis, or the requirements of the applicable transmission provider.
46
+
47
+ ---
48
+
49
+ ## Why use it
50
+
51
+ The SCR formula is simple. Getting a trustworthy answer is not:
52
+
53
+ - **Short-circuit MVA must come from the network, calculated consistently.** SCR-Screen computes it from a model, excludes inverter-based resource (IBR) contributions as NERC requires, and states the method used.
54
+ - **Nearby plants share grid strength.** Two plants that each pass alone can be weak together. SCR-Screen screens groups with WSCR and shows the difference side by side.
55
+ - **Siting needs every location, not one.** The bus scan ranks every bus in a model for a plant of a given size.
56
+ - **Method choice changes answers.** SCR-Screen supports both the classical flat-start method (common U.S. planning practice) and IEC 60909, and records which one produced each result.
57
+ - **Transparent and reproducible.** Open formulas, documented assumptions, automated tests, and a public [verification record](docs/verification.md).
58
+
59
+ ## Features (v0.1)
60
+
61
+ | Feature | Details |
62
+ |---|---|
63
+ | SCR | Single plant at its point of interconnection (POI) |
64
+ | WSCR | Groups of plants assumed fully interacting (ERCOT/NERC formulation) |
65
+ | Rating basis | MW (default) or MVA |
66
+ | Short-circuit methods | Classical flat-start (1.0 pu) and IEC 60909 (via pandapower) |
67
+ | Bus scan | SCR at every bus of a network for a hypothetical plant size |
68
+ | Flags | Very weak / weak / no flag, with user-configurable thresholds |
69
+ | Network map | Grid drawn from bus coordinates (or an automatic layout), colored and animated by SCR flag |
70
+ | Plant-size slider | In scan reports, drag to any plant size; every SCR, flag, chart and the map update instantly in the browser |
71
+ | Max plant size | Largest plant each location can host before a weak flag (SCMVA ÷ weak threshold) |
72
+ | Method comparison | Classical vs IEC 60909 for every bus, highlighting where the flag changes |
73
+ | Cost screening | Ranks candidate buses by screening-level cost: synchronous condenser to fix weak grid, gen-tie line, POI substation (all costs are your inputs) |
74
+ | Your own network | Reads pandapower JSON, Excel (.xlsx), and MATPOWER (.m/.mat); `check` lists anything missing before you scan |
75
+ | Outputs | Self-contained HTML report (works offline), CSV, JSON |
76
+ | Interfaces | Command line (`scr-screen`) and Python API |
77
+
78
+ ## Try it without installing
79
+
80
+ - **[SCR-Screen Lite](https://ishaibu.github.io/scr-screen/lite/)**: browser calculator. Type each plant's short-circuit MVA and MW to get SCR, flags, WSCR, the largest plant before a weak flag, and condenser cost. Runs entirely in your browser.
81
+ - **[Interactive demo report](https://ishaibu.github.io/scr-screen/demo/)**: a full IEEE 39-bus scan (assumed data, illustrative costs). Drag the plant-size slider and change the inputs.
82
+
83
+ ## Installation
84
+
85
+ Requires Python 3.10 or newer.
86
+
87
+ ```bash
88
+ python -m venv venv
89
+ # Windows: venv\Scripts\activate macOS/Linux: source venv/bin/activate
90
+ pip install scr-screen
91
+ ```
92
+
93
+ From source (for contributors):
94
+
95
+ ```bash
96
+ git clone https://github.com/ishaibu/scr-screen.git
97
+ cd scr-screen
98
+ pip install -e ".[dev]"
99
+ ```
100
+
101
+ ## Quick start (command line)
102
+
103
+ **Try it in one minute** with the bundled IEEE 39-bus example:
104
+
105
+ ```bash
106
+ scr-screen example # copies example files into ./scr-screen-example
107
+ cd scr-screen-example
108
+ scr-screen scan ieee39_assumed.json --plant-mw 1500 --report scan.html --open
109
+ ```
110
+
111
+ **Direct mode:** you already have short-circuit MVA values (from any study tool).
112
+
113
+ ```bash
114
+ scr-screen template plants.csv # creates an input file with example rows
115
+ scr-screen run plants.csv --report report.html --out results.csv
116
+ ```
117
+
118
+ **Network mode:** calculate short-circuit MVA from a [pandapower](https://www.pandapower.org/) network saved as JSON, and scan every bus.
119
+
120
+ ```bash
121
+ scr-screen scan examples/ieee39_assumed.json --plant-mw 1500 --report scan.html --open
122
+ scr-screen scan examples/ieee39_assumed.json --plant-mw 1500 --method iec60909
123
+ ```
124
+
125
+ `--open` opens the report in your browser as soon as it is ready.
126
+
127
+ **What-if inputs:** scan reports have an inputs panel. Change any of these and the whole report (map, charts, tables, cost ranking) recalculates instantly in the browser, with no re-run needed:
128
+
129
+ - plant size (slider or typed value)
130
+ - weak and very-weak SCR thresholds
131
+ - with cost screening: target SCR, condenser X''d, transformer Xt, condenser $/MVA, gen-tie $/mile, and each candidate bus's gen-tie distance and POI cost (edited directly in the cost table)
132
+
133
+ **Reset all** returns to the values the report was created with. Invalid entries (e.g. 0 MW) are flagged and ignored.
134
+
135
+ Run `scr-screen --help` or `scr-screen run --help` for all options (`--basis MVA`, `--weak`, `--very-weak`, `--title`, `--open`, `--no-compare`).
136
+
137
+ ## Use your own network
138
+
139
+ SCR-Screen works on any network, not just the IEEE 39-bus example.
140
+
141
+ | File type | Extension | Notes |
142
+ |---|---|---|
143
+ | pandapower JSON | `.json` | Native format |
144
+ | pandapower Excel | `.xlsx` | Edit in Excel: one sheet per element type (bus, line, trafo, gen, ext_grid, ...) |
145
+ | MATPOWER | `.m`, `.mat` | Converted on load; MATPOWER has no short-circuit data, so add it (below) |
146
+
147
+ **Short-circuit data needed:**
148
+ - Grid sources (`ext_grid`): `s_sc_max_mva` and `rx_max`.
149
+ - Synchronous generators (`gen`): `xdss_pu` (X''d on machine base) and `sn_mva`. IEC 60909 also needs `vn_kv`, `rdss_ohm`, and `cos_phi`.
150
+
151
+ **Workflow:**
152
+
153
+ ```bash
154
+ scr-screen check mynetwork.m # lists exactly what is missing
155
+ scr-screen convert mynetwork.m mynetwork.xlsx # open in Excel, fill in the empty short-circuit columns
156
+ scr-screen check mynetwork.xlsx # "Ready for Classical: yes"
157
+ scr-screen scan mynetwork.xlsx --plant-mw 300 --report scan.html --open
158
+ ```
159
+
160
+ Buses with no path to any source are skipped and listed in the report. PSS/E `.raw` import is planned.
161
+
162
+ ## Interconnection cost screening
163
+
164
+ For a plant of a given size, SCR-Screen estimates a screening-level cost of connecting at each candidate bus:
165
+
166
+ - **Target check:** buses below your target SCR are flagged, with the largest plant that meets the target (`SCMVA ÷ target SCR`) and the condenser alternative.
167
+ - **Weak-grid mitigation:** synchronous condenser size to reach a target SCR (default: the weak threshold),
168
+ `condenser MVA = max(0, plant MW × target SCR − SCMVA) × (X''d + Xt)`, assuming the condenser is at the POI.
169
+ - **Gen-tie line:** distance × your cost per mile.
170
+ - **POI substation or switching station:** your cost per bus.
171
+
172
+ ```bash
173
+ scr-screen sites-template mynetwork.xlsx sites.csv # list of buses; fill in distance_mi, poi_cost_usd
174
+ scr-screen scan mynetwork.xlsx --plant-mw 1500 --report scan.html --site-costs sites.csv \
175
+ --condenser-cost-per-mva 100000 --gen-tie-cost-per-mile 2000000 --cost-out costs.csv
176
+ ```
177
+
178
+ The numbers above and in `examples/ieee39_sites_example.csv` are **illustrative only**. SCR-Screen ships no cost data; enter your own. In the report, every cost input is editable and the ranking updates instantly, so you can see the cheapest bus change as the plant grows or as costs change.
179
+
180
+ > Cost screening excludes network upgrades (thermal, voltage, stability), which are often the largest interconnection cost and require power flow and interconnection-queue studies. Grid-forming inverters may mitigate weak-grid conditions at lower cost and are not costed.
181
+
182
+ ## Input format (direct mode)
183
+
184
+ One row per plant. Column order and capitalization do not matter; files saved from Excel as **CSV UTF-8** work.
185
+
186
+ | Column | Required | Description |
187
+ |---|---|---|
188
+ | `plant_id` | Yes | Unique label |
189
+ | `scmva` | Yes | Three-phase short-circuit MVA at the POI, **without** IBR contribution |
190
+ | `rating_mw` | Yes | Plant rating in MW |
191
+ | `rating_mva` | No | Plant rating in MVA (needed only for `--basis MVA`) |
192
+ | `group` | No | Plants sharing a group are also screened together with WSCR |
193
+ | `poi_name` | No | Display name of the POI |
194
+
195
+ Numbers must use a dot for decimals and no thousands separators (e.g. `1000`, `485.86`). Values with commas are rejected rather than guessed.
196
+
197
+ ## Python API
198
+
199
+ ```python
200
+ from scr_screen.metrics import scr, wscr
201
+ from scr_screen.io import read_plants_csv
202
+ from scr_screen.screening import screen
203
+ from scr_screen.report import write_html_report
204
+
205
+ scr(500, 100) # 5.0
206
+ wscr([1000, 600], [200, 100]) # 2.889
207
+
208
+ plants, poi = read_plants_csv("plants.csv")
209
+ result = screen(plants, poi_names=poi)
210
+ write_html_report(result, "report.html")
211
+ ```
212
+
213
+ Network mode:
214
+
215
+ ```python
216
+ import pandapower as pp
217
+ from scr_screen.network import scan_buses
218
+
219
+ net = pp.from_json("network.json")
220
+ for row in scan_buses(net, plant_mw=300, method="classical"):
221
+ print(row.bus, row.name, round(row.scr, 2), row.flag)
222
+ ```
223
+
224
+ See [`examples/walkthrough.ipynb`](examples/walkthrough.ipynb) for a step-by-step tour.
225
+
226
+ ## Methods
227
+
228
+ **SCR** = SCMVA ÷ plant rating
229
+ **WSCR** = Σ(SCMVAᵢ × Pᵢ) ÷ (ΣPᵢ)²
230
+
231
+ | Short-circuit method | Pre-fault voltage | Correction factors | Typical use |
232
+ |---|---|---|---|
233
+ | Classical flat-start (default) | 1.0 pu | None | Common U.S. planning practice |
234
+ | IEC 60909 (max case) | c = 1.1 | Generator and transformer impedance correction | IEC practice |
235
+
236
+ In both methods, inverter-based resources do not contribute to SCMVA.
237
+
238
+ **Default flag bands** (user-configurable): below 2 **very weak**; 2 to below 3 **weak**; 3 or above **no flag**. These follow HVDC planning practice (IEEE Std 1204-1997). There is no universal weak-grid threshold.
239
+
240
+ Full details: [design specification](docs/design-spec.md).
241
+
242
+ ## Limitations
243
+
244
+ - SCR-based metrics assume **grid-following** inverters and do not replace the inverter manufacturer's minimum SCR.
245
+ - WSCR assumes the plants in a group are fully interacting.
246
+ - The classical method (v0.1) ignores loads, shunts, and line charging, uses nominal transformer taps, and does not yet model three-winding transformers or closed bus-bus switches. Unsupported elements stop the calculation with a clear error rather than being ignored.
247
+ - Real transmission models are often restricted (e.g. CEII in the U.S.). SCR-Screen ships only public test data; users run it on their own models.
248
+ - Cost screening is screening-level only and excludes network upgrades; all costs are user inputs.
249
+
250
+ ## Verification
251
+
252
+ Every formula is covered by automated tests with hand-calculated expected values, run on each change. Independent engineering checks are recorded in [`docs/verification.md`](docs/verification.md).
253
+
254
+ ## Roadmap
255
+
256
+ - **v0.2:** PSS/E `.raw` import, N-1 contingency worst case, generator retirement scenarios, interconnection-queue build-out, composite SCR (CSCR)
257
+ - **v0.3:** mitigation sizing (e.g. synchronous condenser MVA needed), SCR with interaction factors (SCRIF)
258
+
259
+ ## Feedback and contributions
260
+
261
+ Found a bug, have a question, or use SCR-Screen in your work? Please [open an issue](https://github.com/ishaibu/scr-screen/issues). Feedback from utility, ISO/RTO, developer, and consulting engineers is especially welcome.
262
+
263
+ ## References
264
+
265
+ 1. NERC, *Integrating Inverter-Based Resources into Low Short Circuit Strength Systems*, Reliability Guideline, December 2017.
266
+ 2. NERC, *Short-Circuit Modeling and System Strength*, White Paper, February 2018.
267
+ 3. Y. Zhang et al., "Evaluating system strength for large-scale wind plant integration," IEEE PES General Meeting, 2014.
268
+ 4. IEEE Std 1204-1997, *IEEE Guide for Planning DC Links Terminating at AC Locations Having Low Short-Circuit Capacities*.
269
+ 5. IEC 60909-0, *Short-circuit currents in three-phase a.c. systems*.
270
+
271
+ ## License and author
272
+
273
+ MIT License. Created and maintained by **Shaibu Ibrahim, P.E.**
@@ -0,0 +1,239 @@
1
+ # SCR-Screen
2
+
3
+ [![tests](https://github.com/ishaibu/scr-screen/actions/workflows/tests.yml/badge.svg)](https://github.com/ishaibu/scr-screen/actions/workflows/tests.yml)
4
+ ![Python](https://img.shields.io/badge/python-3.10%E2%80%933.13-blue)
5
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
6
+
7
+ **Open-source short-circuit ratio (SCR) screening for solar, wind, and battery storage interconnection.**
8
+
9
+ SCR-Screen helps interconnection, planning, and siting engineers find weak-grid locations **early**, before detailed studies are commissioned. It calculates short-circuit strength from a network model, screens single plants (SCR) and groups of nearby plants (WSCR), and produces a clear, self-contained HTML report.
10
+
11
+ > **Screening only.** SCR-Screen provides screening-level indicators of system strength. Results do not replace interconnection studies, detailed positive-sequence or EMT analysis, or the requirements of the applicable transmission provider.
12
+
13
+ ---
14
+
15
+ ## Why use it
16
+
17
+ The SCR formula is simple. Getting a trustworthy answer is not:
18
+
19
+ - **Short-circuit MVA must come from the network, calculated consistently.** SCR-Screen computes it from a model, excludes inverter-based resource (IBR) contributions as NERC requires, and states the method used.
20
+ - **Nearby plants share grid strength.** Two plants that each pass alone can be weak together. SCR-Screen screens groups with WSCR and shows the difference side by side.
21
+ - **Siting needs every location, not one.** The bus scan ranks every bus in a model for a plant of a given size.
22
+ - **Method choice changes answers.** SCR-Screen supports both the classical flat-start method (common U.S. planning practice) and IEC 60909, and records which one produced each result.
23
+ - **Transparent and reproducible.** Open formulas, documented assumptions, automated tests, and a public [verification record](docs/verification.md).
24
+
25
+ ## Features (v0.1)
26
+
27
+ | Feature | Details |
28
+ |---|---|
29
+ | SCR | Single plant at its point of interconnection (POI) |
30
+ | WSCR | Groups of plants assumed fully interacting (ERCOT/NERC formulation) |
31
+ | Rating basis | MW (default) or MVA |
32
+ | Short-circuit methods | Classical flat-start (1.0 pu) and IEC 60909 (via pandapower) |
33
+ | Bus scan | SCR at every bus of a network for a hypothetical plant size |
34
+ | Flags | Very weak / weak / no flag, with user-configurable thresholds |
35
+ | Network map | Grid drawn from bus coordinates (or an automatic layout), colored and animated by SCR flag |
36
+ | Plant-size slider | In scan reports, drag to any plant size; every SCR, flag, chart and the map update instantly in the browser |
37
+ | Max plant size | Largest plant each location can host before a weak flag (SCMVA ÷ weak threshold) |
38
+ | Method comparison | Classical vs IEC 60909 for every bus, highlighting where the flag changes |
39
+ | Cost screening | Ranks candidate buses by screening-level cost: synchronous condenser to fix weak grid, gen-tie line, POI substation (all costs are your inputs) |
40
+ | Your own network | Reads pandapower JSON, Excel (.xlsx), and MATPOWER (.m/.mat); `check` lists anything missing before you scan |
41
+ | Outputs | Self-contained HTML report (works offline), CSV, JSON |
42
+ | Interfaces | Command line (`scr-screen`) and Python API |
43
+
44
+ ## Try it without installing
45
+
46
+ - **[SCR-Screen Lite](https://ishaibu.github.io/scr-screen/lite/)**: browser calculator. Type each plant's short-circuit MVA and MW to get SCR, flags, WSCR, the largest plant before a weak flag, and condenser cost. Runs entirely in your browser.
47
+ - **[Interactive demo report](https://ishaibu.github.io/scr-screen/demo/)**: a full IEEE 39-bus scan (assumed data, illustrative costs). Drag the plant-size slider and change the inputs.
48
+
49
+ ## Installation
50
+
51
+ Requires Python 3.10 or newer.
52
+
53
+ ```bash
54
+ python -m venv venv
55
+ # Windows: venv\Scripts\activate macOS/Linux: source venv/bin/activate
56
+ pip install scr-screen
57
+ ```
58
+
59
+ From source (for contributors):
60
+
61
+ ```bash
62
+ git clone https://github.com/ishaibu/scr-screen.git
63
+ cd scr-screen
64
+ pip install -e ".[dev]"
65
+ ```
66
+
67
+ ## Quick start (command line)
68
+
69
+ **Try it in one minute** with the bundled IEEE 39-bus example:
70
+
71
+ ```bash
72
+ scr-screen example # copies example files into ./scr-screen-example
73
+ cd scr-screen-example
74
+ scr-screen scan ieee39_assumed.json --plant-mw 1500 --report scan.html --open
75
+ ```
76
+
77
+ **Direct mode:** you already have short-circuit MVA values (from any study tool).
78
+
79
+ ```bash
80
+ scr-screen template plants.csv # creates an input file with example rows
81
+ scr-screen run plants.csv --report report.html --out results.csv
82
+ ```
83
+
84
+ **Network mode:** calculate short-circuit MVA from a [pandapower](https://www.pandapower.org/) network saved as JSON, and scan every bus.
85
+
86
+ ```bash
87
+ scr-screen scan examples/ieee39_assumed.json --plant-mw 1500 --report scan.html --open
88
+ scr-screen scan examples/ieee39_assumed.json --plant-mw 1500 --method iec60909
89
+ ```
90
+
91
+ `--open` opens the report in your browser as soon as it is ready.
92
+
93
+ **What-if inputs:** scan reports have an inputs panel. Change any of these and the whole report (map, charts, tables, cost ranking) recalculates instantly in the browser, with no re-run needed:
94
+
95
+ - plant size (slider or typed value)
96
+ - weak and very-weak SCR thresholds
97
+ - with cost screening: target SCR, condenser X''d, transformer Xt, condenser $/MVA, gen-tie $/mile, and each candidate bus's gen-tie distance and POI cost (edited directly in the cost table)
98
+
99
+ **Reset all** returns to the values the report was created with. Invalid entries (e.g. 0 MW) are flagged and ignored.
100
+
101
+ Run `scr-screen --help` or `scr-screen run --help` for all options (`--basis MVA`, `--weak`, `--very-weak`, `--title`, `--open`, `--no-compare`).
102
+
103
+ ## Use your own network
104
+
105
+ SCR-Screen works on any network, not just the IEEE 39-bus example.
106
+
107
+ | File type | Extension | Notes |
108
+ |---|---|---|
109
+ | pandapower JSON | `.json` | Native format |
110
+ | pandapower Excel | `.xlsx` | Edit in Excel: one sheet per element type (bus, line, trafo, gen, ext_grid, ...) |
111
+ | MATPOWER | `.m`, `.mat` | Converted on load; MATPOWER has no short-circuit data, so add it (below) |
112
+
113
+ **Short-circuit data needed:**
114
+ - Grid sources (`ext_grid`): `s_sc_max_mva` and `rx_max`.
115
+ - Synchronous generators (`gen`): `xdss_pu` (X''d on machine base) and `sn_mva`. IEC 60909 also needs `vn_kv`, `rdss_ohm`, and `cos_phi`.
116
+
117
+ **Workflow:**
118
+
119
+ ```bash
120
+ scr-screen check mynetwork.m # lists exactly what is missing
121
+ scr-screen convert mynetwork.m mynetwork.xlsx # open in Excel, fill in the empty short-circuit columns
122
+ scr-screen check mynetwork.xlsx # "Ready for Classical: yes"
123
+ scr-screen scan mynetwork.xlsx --plant-mw 300 --report scan.html --open
124
+ ```
125
+
126
+ Buses with no path to any source are skipped and listed in the report. PSS/E `.raw` import is planned.
127
+
128
+ ## Interconnection cost screening
129
+
130
+ For a plant of a given size, SCR-Screen estimates a screening-level cost of connecting at each candidate bus:
131
+
132
+ - **Target check:** buses below your target SCR are flagged, with the largest plant that meets the target (`SCMVA ÷ target SCR`) and the condenser alternative.
133
+ - **Weak-grid mitigation:** synchronous condenser size to reach a target SCR (default: the weak threshold),
134
+ `condenser MVA = max(0, plant MW × target SCR − SCMVA) × (X''d + Xt)`, assuming the condenser is at the POI.
135
+ - **Gen-tie line:** distance × your cost per mile.
136
+ - **POI substation or switching station:** your cost per bus.
137
+
138
+ ```bash
139
+ scr-screen sites-template mynetwork.xlsx sites.csv # list of buses; fill in distance_mi, poi_cost_usd
140
+ scr-screen scan mynetwork.xlsx --plant-mw 1500 --report scan.html --site-costs sites.csv \
141
+ --condenser-cost-per-mva 100000 --gen-tie-cost-per-mile 2000000 --cost-out costs.csv
142
+ ```
143
+
144
+ The numbers above and in `examples/ieee39_sites_example.csv` are **illustrative only**. SCR-Screen ships no cost data; enter your own. In the report, every cost input is editable and the ranking updates instantly, so you can see the cheapest bus change as the plant grows or as costs change.
145
+
146
+ > Cost screening excludes network upgrades (thermal, voltage, stability), which are often the largest interconnection cost and require power flow and interconnection-queue studies. Grid-forming inverters may mitigate weak-grid conditions at lower cost and are not costed.
147
+
148
+ ## Input format (direct mode)
149
+
150
+ One row per plant. Column order and capitalization do not matter; files saved from Excel as **CSV UTF-8** work.
151
+
152
+ | Column | Required | Description |
153
+ |---|---|---|
154
+ | `plant_id` | Yes | Unique label |
155
+ | `scmva` | Yes | Three-phase short-circuit MVA at the POI, **without** IBR contribution |
156
+ | `rating_mw` | Yes | Plant rating in MW |
157
+ | `rating_mva` | No | Plant rating in MVA (needed only for `--basis MVA`) |
158
+ | `group` | No | Plants sharing a group are also screened together with WSCR |
159
+ | `poi_name` | No | Display name of the POI |
160
+
161
+ Numbers must use a dot for decimals and no thousands separators (e.g. `1000`, `485.86`). Values with commas are rejected rather than guessed.
162
+
163
+ ## Python API
164
+
165
+ ```python
166
+ from scr_screen.metrics import scr, wscr
167
+ from scr_screen.io import read_plants_csv
168
+ from scr_screen.screening import screen
169
+ from scr_screen.report import write_html_report
170
+
171
+ scr(500, 100) # 5.0
172
+ wscr([1000, 600], [200, 100]) # 2.889
173
+
174
+ plants, poi = read_plants_csv("plants.csv")
175
+ result = screen(plants, poi_names=poi)
176
+ write_html_report(result, "report.html")
177
+ ```
178
+
179
+ Network mode:
180
+
181
+ ```python
182
+ import pandapower as pp
183
+ from scr_screen.network import scan_buses
184
+
185
+ net = pp.from_json("network.json")
186
+ for row in scan_buses(net, plant_mw=300, method="classical"):
187
+ print(row.bus, row.name, round(row.scr, 2), row.flag)
188
+ ```
189
+
190
+ See [`examples/walkthrough.ipynb`](examples/walkthrough.ipynb) for a step-by-step tour.
191
+
192
+ ## Methods
193
+
194
+ **SCR** = SCMVA ÷ plant rating
195
+ **WSCR** = Σ(SCMVAᵢ × Pᵢ) ÷ (ΣPᵢ)²
196
+
197
+ | Short-circuit method | Pre-fault voltage | Correction factors | Typical use |
198
+ |---|---|---|---|
199
+ | Classical flat-start (default) | 1.0 pu | None | Common U.S. planning practice |
200
+ | IEC 60909 (max case) | c = 1.1 | Generator and transformer impedance correction | IEC practice |
201
+
202
+ In both methods, inverter-based resources do not contribute to SCMVA.
203
+
204
+ **Default flag bands** (user-configurable): below 2 **very weak**; 2 to below 3 **weak**; 3 or above **no flag**. These follow HVDC planning practice (IEEE Std 1204-1997). There is no universal weak-grid threshold.
205
+
206
+ Full details: [design specification](docs/design-spec.md).
207
+
208
+ ## Limitations
209
+
210
+ - SCR-based metrics assume **grid-following** inverters and do not replace the inverter manufacturer's minimum SCR.
211
+ - WSCR assumes the plants in a group are fully interacting.
212
+ - The classical method (v0.1) ignores loads, shunts, and line charging, uses nominal transformer taps, and does not yet model three-winding transformers or closed bus-bus switches. Unsupported elements stop the calculation with a clear error rather than being ignored.
213
+ - Real transmission models are often restricted (e.g. CEII in the U.S.). SCR-Screen ships only public test data; users run it on their own models.
214
+ - Cost screening is screening-level only and excludes network upgrades; all costs are user inputs.
215
+
216
+ ## Verification
217
+
218
+ Every formula is covered by automated tests with hand-calculated expected values, run on each change. Independent engineering checks are recorded in [`docs/verification.md`](docs/verification.md).
219
+
220
+ ## Roadmap
221
+
222
+ - **v0.2:** PSS/E `.raw` import, N-1 contingency worst case, generator retirement scenarios, interconnection-queue build-out, composite SCR (CSCR)
223
+ - **v0.3:** mitigation sizing (e.g. synchronous condenser MVA needed), SCR with interaction factors (SCRIF)
224
+
225
+ ## Feedback and contributions
226
+
227
+ Found a bug, have a question, or use SCR-Screen in your work? Please [open an issue](https://github.com/ishaibu/scr-screen/issues). Feedback from utility, ISO/RTO, developer, and consulting engineers is especially welcome.
228
+
229
+ ## References
230
+
231
+ 1. NERC, *Integrating Inverter-Based Resources into Low Short Circuit Strength Systems*, Reliability Guideline, December 2017.
232
+ 2. NERC, *Short-Circuit Modeling and System Strength*, White Paper, February 2018.
233
+ 3. Y. Zhang et al., "Evaluating system strength for large-scale wind plant integration," IEEE PES General Meeting, 2014.
234
+ 4. IEEE Std 1204-1997, *IEEE Guide for Planning DC Links Terminating at AC Locations Having Low Short-Circuit Capacities*.
235
+ 5. IEC 60909-0, *Short-circuit currents in three-phase a.c. systems*.
236
+
237
+ ## License and author
238
+
239
+ MIT License. Created and maintained by **Shaibu Ibrahim, P.E.**
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "scr-screen"
7
+ version = "0.1.0"
8
+ description = "Short-circuit ratio (SCR/WSCR) screening for inverter-based resource interconnection"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Shaibu Ibrahim, P.E.", email = "ishaibu136@gmail.com" }]
14
+ keywords = ["power-systems", "short-circuit-ratio", "grid-interconnection", "inverter-based-resources"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Science/Research",
18
+ "Intended Audience :: Developers",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Scientific/Engineering",
26
+ ]
27
+ dependencies = [
28
+ "pandapower>=3.5",
29
+ "openpyxl", # read Excel network files
30
+ "xlsxwriter", # write Excel network files (scr-screen convert)
31
+ "matpowercaseframes", # read MATPOWER .m files
32
+ ]
33
+
34
+ [project.urls]
35
+ Homepage = "https://github.com/ishaibu/scr-screen"
36
+ Documentation = "https://github.com/ishaibu/scr-screen#readme"
37
+ Issues = "https://github.com/ishaibu/scr-screen/issues"
38
+ Changelog = "https://github.com/ishaibu/scr-screen/blob/main/CHANGELOG.md"
39
+
40
+ [project.scripts]
41
+ scr-screen = "scr_screen.cli:main"
42
+
43
+ [project.optional-dependencies]
44
+ dev = ["pytest>=8"]
45
+ notebook = ["ipykernel"]
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.setuptools.package-data]
51
+ scr_screen = ["data/*.json", "data/*.csv"]
52
+
53
+ [tool.pytest.ini_options]
54
+ testpaths = ["tests"]
55
+ # Harmless notices from inside pandapower (not from SCR-Screen code).
56
+ filterwarnings = [
57
+ "ignore::FutureWarning:pandapower.*",
58
+ "ignore:tap_dependency_table:DeprecationWarning",
59
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """SCR-Screen: short-circuit ratio screening for inverter-based resource interconnection."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,7 @@
1
+ """Allow ``python -m scr_screen``."""
2
+
3
+ import sys
4
+
5
+ from .cli import main
6
+
7
+ sys.exit(main())