Network operations¶
High-level factory functions to build a Network and run fault
calculations. These are the functions re-exported on the top-level
package as groundinsight.create_network,
groundinsight.run_fault, etc.
Physical / modelling context¶
A Network is a graph: each Bus represents a grounding node with
an own electrode impedance \(Z_B(f, \rho)\) (not the earthing impedance
\(Z_E\) of EN 50522, which run_fault computes at the fault bus), every
Branch a
metallic return path with self-impedance
\(Z_\text{branch}(f, l)\) and an optional mutual coupling that
appears as a Norton injection along the source-to-fault path.
Building the network and triggering a fault therefore requires four
ingredients:
- Types —
BusType,BranchTypecarrying SymPy formula strings in the free symbolsrho,fand (for branches)l. - Instances —
Bus,Branchwith concrete values forspecific_earth_resistance,length,parallel_coefficient. - Excitation — at least one
Source(current or voltage) and oneFaultdeclaring which bus is the ground-fault location and which fault scaling per frequency applies. - Frequency list — the harmonics or per-fault spectrum at which the formula-based impedances are evaluated.
run_fault then assembles the nodal admittance matrix, runs the
sparse LU solve per frequency, and stores the result on the
Network (net.results).
Example¶
import groundinsight as gi
# 1. Frequency list and types
net = gi.create_network(name="demo", frequencies=[50.0, 250.0])
bus_type = gi.BusType(
name="GroundRod",
system_type="Substation",
voltage_level=20.0,
impedance_formula="rho/(2*3.14159*1.5)*(1 + j*0.01*f)",
)
branch_type = gi.BranchType(
name="ShieldCable",
grounding_conductor=True,
self_impedance_formula="(0.2 + j*0.4*f/50)*l",
mutual_impedance_formula="(0.0 + j*0.4*f/50)*l",
)
# 2. Instances
gi.create_bus(name="bus_substation", type=bus_type,
specific_earth_resistance=100.0, network=net)
gi.create_bus(name="bus_fault", type=bus_type,
specific_earth_resistance=100.0, network=net)
gi.create_branch(name="line_1", type=branch_type,
from_bus="bus_substation", to_bus="bus_fault",
length=2.0, network=net)
# 3. Source and fault
gi.create_source(name="src1", bus="bus_substation",
values={50.0: 1.0, 250.0: 0.05}, network=net)
gi.create_fault(name="f1", bus="bus_fault",
scalings={50.0: 1.0, 250.0: 0.05}, network=net)
# 4. Run
gi.run_fault(network=net, fault="f1")
print(net.res_buses(fault="f1"))
The same workflow scales to multi-source ring or mesh topologies. The
default phase_current_mode="auto" splits the phase current of a meshed
network by solving the phase-conductor network itself; give the branch
types a phase_impedance_formula, otherwise the split uses proxy
impedances and the result says so (PHASE_PROXY).
A network without excitation is rejected¶
Step 3 is not optional. A network without a source or without a
fault has nothing that drives a current, and the calculation used to
run to completion anyway and report 0 V at every bus. That is a
plausible-looking answer, and the most common way to arrive at it is a
forgotten gi.create_source(...), not a network that is genuinely
unexcited. run_fault (and the path enumeration of
Pathfinder) now raises a ValueError naming the
missing side.
A fault that no source reaches over active elements is a different
matter and stays permitted: that is exactly what an outage scenario
islanding the fault bus produces, and 0 V is then the correct answer.
gi.check_network reports it (FAULT_NOT_REACHED).
create_network_assistant and the n−1 rule¶
A line of n buses has n − 1 branches, so branch_length needs
n − 1 entries:
net = gi.create_network_assistant(
name="Line30", frequencies=[50.0, 250.0], number_buses=30,
bus_type=bus_type, branch_type=branch_type,
branch_length=[1.0] * 29, # 29, not 30
specific_earth_resistance=100.0,
)
Passing n lengths used to drop the last one silently — the two
tests in this repository that did so had been asserting against a
shorter line than they thought for as long as they existed —
and passing too few raised a bare IndexError from inside the loop.
Both now raise a ValueError that states the two counts.
API reference¶
network_operations ¶
Network Operations Module.
This module provides functions for managing the electrical network, including creating networks,
buses, branches, faults, and sources. It also includes functions to build the electrical network,
define paths, and run fault calculations. These operations utilize the core models defined in
groundinsight.models.core_models and interact with the Network instance to perform necessary
calculations and updates.
build_electrical_network ¶
Build the electrical network and attach it to the :class:Network object.
Initialises an :class:ElectricalNetwork helper based on the physical
network's configuration and assigns it to the
electrical_network attribute of the provided :class:Network
instance. This step is invoked automatically by :func:run_fault.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Network
|
The network instance for which the electrical network is to be built. |
required |
auto_phase_currents
|
bool
|
If |
False
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If the :class: |
ValueError
|
If a source that reaches the active fault has a value at none of the
network frequencies. The checks of the input that
:func: |
Warns:
| Type | Description |
|---|---|
InputWarning
|
|
ModelAssumptionWarning
|
|
Examples:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> net.set_active_fault("fault")
>>> gi.build_electrical_network(net)
>>> net.electrical_network.bus_indices
{'bus1': 0, 'bus2': 1, 'bus3': 2}
Source code in src/groundinsight/network_operations.py
create_branch ¶
create_branch(
name: str,
type: BranchType,
from_bus: str,
to_bus: str,
length: float,
specific_earth_resistance: Optional[float] = 100,
description: Optional[str] = None,
network: Optional[Network] = None,
parallel_coefficient: Optional[float] = 1.0,
) -> Branch
Create a new :class:Branch instance and optionally add it to a network.
If a :class:Network instance is provided, the branch is added to the
network, which also triggers the self- and mutual-impedance
calculations against the network's frequency list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the branch. |
required |
type
|
BranchType
|
The type of the branch. |
required |
from_bus
|
str
|
The name of the originating bus. |
required |
to_bus
|
str
|
The name of the terminating bus. |
required |
length
|
float
|
The length of the branch in km; finite and strictly positive. |
required |
specific_earth_resistance
|
float
|
The specific earth resistance for the branch (Ohm * m). Defaults
to |
100
|
description
|
str
|
A brief description of the branch. Defaults to |
None
|
network
|
Network
|
The network to which the branch should be added. Defaults to
|
None
|
parallel_coefficient
|
float
|
Per-branch share of the source-to-fault phase current; used by
the path-based mutual-coupling injection. Defaults to |
1.0
|
Returns:
| Type | Description |
|---|---|
Branch
|
A newly created :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified |
Examples:
>>> import groundinsight as gi
>>> branch_type = gi.BranchType(
... name="StandardBranch", grounding_conductor=True,
... self_impedance_formula="(1 + j * f / 50)*l",
... mutual_impedance_formula="(0.5 + j * f / 100)*l",
... )
>>> branch = gi.create_branch(
... name="Branch1", type=branch_type,
... from_bus="Bus1", to_bus="Bus2", length=1.0,
... )
>>> branch.name
'Branch1'
Source code in src/groundinsight/network_operations.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
create_bus ¶
create_bus(
name: str,
type: BusType,
specific_earth_resistance: Optional[float] = 100,
description: Optional[str] = None,
network: Optional[Network] = None,
) -> Bus
Create a new :class:Bus instance and optionally add it to a network.
If a :class:Network instance is provided, the bus is added to the
network, which also triggers the impedance calculation against the
network's frequency list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the bus. |
required |
type
|
BusType
|
The type of the bus. |
required |
specific_earth_resistance
|
float
|
The specific earth resistance for the bus (Ohm * m). Defaults to
|
100
|
description
|
str
|
A brief description of the bus. Defaults to |
None
|
network
|
Network
|
The network to which the bus should be added. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
Bus
|
A newly created :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the bus cannot be added to the provided network. |
Examples:
>>> import groundinsight as gi
>>> bus_type = gi.BusType(
... name="StandardBus", system_type="Grounded", voltage_level=110,
... impedance_formula="1 + j * f / 50",
... )
>>> network = gi.create_network(name="TestNetwork", frequencies=[50, 60])
>>> bus = gi.create_bus(
... name="Bus1", type=bus_type,
... specific_earth_resistance=100.0, network=network,
... )
>>> bus.name
'Bus1'
Source code in src/groundinsight/network_operations.py
create_fault ¶
create_fault(
name: str,
bus: str,
scalings: Optional[Dict] = None,
active: bool = False,
description: Optional[str] = None,
network: Optional[Network] = None,
t_k_s: Optional[float] = None,
n_factor: float = 1.0,
) -> Fault
Create a new :class:Fault instance and optionally add it to a network.
If a :class:Network instance is provided, the fault is added to the
network. If active=True, the fault becomes the currently active
fault in the network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the fault. |
required |
bus
|
str
|
The name of the bus where the fault occurs. |
required |
scalings
|
dict of float to float
|
Factor applied to the source currents, per frequency. |
None
|
active
|
bool
|
Whether to activate the fault immediately upon creation. Defaults
to |
False
|
description
|
str
|
A brief description of the fault. Defaults to |
None
|
network
|
Network
|
The network to which the fault should be added. Defaults to
|
None
|
t_k_s
|
float
|
IEC 60909-0 short-circuit duration |
None
|
n_factor
|
float
|
IEC 60909-0 AC heat factor |
1.0
|
Returns:
| Type | Description |
|---|---|
Fault
|
A newly created :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified bus does not exist in the provided network, if
|
Examples:
>>> import groundinsight as gi
>>> bus_type = gi.BusType(
... name="StandardBus", system_type="Grounded", voltage_level=110,
... impedance_formula="1 + j * f / 50",
... )
>>> network = gi.create_network(name="TestNetwork", frequencies=[50, 60])
>>> _ = gi.create_bus(name="Bus1", type=bus_type, network=network)
>>> fault = gi.create_fault(
... name="Fault1", bus="Bus1",
... scalings={50: 1.0, 60: 0.8},
... active=True, network=network,
... )
>>> fault.name
'Fault1'
Source code in src/groundinsight/network_operations.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
create_network ¶
Create a new network with the given name and description.
Initialises a :class:Network instance with the specified name,
frequency list and an optional description.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the network. |
required |
frequencies
|
list of float
|
Frequencies (in Hz) at which network calculations are performed. |
required |
description
|
str
|
A brief description of the network. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
Network
|
A newly created :class: |
Examples:
>>> import groundinsight as gi
>>> network = gi.create_network(
... name="TestNetwork",
... frequencies=[50, 60],
... description="A test electrical network",
... )
Source code in src/groundinsight/network_operations.py
create_network_assistant ¶
create_network_assistant(
name: str,
frequencies: List,
number_buses: int,
bus_type: BusType,
branch_type: BranchType,
branch_length: List,
specific_earth_resistance: float,
description: Optional[str] = None,
) -> Network
Create a linear network with a uniform bus and branch type.
Initialises a :class:Network instance and populates it with
number_buses buses and number_buses - 1 branches connected
sequentially to form a line topology. Impedance calculations are
triggered upon adding buses and branches to the network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the network. |
required |
frequencies
|
list of float
|
Frequencies (in Hz) at which network calculations are performed. |
required |
number_buses
|
int
|
The total number of buses to create. |
required |
bus_type
|
BusType
|
The type to assign to each bus. |
required |
branch_type
|
BranchType
|
The type to assign to each branch. |
required |
branch_length
|
list of float
|
Lengths of each branch connecting the buses. Must have
|
required |
specific_earth_resistance
|
float
|
The specific earth resistance for all buses and branches (Ohm * m). |
required |
description
|
str
|
A brief description of the network. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
Network
|
A fully initialised :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Notes
A line of n buses has n - 1 branches, so branch_length
has one entry fewer than number_buses. Passing n lengths --
[1.0] * 30 for number_buses=30, read as "a 30 km line" -- is
refused rather than truncated: dropping the surplus entry would return a
network one span shorter than the one asked for, with no warning
anywhere. Too few entries are refused the same way instead of failing
with a bare IndexError from inside the loop.
Examples:
>>> import groundinsight as gi
>>> station = gi.BusType(name="station", system_type="Substation",
... voltage_level=20.0, impedance_formula="rho * 0.01")
>>> cable = gi.BranchType(name="cable", grounding_conductor=True,
... self_impedance_formula="(0.25 + j * f * 0.012) * l",
... mutual_impedance_formula="j * f * 0.012 * l")
>>> net = gi.create_network_assistant(
... name="Linear5", frequencies=[50.0], number_buses=5, bus_type=station,
... branch_type=cable, branch_length=[1.0] * 4, specific_earth_resistance=100.0)
>>> list(net.buses), list(net.branches)
(['bus1', 'bus2', 'bus3', 'bus4', 'bus5'], ['branch1', 'branch2', 'branch3', 'branch4'])
Source code in src/groundinsight/network_operations.py
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 | |
create_paths ¶
Create all paths between the sources and the faults of the network.
Identifies and maps each source to the ordered branch list of every
simple path to each fault. The identified paths are added to the
network's paths collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Network
|
The network instance for which paths are to be defined. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the network defines no sources or no faults. Path enumeration
runs over |
Notes
The check is on all faults, not on active_fault:
:meth:~groundinsight.models.core_models.Network.define_paths
enumerates every (source, fault) pair, and run_fault sets the
active fault before it calls this function.
Finding no path between an existing source and an existing fault is a different matter and stays permitted -- that is exactly what an outage scenario which islands the fault bus produces, and the all-zero result is then the correct answer.
Examples:
Paths are what phase_current_mode="paths" reads:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> gi.create_paths(net)
>>> [path.name for path in net.paths.values()]
['path_1']
Source code in src/groundinsight/network_operations.py
create_source ¶
create_source(
name: str,
bus: str,
values: Dict,
description: Optional[str] = None,
network: Optional[Network] = None,
i_k_a: Optional[float] = None,
r_to_x: Optional[float] = None,
kappa: Optional[float] = None,
) -> Source
Create a new current :class:Source and optionally add it to a network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the source. |
required |
bus
|
str
|
The name of the bus where the source is located. |
required |
values
|
dict of float to ComplexNumber or complex or float
|
Frequency-resolved injected current. Real numbers are auto-promoted
to :class: |
required |
description
|
str
|
A brief description of the source. Defaults to |
None
|
network
|
Network
|
The network to which the source should be added. Defaults to
|
None
|
i_k_a
|
float
|
Initial symmetrical short-circuit current |
None
|
r_to_x
|
float
|
|
None
|
kappa
|
float
|
IEC 60909-0 peak factor. Takes precedence over |
None
|
Returns:
| Type | Description |
|---|---|
Source
|
A newly created :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified bus does not exist in the provided network, or if any of the IEC 60909 quantities is outside its physical range. |
Examples:
>>> import groundinsight as gi
>>> bus_type = gi.BusType(
... name="StandardBus", system_type="Grounded", voltage_level=110,
... impedance_formula="1 + j * f / 50",
... )
>>> network = gi.create_network(name="TestNetwork", frequencies=[50, 60])
>>> _ = gi.create_bus(name="Bus1", type=bus_type, network=network)
>>> source = gi.create_source(
... name="Source1", bus="Bus1",
... values={50: 10 + 5j, 60: 15 + 7j},
... network=network,
... )
>>> source.name
'Source1'
Source code in src/groundinsight/network_operations.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | |
create_voltage_source ¶
create_voltage_source(
name: str,
bus: str,
voltage: Dict,
source_impedance: Dict,
description: Optional[str] = None,
network: Optional[Network] = None,
) -> Source
Create a Thevenin (voltage) source and optionally add it to a network.
The Thevenin source models a frequency-dependent EMF voltage in
series with a finite source_impedance. In contrast to
:func:create_source, which creates an ideal current source for
stationary studies, this factory is intended for transient analyses
where the fault current is determined by the loop impedance
Z_src + Z_loop rather than being prescribed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the source. |
required |
bus
|
str
|
The name of the bus where the source is located. |
required |
voltage
|
dict of float to ComplexNumber or complex
|
Frequency-dependent EMF. |
required |
source_impedance
|
dict of float to ComplexNumber or complex
|
Frequency-dependent internal impedance. Must use the same
frequency keys as |
required |
description
|
str
|
A brief description of the source. Defaults to |
None
|
network
|
Network
|
The network to which the source should be added. Defaults to
|
None
|
Returns:
| Type | Description |
|---|---|
Source
|
A newly created Thevenin source instance with
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified bus does not exist in the provided network, or if the input dictionaries do not satisfy the voltage-mode constraints. |
Examples:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> source = gi.create_voltage_source(
... name="grid", bus="bus1",
... voltage={50: 11547.0}, source_impedance={50: 0.5 + 2.0j},
... network=net,
... )
>>> source.source_type, sorted(net.sources)
('voltage', ['grid', 'src'])
Source code in src/groundinsight/network_operations.py
run_fault ¶
run_fault(
network: Network,
fault: str,
auto_parallel_coefficients: Optional[bool] = None,
*,
phase_current_mode: str = "auto",
)
Execute the fault calculation pipeline for a single fault.
Sets the named fault as the active fault, builds the electrical
network, solves the per-frequency nodal system, computes branch
currents, reduction factors and grounding impedance. The results are
stored on network.results[fault]. :func:groundinsight.solve runs the
same pipeline without writing anything into network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Network
|
The network instance on which the fault calculations are to be performed. |
required |
fault
|
str
|
The name of the fault to activate and run calculations for. The
former keyword |
required |
auto_parallel_coefficients
|
bool
|
Deprecated alias for |
None
|
phase_current_mode
|
(auto, paths)
|
How the phase current per branch is determined.
|
"auto"
|
Returns:
| Type | Description |
|---|---|
Result
|
The result of the run -- the same object that is stored as
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified fault does not exist in the network, if the
network defines no sources or no faults at all, or if
|
RuntimeError
|
If there is an error during the network calculations. |
Warns:
| Type | Description |
|---|---|
ModelAssumptionWarning
|
Among others (every package warning of the run is collected into
|
Notes
"auto" does not enumerate the source-to-fault paths. It only
needs to know which sources reach the fault, which
:meth:~groundinsight.models.core_models.Network.sources_reaching
answers with a breadth-first search over the active sub-graph. The
enumeration is exponential in the number of independent loops -- a
6x6 grid has 1 262 816 simple paths, about a minute of enumeration per
run_fault while the solver itself needs milliseconds -- so it runs
only in "paths" mode or when the user asks for it with
:func:create_paths. network.paths is therefore normally empty
after a default run_fault; a path set that no longer matches the
active topology is dropped so no later reader picks it up.
Examples:
>>> import polars as pl
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> result = gi.run_fault(net, "fault")
>>> result is net.results["fault"]
True
>>> epr = net.res_buses("fault").filter(pl.col("is_rms"))
>>> [(row["bus_name"], round(row["EPR_V"], 2)) for row in epr.iter_rows(named=True)]
[('bus1', 18.03), ('bus2', 0.0), ('bus3', 18.03)]
Source code in src/groundinsight/network_operations.py
819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 | |
set_active_fault ¶
Activate fault on network and deactivate the others.
Thin wrapper around :meth:Network.set_active_fault so the
keep_results= keyword is reachable from the public top-level
API surface (gi.set_active_fault(net, "F1", keep_results=True))
rather than only via the bound method on the :class:Network
instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Network
|
The network to operate on. |
required |
fault
|
str
|
The name of the fault to activate. The former keyword
|
required |
keep_results
|
bool
|
Forwarded to :meth: |
``False``
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified fault does not exist in |
Notes
Exposes the keep_results keyword at the top-level API surface
where it would otherwise only be reachable as a bound method.
Examples:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> _ = gi.create_fault(name="near", bus="bus2", scalings={50.0: 1.0}, network=net)
>>> gi.set_active_fault(net, "near")
>>> net.active_fault, net.faults["near"].active, net.faults["fault"].active
('near', True, False)