Changelog¶
All notable changes to groundinsight are documented in this file.
The format is based on Keep a Changelog.
Releases up to 0.6.0 followed Semantic Versioning;
from the first release after 0.6.0 on, the project uses
calendar versioning in the form YYYY.M.MICRO — the
year, the month without a leading zero, and a counter that restarts at 0 in
every month (2026.11.0, 2026.11.1, 2026.12.0, 2027.1.0). The month
carries no leading zero because PEP 440 normalises 2026.01.0 to
2026.1.0, and a padded tag would never match the version on PyPI.
A calendar version says when a release was cut, not whether it is compatible with the previous one. Two rules carry that promise instead:
- Every change that can break working user code is listed under Breaking with a migration note, in addition to its regular entry.
- A deprecated feature keeps working and emits a
DeprecationWarningfor at least two releases and six months before it is removed.
Change categories follow the Keep-a-Changelog vocabulary, plus Breaking:
- Breaking — changes that can break working user code, each with a migration note (also listed under their regular category).
- Added — new features and public API.
- Changed — behaviour changes to existing public API.
- Deprecated — features that still work but will be removed.
- Removed — features taken out of the public API.
- Fixed — bug fixes.
- Security — vulnerability fixes.
- Docs — documentation-only changes.
- Internal — refactors, tests, packaging, CI; no observable behaviour change.
The backlog of ideas that are not yet scheduled is kept at the end of this
file under Roadmap. During regular work, add your entry under the
matching category in [Unreleased]; the release script
(scripts/release.py) moves the whole [Unreleased] block into a new
version section when a release is cut.
Unreleased¶
Internal¶
- Documentation deploys queue instead of racing
(
.github/workflows/docs.yml). The merge before 2026.11.1 and its release commit started two deploys within seconds. The second one built on thegh-pagestip it had checked out, the first one moved that tip, and the repository ruleset rejected the second push as a non-fast-forward update. Deploys now share a concurrency group, so the second run checks out after the first has pushed, and the command no longer passes--force, which the ruleset never grants. - The timing acceptance tests tolerate a stalled runner
(
tests/test_audit_pass19_performance.py). On the macOS runner of the 2026.11.1 release commit one solve took 3.4 s against a limit of 3 s; the same solve needs 0.5-1.5 s elsewhere. A timing over its limit is now measured once more on a freshly built network and the faster attempt counts, garbage is collected before each timed call, and the limit for a solve of the large networks is 5 s -- still a quarter of what the dense kernel needs. The structural tests that fail on any dense solve are unchanged.
2026.11.1 — 2026-11-14¶
2026.11.0 was tagged but never published: the test gate of the release workflow stopped it before the build. This release carries its content unchanged; the notes are in the 2026.11.0 section below.
Internal¶
- The changelog check passes on a release commit
(
tests/test_audit_pass19_standards.py). The check asked for###headings under[Unreleased], but right after a release the release script leaves only the_No changes yet._stub there, so the test gate of the release workflow stopped the publish of 2026.11.0. The check now reads[Unreleased]during regular work and the section just cut on a release commit. Its tests roll changelogs withscripts/release.pyitself, so check and script cannot drift apart again.
2026.11.0 — 2026-11-14¶
Tagged, but not published on PyPI; the same content was released as the next version.
Breaking¶
Each item is detailed under its regular category below; this list is the migration checklist.
- Version scheme. The first release after 0.6.0 is numbered by the
calendar (
YYYY.M.MICRO). A Poetry constraint such asgroundinsight = "^0.6"will not pick it up; usegroundinsight = ">=2026.11". frequency_Hzis numeric inres_buses(),res_branches()and the sweep frames; the RMS rows are marked by the boolean columnis_rms. Replacepl.col("frequency_Hz") == "RMS"withpl.col("is_rms")and== "50"with== 50.0. (OutageStudyResult.compare_*()keeps its string join key.)network.pathsis empty after a defaultrun_fault. Callgi.create_paths(network)where the enumerated paths are needed as data.- Networks that used to solve silently now raise: an active element
without an impedance at a solved frequency,
kappa/noutside the IEC 60909 range, negativeR/L/C/Mfields in the state-space solver, assignments that violate a field validator, formulas calling functions outside the whitelist,bus_responseon a stale nodal system, andImportDefaults(frequencies=[]). Each message names the element and the fix. - Values change where the old ones were wrong:
value_currentwith a source on the fault bus;BusResponse.evaluate(Z_G_Ohm,r_epr);I_th/i_pwith a 0 Hz bin;analyze_cutsat 0 Hz and with Thévenin sources (new rowsource_loop); FFT transients with unreachable sources; the state-space solver with 0 Hz first in the frequency list, and its time series is one sample shorter. - Persistence. Databases written by 0.6.0 or earlier are migrated when
they are opened (a backup is kept); JSON writes
"inf"instead of the non-standardInfinity(old files still load);save_networkrefuses to rewrite a bus or branch type shared with another network unlessoverwrite_types=True. - Top-level API.
gi.NetworkDB,gi.BusTypeDBandgi.BranchTypeDBare no longer re-exported;gi.Pathis the domain model, notpathlib.Path;BusResponse.admittancelost its unusedfreqargument; the reference caseen50522_chainnow checksI_E. - Release tooling. The console command
poetry run releaseis gone; runpoetry run python scripts/release.py. - Dependencies. pillow 13.0.0 or newer is required (security floor, see Security). Upgrade pillow in the environment; if another package there caps pillow below 13, that package has to move first (SEC2).
- State-space transients of meshed networks with mutual coupling change
value. The phase current that drives the coupling is now divided between
the routes of a ring or mesh like the stationary default
phase_current_mode="auto"; before, every route carried the full source current. Chains, trees and networks without coupling are unchanged. Migration: there is no switch back — the old numbers were those of the legacy split (run_fault(..., phase_current_mode="paths"), still available stationarily).Branch.parallel_coefficientis no longer read byTransientStudy, and a state-space solve no longer fillsnetwork.paths; callgi.create_paths(network)where the paths are needed as data. (PH2) sessionanddb_sessionare no longer ingroundinsight.__all__, and the session globals can no longer be assigned. A star import does not bind them any more, and assigninggi.session,gi.engine& co. no longer redirects the module-level persistence functions, which now use the defaultgi.Database. Migration: use the object thatgi.start_dbsession(path)returns, orgi.Database(path)—db.session()yields a short-lived SQLAlchemy session,db.engineis the engine. Readinggi.sessionkeeps working with aDeprecationWarning. (ARC2)- Formulas of a bus or branch type may only use the symbols the evaluator
binds. A bus formula is evaluated with
fandrho, a branch formula withf,rhoandl;j,I,piandEare available in both. Any other name (L,F,Rho,R + j*X…) used to be accepted and failed only atcreate_bus/create_branchwith "Cannot convert expression to float"; it now raises when the type is created, naming the symbol, the allowed set and the case-insensitive match. Migration: write the symbols in lower case as listed; a bus formula has nol. (USE2) Branch.lengthmust be a finite length > 0 km. Zero, negative, NaN and infinite lengths are rejected at construction and on assignment, with a message about the length. They used to surface as "exactly zero impedance" or as a negative real part, and a detached branch was not checked at all. Migration: model a bus coupler or jumper with a short positive length (e.g.0.001). A database or JSON file with such a branch no longer loads until the length is corrected. (USE5)- Tighter formula limits. Exponents above 12 (written out or computed,
e.g.
10**-15,9**(2*7)), number literals with more than 100 digits, hexadecimal/octal/binary literals, more than 512 terms, more than 8 calls or more than 3 arguments per call,floor/ceilingof a value with more than 100 digits andexp/sinh/coshof an argument above 1e100 are rejected. No formula in the documentation, the notebooks or the test suite comes near any of them (at most 6 digits, exponent 2, 27 terms, 2 calls, 2 arguments). Migration: write small factors with an exponent part (1e-15instead of10**-15). (SEC1) - Edit invariants. Renaming a bus, branch, source or fault that belongs to
a network, rewiring a branch, source or fault to a bus the network does not
have, adding an element that belongs to another network, and assigning a
field of a
BusType/BranchTypenow raiseValueError. Migration: remove the element and add a renamed copy; addelement.model_copy(deep=True)to a second network; change a type withnew = bus_type.model_copy(update={...})andnetwork.update_bus(name, type=new). (GUI3, F9) ResultReductionFactor.u_earthing/z_earthingand the grounding impedance are now the EN 50522 quantities at the fault bus.u_earthingis the EPR of the fault bus (U_E);z_earthing,ResultGroundingImpedance.value,Z_Ginres_all_impedances()andZ_G_Ohmofbus_responseare the driving-point impedance of the earthing network there (Z_E). Migration: the old values (the current-weighted mean potential of the earth group and that mean divided byI_E) are inu_earthing_group/z_earthing_group. A result stored before the change loads with its values moved to those fields,u_earthing/z_earthingand the grounding impedance left empty, and an info diagnosticLEGACY_EARTHING_DEFINITION; run the fault again to getU_EandZ_E. (PH4, F4)run_faultraisesValueErrorfor a source that has no value at any network frequency. Such a source used to contribute 0 A, and the run reported 0 V at every bus. Migration: give the source values at the network frequencies, or deactivate it. (USE3, F8)- Earth-return quantities that are undefined are
None, not rounding noise.I_E,value_currentand the earth group areNone/[]when no electrode current exceeds1e-9·|I_F|. The EPR-basedvalueisNonewhen the fault-bus EPR without coupling is below1e-9·|I_F|·|Z_E|. Migration: code that turns these fields into floats has to handleNone; the diagnosticsEARTH_GROUP_UNDEFINEDandREDUCTION_FACTOR_UNDEFINEDgive the reason. (P9, F14) - A real part of minus infinity is refused, not read as an open circuit.
A bus formula with a
log(f)term that no factor offcancels, such asrho*0.01 + log(f), is −∞ at 0 Hz (log(0)). The passivity checks looked at finite values only, so −∞ passed and the solver read1/(−∞) = 0: the electrode was disconnected at DC without a word — in a DC study and in the 0 Hz bin of every transient study, while a bin just above 0 Hz is refused for its negative real part (1 + log(f)is negative below 0.37 Hz). −∞ is the limit of negative resistances and is now refused like one, for bus impedances, grounding-conductor self impedances and voltage-source impedances: where the element is built, on the transient FFT grid and before the solve. Refusing rather than warning, because there is no value to continue with — +∞ would be an open circuit the formula does not describe — and because the same formula with a Carson term beside it was already refused (its approach to 0 Hz ends on a finite negative value). Positive infinity — the"nan"open end,1/f, a capacitance at DC — stays an open circuit, and a network that does not list 0 Hz never evaluates the formula there and is not affected (a transient study always does). Migration: give the formula a finite DC value — let the frequency-dependent part vanish at 0 Hz (f*log(...), as in Carson's terms) or state the DC resistance as a term withoutf— or leave 0 Hz out of a stationary study. (D7)
Added¶
run_outage_study(..., on_error="raise"|"record")andOutageStudyResult.failures, matchingrun_sweep.ImportDefaults.switch_branch_type,switch_length_kmandderive_phase_impedance(aphase_impedance_formulafromr_ohm_per_km + I*x_ohm_per_km, deduplicated by formula) for the pandapower importer;preview_pandapower_import(..., defaults=...).utils.impedance_calculator.compute_impedance_arrayandcheck_passive_impedance_array— the array path the transient solver uses; same results, same messages, without aComplexNumberper bin.Network.sources_reaching(fault_name),PathFinder.reaches,set_/get_pathfinder_max_paths,ElectricalNetwork.state_fingerprint().- A shared
simple_networkfixture intests/conftest.py. - CI: the release workflow runs the test suite before it builds; pull
requests run
mkdocs build --strictand executedocs/examples/*.ipynb. TransientStudy.solve(..., fft_block_bytes=None)bounds the memory of the FFT solver. Upper bound in bytes for one batch of dense admittance matrices, 256 MiB by default; the batch holdsmax(1, min(512, fft_block_bytes // (16 * n**2)))frequency bins fornactive buses. A non-integer raisesTypeError, a value ≤ 0ValueError. (P8)- Diagnostic code
TRANSIENT_PHASE_SPLIT(ModelAssumptionWarning, elements: the coupled branches). Raised by the state-space solver when the phase split of a meshed network depends on frequency — routes of different R/L ratio — so that a DC offset and harmonics are divided as atf_eval. (PH2) gi.Database(path, *, migrate=True)— the SQLite store as an object. It owns its engine and session factory and offers the persistence operations as methods:save_bustype/load_bustypes/delete_bustype, the same for branch types,save_network/load_network/list_networks/delete_network,needs_migration/migrate,session()for direct ORM work,close()and the context-manager protocol;":memory:"gives a private in-memory database. Up to 0.6.0 the store lived in module globals: one database per process (a second file raised) and one session registry shared by every caller, which a GUI with two open projects or a server cannot use. Every method now runs in its own short-lived session; two databases on two files work from two threads at the same time, and one database works from several threads — operations on the same file are serialised by a lock shared by everyDatabaseof the process on that file. Without that lock, two threads saving networks that share a bus type failed withIntegrityErrorin 5 of 5 trials; with it, in none. A type a stored network still uses cannot be deleted. The new list/delete operations are also available asgroundinsight.database.crudfunctions. (ARC2)- The JSON project file carries
schema_versionandgroundinsight_version. Both are top-level keys in front of the model fields, soNetwork.model_validate_jsonstill reads a project file and a 0.6.0 installation still opens one.load_network_from_jsonrefuses a file of a newer schema with aValueErrorthat names both versions, instead of silently dropping what the newer release stored; files without the keys (0.6.0 and earlier) load unchanged. The current version isgroundinsight.io.project_file.SCHEMA_VERSION = 1. (GUI1) Network.stale_results()andNetwork.is_result_stale(fault)tell which stored results no longer match the network.run_faultstampsResult.input_digest, a digest of everything the result was computed from: the frequencies, every bus, branch and source as the solver reads them, and the definition of the result's own fault. The comparison is by content, so an undone edit makes a result current again, andoutage_context,run_sweepand the rho searches -- which restore the network -- leave the flags as they found them; the result a study leaves behind computed under modified inputs (last outage scenario, last sweep point) is reported stale. Metadata (description,Fault.t_k_s/n_factor, a source's IEC 60909 characteristics) and other faults do not count. The digest survives JSON and the database (results are stored as JSON there; no migration); results without one -- written by an older version -- are never reported. Cost: 10 ms per check on a 1000-bus ring with 7 frequencies. (GUI3, F9)Network.update_bus(name, **fields)andNetwork.update_branch(name, **fields). Every value is validated on a detached copy, bus references are checked and the impedances derived before anything is written -- all or nothing. Derived fields (impedance,self_impedance, …) andnameare refused with an explanation. (GUI3, F9)Network.remove_bus/remove_branch/remove_source/remove_fault.remove_busrefuses while a branch, source or fault refers to the bus and names every one of them;remove_faultalso drops the stored result and the active flag; enumerated paths through a removed element are invalidated. Unknown names raiseValueError, likerun_faultfor an unknown fault. (GUI3, F9)utils.validations.check_formula_symbols,BUS_FORMULA_SYMBOLS,BRANCH_FORMULA_SYMBOLS,FORMULA_CONSTANTS-- the symbol check of the type validators, usable by a formula editor. (USE2)ResultReductionFactor.i_fault,u_earthing_group,z_earthing_group.i_faultis the denominator ofvalue_current(the sum of the scaled source currents that reach the fault). The two group fields keep the earth-group mean as a diagnostic. (PH4, F4)Fault.scaling_at(frequency), andscalingsis optional.create_fault(..., scalings=None),scalings={}andFault(...)without the argument all mean factor 1.0 at every frequency.scaling_atis the one place that applies this default. (PH6, USE4, F7)ElectricalNetwork.earthing_admittance_matrix(freq)andElectricalNetwork.thevenin_loop_admittances(freq). The first is the earthing network alone: electrodes and shields, without coupling and without Thevenin loop closures, from whichZ_Eis computed. The second returns the loop-closure stamps that the Y assembly and the earthing matrix share.BusResponse.fault_driving_point(z_bus, freq)returnsZ_Efor the electrode under test. (PH4)- Diagnostics with codes, collected in
Result.diagnostics:ModelAssumptionWarningEARTH_GROUP_UNDEFINED,REDUCTION_FACTOR_UNDEFINED,EARTHING_IMPEDANCE_UNDEFINED(P9, PH4),PHASE_PROXY(PH3),THEVENIN_COUPLING(PH1),SOURCE_WITHOUT_PHASE_PATH(PH9) andTHERMAL_DC_EXCLUDED(PH10);InputWarningSOURCE_FREQUENCY_GAP,SOURCE_FREQUENCY_OUTSIDE_NETWORK(USE3) andSCALINGS_INCOMPLETE(PH6); infoLEGACY_EARTHING_DEFINITION(PH4). BusResponse.z_fault_ideal. Where the electrode at the studied bus is the only one on the fault side, the earthing network without it floats and its open-network values (z_fault_open,z_fault_transfer,z_bus_open) do not exist.Z_Estill exists for every electrode there, because all of the current leaves through it:fault_driving_point(z_bus)returnsz_bus + z_fault_ideal, wherez_fault_idealis the driving point at the fault bus with an ideal electrode at the studied bus. With no electrode, it returnsNone. (PH4 follow-up)gi.solve(network, fault)— a fault solve that writes nothing into its input.run_faultstores the result, activates the fault, may drop or rebuild the path set and attaches the assembled admittance system: right for a notebook, wrong for a GUI whose worker thread solves while the user interface reads the network, for an undo history, or for a study that promises to hand its input back.solveruns the unchangedrun_faultpipeline on an overlay that shares the bus, branch and source objects (read only) and owns everything a solve writes, so its result is bit-identical torun_fault's — serialised comparison on a chain, a ring and a Thevenin network in both phase-current modes, and the closed formr = |(Z_s - Z_m)/(Z_s + Z_A + Z_B)|of a two-bus line to 4.4e-16 — and the network is unchanged afterwards: serialised form, stored results, active fault, path set, assembled system and private state, also when the solve raises. The overlay is a copy, not a construction, so the input's elements stay attached to the input and keep re-deriving on edits. The result carries the input digestrun_faultwould stamp: kept withnetwork.results[fault] = result, it counts as current forstale_results()until the next edit. Not for two threads solving the same network object at once — the path caches are module-level. (ARC1)gi.check_network(network, *, fault=None)— every problem of a network as data. Returns a list ofDiagnosticrecords (code, severity, message, elements) and never raises;[]for a sound network. 25 codes, listed with their severity ingroundinsight.checks.CHECK_CODES: invalid elements and frequencies, missing excitation, references to buses that do not exist, impedances the solver cannot invert (missing, NaN, not passive, formula errors), source frequency coverage, faults on unknown or inactive buses, partial scalings, faults no source reaches, isolated buses and earthing islands without a reference to earth. A branch end or a source on a bus that does not exist is something the solver drops without a word — on a four-bus ring with one branch pointing at a missing bus the maximum EPR became 239 V instead of 73 V; the editing API refuses such a reference, but a hand-edited project file or a script-filled network can carry one. The check is structural — no assembly, no solve — so a GUI can run it after every edit, and every severity is cross-checked against the solver: in 20 malformed networks eacherroris one on whichrun_faultraises or returns 0 V for a network that is not the one described. The codesSCALINGS_INCOMPLETE,SOURCE_FREQUENCY_GAPandSOURCE_FREQUENCY_OUTSIDE_NETWORKmean what they mean inResult.diagnostics. (GUI9)- Progress reports and cooperative cancellation in the five long-running
studies.
run_sweep,run_outage_study,find_max_rho_scaling,find_max_rho_f_scalingandTransientStudy.solvetakeprogress(done, total, label), called after every unit of work — a sweep point, an outage scenario, one solve of a search, a batch of FFT bins (at most 512, fewer under a tightfft_block_bytes), a stage of the state-space solver — andshould_cancel(), asked before every unit. A true answer raises the newgi.StudyCancelled(aRuntimeErrorwithdoneandtotal) and puts the network back exactly as it was when the study was called: serialised form, stored results and their order, active fault, paths, assembled system. Python cannot stop a thread from outside, so until now a GUI or a server could only wait for a running study. The searches announce their total before the first solve — a log-bisection needs the same number of halvings wherever the threshold lies — and match it: 20 progress calls for 20 solves at the default settings, and the announced total equalsn_scan + kfor every tolerance and grid tried. Results with and without hooks are identical. (GUI5) - Networks as tables:
gi.network_from_tables(...)andNetwork.to_tables(). Ten tables with a pinned schema (groundinsight.io.TABLE_SCHEMAS: column order and dtype; onlyfrequencies,bus_typesandbusesare required), as Polars frames, CSV files or a directory of<table>.csvfiles; for a workbook,pl.read_excel(path, sheet_id=0)returns the dict of sheetsnetwork_from_tablestakes (Polars needs its optionalfastexcelfor that). The tables hold input only: the network is built through the sameNetwork.add_*path ascreate_bus& co., so every formula passes the formula guard and every impedance is evaluated from its type; results and paths are not exported. Network → tables → network is identical (model_dump_jsonwithout results) for four example networks and the shared test fixture, through frames and through CSV, and the rebuilt networks solve to identical results. Malformed tables raise oneValueErrorthat lists every problem with table, row and column — missing or unknown columns (a typo such aslenghtis not dropped silently), decimal commas, duplicate names, references to buses, types, sources or faults that do not exist, validation errors. Alsogroundinsight.io.network_to_tables. (USE6) Network.res_fault(fault)— the key figures of a fault in one table. Fault current, EPR at the fault and the largest EPR with its bus, the EPR-based and the current-based reduction factor, the earth-return currentI_E, the EN 50522 earthing voltageU_Eand earthing impedanceZ_Ewere spread overNetwork.faults,ResultBus,ResultReductionFactorandResultGroundingImpedance, and every GUI tile, report template or script picked them out itself.res_faultreturns one Polars frame with the pinned schemagi.RES_FAULT_SCHEMA: one row per network frequency and one RMS row (is_rms,frequency_Hznull), magnitudes and angles, andn_diagnostics, the number of records inResult.diagnostics, on every row. A value the result marks as undefined is null —r_currentandI_E_Aat a frequency without fault current,U_E/Z_E/I_Fof a result stored before these fields existed; ratios, impedances and angles are null on the RMS row, which carries the stored RMS EPR and root sums of squares ofI_F,I_EandU_E. It reads the stored result only and changes nothing: an unknown fault is aValueError, a fault without stored result aRuntimeErrorthat namesrun_faultandsolve, and a stale result is reported as stored (stale_results()says so). Every column agrees with the result field it names and with an independent nodal solver to 1e-12 on a radial chain, a meshed cable/overhead-line ring and a network with two infeeds of different angle. (USE1, GUI6)gi.PathfinderSettingsandNetwork.pathfinder_settings— the limit and the memory of the path search belong to the network. Up to 0.6.0 the limit (set_pathfinder_max_paths) and the memory size (set_pathfinder_cache_size) were process-wide switches, and the memory was three module-level dictionaries shared by every network. A limit set for one network applied to all of them — also to a network another thread was solving at that moment — the dictionaries were changed from several threads without a lock, and they kept every branch of a deleted network alive. Nownet.pathfinder_settings = gi.PathfinderSettings(max_paths=…, cache_size=…)configures one network; the settings are frozen and validated (positive integers, nobool, no float),Nonereturns to the process default (max_paths=100_000,cache_size=256), and a network only accepts aPathfinderSettings(TypeErrorotherwise). Each network owns its memory: three LRU tables bounded by its owncache_size, holding the network only weakly; every copy (model_copy,copy,deepcopy, pickle) starts with an empty one and keeps the settings. The settings are runtime configuration and are not written to project files or the database. The limit error names the per-network fix. Measured: two 4 × 4 grids (184 paths each) with limits 100 and 1000, solved in two threads for four rounds — before, one of the two results was wrong in every round (4 of 8, independent of timing, because the last global write wins); now 0 of 8, equal to two sequential runs. (ARC2)- Service layer
groundinsight.apifor front ends. A GUI, a server and the command line need the same things around a network that a notebook does not: a session that owns one project, undoable edits, calculations off the caller's thread, and data that travels as JSON.ProjectSessionholds one network with a revision counter (undo/redo return to the number of the state they restore), resource limits as constructor parameters (max_buses,max_branches,max_job_runtime_s,max_undo,max_paths) and a file or aProjectStorelocation (MemoryStore,DatabaseStoreovergi.Database); open and save use the library's project-file functions, without results. Nineteen commands (add/update/remove for buses, branches, sources, faults, bus types, branch types;SetFrequencies) go through the library's editing API, are atomic and undoable — after undo the serialised network equals the one before, and a rejected command changes nothing and names the library's reason. Whether a result is stale is the library's verdict (Network.is_result_stale), so undo makes a result current again.JobRunnerruns solve, solve_all, sweep, outage and max_rho jobs in a thread or a process with progress, cancel (JobCancelledis agi.StudyCancelled), a runtime limit and results bound to the revision they were computed from. 25 DTOs (pydantic, strictly JSON-safe,dto_schema_version = 1) withjson_schemas()for 27 schemas. The key figures equalres_faultexactly and the independent reference solver to 1e-10 on the documented examples. Exported fromgroundinsight.api, not from the package root. (GUI1–GUI9, ARC1) - Command line
python -m groundinsight/groundinsight.run <project.json> --fault <name> [--format table|json|csv]andcheck, built on the service layer (the same DTOs as the GUI); exit codes 0 (fine), 1 (check errors or a failed solve), 2 (usage or file problems). groundinsight-gui, a separate distribution ingui/(GUI phase 0). NiceGUI 4.0, browser mode by default,--nativefor a desktop window, German and English. Start page with templates and opening a project file, editable element tables (every edit a command, undo/redo), a fault or all faults as a background job with progress and cancel, key-figure tiles, key figures per frequency, EPR per bus as chart and table, the diagnostics of the result with links to the elements they name, the stale marker, the pre-flight check, save and save-as. Every number on screen is a DTO field; the GUI tests check the shown values againstres_fault/res_busesof an independently solved twin and against the reference solver. Released together with the library under the same version, pinned to it.groundinsight.diagnostics.note()records an informational diagnostic on the current run without raising a warning. Some findings explain a result rather than cast doubt on it; raising them as warnings would make every study that places trial faults on every bus repeat them, and a strict warnings filter would turn a correct result into an error.noteappends aDiagnosticwith severity"info"to the activecollecting()sink and does nothing outside one.
Changed¶
- Calendar versioning (
YYYY.M.MICRO) instead of SemVer.scripts/release.pycomputes the next version from the release date — the first release in a month gets the counter 0, every further one counts up — andsetaccepts only a well-formed calendar version for the month of the release date that is newer than the current one. The SemVer bump kindsmajor/minor/patchstop with an explanation instead of guessing, andCITATION.cffgains adate-releasedfield on every release. The month carries no leading zero because PEP 440 strips it (2026.01.0is published as2026.1.0), so a padded tag would never match PyPI. The head of this file states the scheme and the deprecation policy that replaces the compatibility promise SemVer used to carry. - Two reference cases were replaced by ones that can fail.
en50522_chaincheckedU_E = 3*I_0 * Z_E * rwith all three factors read out of one result — an identity the implementation closes by construction, so the case agreed to 1e-16 whatever the model did, and tripling every electrode current made the deviation smaller. It now re-derivesI_Efrom an independently assembled nodal system (quantity and tolerance changed).ladder_potential_decaybuilt its matrix from local constants rather than from the model and is now assembled frombus.impedance/branch.self_impedance. summarizegains ann_nancolumn andcheck_conductor_limits/check_node_limitsgainI_dc_AandI_ac_rms_A. Code that asserts an exact column set has to be updated.-
BusResponse.admittancelost itsfreqargument, which it never read. -
res_buses()/res_branches()reportfrequency_HzasFloat64with the RMS row marked by a newis_rmscolumn, instead of a string column mixing"50"and"RMS"that could not be compared with a number and disagreed withres_all_impedances(). Filter withpl.col("is_rms")andpl.col("frequency_Hz") == 50.0; both frames also gainI_inj_A/I_inj_degree, the earthing-conductor current theResultBusdocstring warns not to confuse with the electrode current. All threeres_*frames carry a pinned schema, so an empty result keeps its columns. net.pathsis empty after a defaultrun_fault(see Fixed); paths that were persisted with the network are adopted on load and survive the next solve as long as the topology still matches.- The FFT transient solver warns (
TransientModelWarning, exported) when the network carries mutual coupling it does not model, when the active fault hasscalingsother than 1 (both solvers ignore them), and when the window ends while the response is still ringing — the periodic DFT then wraps the tail into the start of the trace (measured −37 % on the peak with a 0.4 s window).solve(..., zero_pad=True)computes on a window twice as long and reports the first half.|M_mutual| > L_selfwarns as the usual mH/H slip. Both solvers share one time grid; the state-space series is one sample shorter than before ([0, t_end)), a real branch named__vsrc__…is refused. - Non-finite floats are written as the strings
"inf","-inf","nan"in JSON and in the SQLite JSON columns, because the open-end sentinel of the"nan"formula used to be emitted as the literalInfinity, which is not RFC 8259 JSON (SQLitejson_valid()= 0,JSON.parsethrows). Old files still load. gi.Pathis the domain model, notpathlib.Path;Network,Bus,BusType,Branch,BranchType,Fault,Source,Result,ResultBus,ResultBranch,ComplexNumberare exported and in__all__; the ORM classesBusTypeDB/BranchTypeDB/NetworkDBare no longer reachable from the top-level package.run_fault(auto_parallel_coefficients=…)emits aDeprecationWarningin addition to the log line, which without a logging setup nobody saw.scripts/is not packaged and therelease/generate-third-party-licensesentry points are gone: they installed a top-level modulescriptsand an executable calledreleaseinto every user's environment. Runpoetry run python scripts/release.py …instead.python = "^3.13"(was^3.14); the suite passes unchanged on 3.13 and CI runs both.ImportDefaultsvalidatesrho,frequenciesandswitch_length_kmon construction, so an empty frequency list fails at the defaults rather than deep in the importer.- Python 3.12 is the floor (
python = "^3.12", was^3.13). The full suite passes on 3.12, 3.13 and 3.14, andgroundfield— which requires^3.12and was therefore held at groundinsight 0.3.0 — can follow current releases again. README and the installation page say "Python 3.12 or newer" (they said 3.14); the wheel declaresRequires-Python >=3.12,<4.0and the 3.12/3.13/3.14 classifiers, which Poetry derives from the constraint (F10, REL4, REL6). save_network_to_jsonwrites UTF-8 atomically;load_network_from_jsonreads UTF-8. The file used to be opened without an encoding, so the locale decided: on Windows (cp1252) a name withΩorρraisedUnicodeEncodeErroron save, and a file with"Süd"written on macOS came back as mojibake. The writer serialised after truncating the target, so a failure in between left an empty or half-written project. Now the network is serialised first, written to a temporary file in the target directory, flushed andfsync-ed, and moved over the target withos.replace; a failure leaves the previous file byte-identical. The replaced file keeps its permission bits, a read-only file is refused, a symbolic link keeps pointing at the saved file; hard links to the old file keep the old content. Reading accepts a UTF-8 byte-order mark. A file that is not UTF-8 (0.6.0 on a Windows machine) is read with the platform's preferred encoding, as 0.6.0 did, with anInputWarningPROJECT_FILE_LEGACY_ENCODING. Invalid JSON and a non-object top level are reported asValueErrornaming the file (formerly apydantic.ValidationError, which is aValueErroras well). The functions live ingroundinsight.io.project_file; names and signatures are unchanged, andpathmay be anyos.PathLike. (GUI1)gi.start_dbsession(path)returns the defaultDatabase. The module-level helpers (start_dbsession,close_dbsession,save_*_to_db,load_*_from_db) keep their names, arguments, messages and errors and delegate to that object; without a started session they still raiseRuntimeError. They moved from the package__init__togroundinsight.database.store(re-exported as before). (ARC2)import groundinsightno longer importsmatplotlib.pyplot. The plotting helpers import it on their first call. The package import is about a third faster — median 1.33 s → 0.83 s (minimum 0.95 s → 0.60 s, 40 interleaved runs in fresh interpreters) — and a program that never plots, such as a GUI or a server, never loads pyplot's global state.typing.get_type_hintson a plotting helper needsmatplotlib.pyplotimported first. (GUI8)- Assigning an input of an element that belongs to a network re-derives it.
Bus.type,Bus.specific_earth_resistance,Branch.type,Branch.lengthandBranch.specific_earth_resistancego throughcalculate_impedance, the code path ofadd_*; assigningNetwork.frequenciesre-derives every element, computing all of them before writing any. A failing derivation leaves the element as it was and raises.bus.specific_earth_resistance = 1000used to be accepted while the impedance kept its old value, and the nextrun_faultused it silently (measured on a four-bus ring after editing one bus and one branch: EPR at the fault bus 113.4 V instead of 148.4 V, at a neighbouring bus 0 V instead of 13.6 V). On an element that belongs to no network an assignment only stores the value. (GUI3, F9) BusTypeandBranchTypeare read-only after construction. A type has been evaluated into every element that uses it, and after a JSON or database round trip every element holds its own copy, so an in-place change could neither reach the elements nor be traced to them. (GUI3, F9)- The optional derived fields are
Nonewhen the type has no formula for them (R/L/C,phase_impedance,R_self…M_mutual), instead of keeping whatever an earlier type left there. (GUI3, ARC9) U_E = 3·I_0·Z_E·rnow holds as physics, not by definition. The earth-group mean, whichu_earthing/z_earthingused to report, came out 43 % below the fault-bus EPR and 45 % below the driving-point impedance on a homogeneous cable chain with the fault far from the infeed, the norm's ideal case. Taken asU_Einto a touch-voltage assessment, that is unconservative. The chain closed only becauseZ_Ewas defined asU_E/I_E. On a 64-section chain the new values match the closed forms|u_F| = |1−k|·I·|Z_∞|andZ_∞ = −Z'/2 + √(Z'²/4 + Z_e·Z')to 1e-5.Z_Eequals the driving point of an independent reference solver to 1e-12 on 17 structural networks. Thevenin loops are not part ofZ_E; a fault bus that only a Thevenin loop reaches givesNoneandEARTHING_IMPEDANCE_UNDEFINED.valueandvalue_currentkeep their definitions. (PH4, F4)- A Thevenin source that drives coupled branches is announced. The
stationary solver takes the Norton current
E/Z_srcas the phase current. Compared with a fully coupled multi-conductor reference, that puts the fault EPR 5.8 / 22.2 / 37.9 % too low forZ_src= 5+15j / 1+3j / 0.3+1j Ω on a cable chain.run_faultemitsTHEVENIN_COUPLINGonce per run until the loop-current solution lands; a Thevenin source on the fault bus is exact and stays silent. (PH1, F5) - Source coverage is checked. A source that reaches the fault but lacks
values at some network frequencies gives one
SOURCE_FREQUENCY_GAPper source and run. Keys outside the network frequencies are announced bycreate_source,create_voltage_sourceandNetwork.add_sourcewithSOURCE_FREQUENCY_OUTSIDE_NETWORK; the solve ignores them, as before. The run-time checks belong torun_fault:build_electrical_networkswitches them on (ElectricalNetwork(..., input_checks=True)), while the phase-split probe of the transient solver leaves them off. A source that carries only a transient waveform stays legitimate there. (USE3, F8) - An incomplete
scalingsmapping is announced. OneSCALINGS_INCOMPLETEper run names the frequencies that fall back to 1.0. (PH6, F7) - The phase-proxy note and the note on a source without a phase path are
structured warnings. Both used to be
logger.warninglines, which the library'sNullHandlerhides. They are nowModelAssumptionWarnings, emitted once per run (the source note used to repeat at every frequency), and the source note says that the source current still enters the earthing system with reduction factor 1 for its share. (PH3, PH9) - The thermal checks name the direct current they leave out.
check_conductor_limitsandcheck_node_limitskeep the 0 Hz bin out ofI_th(pass 18). They now emitTHERMAL_DC_EXCLUDEDwith the elements and the increase ofI_thfromI_th² = I_ac²(m + n) + I_dc², because a direct current that flows duringT_kmakes the check unconservative. The formula leaves out a cross term with the decaying DC offset, which can have either sign: for 1000 A AC, 700 A DC, R/X = 0.1 andT_k= 0.5 s, the numerically integrated current gives anI_th3.7 % above or 4.4 % below it. (PH10) run_faultsolves the phase-conductor network sparse, once per frequency for all sources. The automatic phase-current split (phase_current_mode="auto", the default) assembled the phase network as a densen x narray and callednumpy.linalg.solveonce per source and frequency — the dominant cost of a run, growing faster thann**2and multiplied by the number of sources. The reduced phase network is now assembled straight into CSC, factorised once per frequency with SciPy'sspluand solved for one right-hand side with a column per source. Measured interleaved in one process (CPU time, median of three, seven frequencies): phase stage 17.3 s → 0.017 s on a 2000-bus radial feeder with three sources, 3.17 s → 0.015 s on a 2000-bus ring. The proxy rule (including a broken shield, PH3), thePHASE_PROXYandSOURCE_WITHOUT_PHASE_PATHdiagnostics, the errors andphase_currentsare unchanged. On long radial feeders the sparse factorisation is also the more accurate one: 8e-14 against the exact KCL currents at 300 buses, where the dense solve is 1.9e-12 off. (P1, P13)- The nodal admittance matrices are assembled straight into CSC, and only
those are kept. The positions of all stamps are laid out once per network
and each frequency only sums its admittances into them, in the order the
former dense loops added them. Peak memory of
run_fault(tracemalloc, ring, seven frequencies): 146 → 25 MB at 1000 buses, 579 → 51 MB at 2000, 903 → 63 MB at 2500; at 4000 buses 101 MB, where the dense kernel needs 2.3 GB (fit of the sizes measured here, exponent 1.99; the audit measured 2.31 GB). The sparse kernel grows linearly (exponent 1.00). The new attributeElectricalNetwork.Y_sparseholds the CSC matrices the solver factorises;ElectricalNetwork.Y_matricesis now a read-only view that materialises a dense copy when it is read, and so isElectricalNetwork.earthing_admittance_matrix(freq):Z_Eis computed from the sparse earthing matrix (the solved one with the Thevenin loop closures taken out source by source, bit for bit the entries of the dense definition), with the cached factorisation when there is no voltage source. Migration: code that wrote intoY_matricesto change the solve has to write intoY_sparse(nothing in the package did; two pass-18 mutation tests were retargeted). (P2, PH4) run_faultis 4× to 68× faster on networks of 500 to 2500 buses (P1, P2, P5a, P6 together; CPU time, median of three interleaved runs, seven frequencies): ring 1000 1.06 → 0.12 s, ring 2000 4.04 → 0.22 s, ring 2500 7.8 → 0.30 s, radial 2000 with three sources 18.1 → 0.27 s, 40 × 40 mesh with four sources 7.0 → 0.35 s. At 4000 buses: ring 0.53 s, radial with three sources 0.57 s, 50 × 50 mesh with four sources 0.59 s; the dense kernel does not fit into 2 GB there — extrapolated from the sizes measured here it needs about 20 s, 200 s and 20 s (audit pass 19 measured 28 s, 143 s and 27 s on another machine). The sparse kernel's time grows almost linearly (exponent 1.12 from 1000 to 8000 buses; ring 8000: 1.16 s, peak 203 MB). What remains on large networks is mostly the result objects (P5): 0.2–0.3 s of the 0.53 s of the 4000-bus ring.bus_responseandanalyze_cutsfactorise the sparse matrix instead of solving a dense copy. 2000-bus ring at seven frequencies:bus_response5.6 → 0.032 s (it solved a second dense system for the earthing columns offault_driving_point; those now come from the same factorisation, or from a sparse one of the earthing matrix when a voltage source is present),analyze_cuts2.8 → 0.031 s (CPU, median of three);z_network, the driving-point impedance andz_fault_openagree to 4e-16. (P7)- Results move in the last digits, and more on condition-limited systems.
The admittances come from NumPy's instead of Python's complex division
(different in the last bit for about a quarter of all values) and the
factorisations are sparse. Where the system is badly conditioned by
construction — the 0 Hz bin with a short replaced by its stand-in
(
sqrt(eps)times the smallest impedance, condition numbers 1e8 to 1e11) — results stay within the forward-error boundkappa * eps(at most 3 % of it in the test battery) but may differ from 0.6.0 by up to about 1e-7 relative: both kernels are up to 6e-8..8e-8 away from the exact solution there. Tests that compare such values bit-exactly or at 1e-9 need a tolerance; two were adjusted. (P13) - A declared phase impedance obeys the passivity rule of the other
elements. When the phase network is solved (
phase_current_mode="auto"),run_faultrefuses aphase_impedance_formulavalue with aValueErrornaming the branch when it is zero or too small to invert above 0 Hz, or has a negative real part at any frequency. Before, an exact zero above 0 Hz raised a bareZeroDivisionError, and a negative real part was accepted. - One name per concept in the public API.
fault(wasfault_name),u_limit(wasu_max),t_k_s(wast_k, like the fieldFault.t_k_s),n_factor(wasn, likeFault.n_factor) andfrequency(wasforfreq): 26 parameters of 18 public functions and methods, and a signature walk over__all__and the public methods finds none of the old names left. Positional calls are unaffected and the old keywords keep working (see Deprecated). Error messages and hints name the new keywords, for exampleu_limit must be a finite positive number,n_factor must lie in (0, 1],t_k_s must be strictly positiveandPass t_k_s=.... Field and column names of results are unchanged (FaultShortCircuitData.fault_name, thefault_namereport column,TransientStudy.fault_name). The newBusResponse.fault_driving_pointtakesfrequencyfrom the start. (USE8, STD3) - Result-relevant log lines are structured warnings. The package logs
through a
NullHandler, so alogger.warningreached nobody who had not configured logging, and a GUI could neither attach it to an element nor tell a hint from a warning. All 62logger.warning/logger.errorcalls were classified; the 24 that a user needs to read a result now raise anInputWarning,ModelAssumptionWarningorTransientModelWarningwith a stable code and the elements concerned, and insiderun_faultthey are collected intoResult.diagnostics, also when logging is off and warnings are ignored: the pandapower importer's fallbacks and skips (IMPORT_LENGTH_DEFAULT,IMPORT_BUS_SKIPPED,IMPORT_LINE_SKIPPED,IMPORT_SWITCH_NOT_IMPORTED,IMPORT_ELEMENT_NOT_IMPORTED,IMPORT_VOLTAGE_LEVEL_MISMATCH,IMPORT_EMPTY), the short-circuit reader and applier (SC_VALUE_REPLACED,SC_KAPPA_OUT_OF_RANGE,SC_KAPPA_MISSING,SC_ROW_AMBIGUOUS,SC_SPLIT_EQUAL,SC_VOLTAGE_SOURCE_SKIPPED), the IEC 60909 aggregation (SC_KAPPA_MIXED, andSC_DATA_INCOMPLETEfor the current share without IEC data), the thermal checks (THERMAL_DATA_INCOMPLETE), the stationary solver (PARALLEL_COEFFICIENT_DEFAULT,EARTH_GROUP_SPREAD— now once per run for all frequencies —, andREDUCTION_FACTOR_UNDEFINEDwhen the solve without coupling fails) and the transient solvers (TRANSIENT_SOURCE_NOT_CONNECTED,TRANSIENT_COUPLING_SKIPPED,TRANSIENT_BRANCH_SKIPPED,TRANSIENT_RESISTIVE_COUPLING_IGNORED). Each code is documented in the docstring of the function that raises it. These messages no longer go to thegroundinsightlogger; a setup that reads them from the log can route warnings there withlogging.captureWarnings(True)(loggerpy.warnings, as text — code and elements stay with the records). The other 38 stay log lines: persistence, migration and session bookkeeping, cost notices, an explicit overwrite, and summaries of what the returned object already carries (status of the ρ searches, failures of sweeps and outage studies, thewithin_limitcolumn of the thermal checks). (GUI4, STD5) gi.solveno longer touches any shared path-search state. The overlay it solves on gets a memory of its own that goes with it; before, its entries went into the shared dictionaries, keyed onid(overlay), and had to be removed again so that a later object at the same address could not find them. Different networks can now be solved from different threads. (ARC2)- The inverse searches re-solve their trials on the assembly of their first
solve.
find_max_rho_scalingandfind_max_rho_f_scalingevaluate the same fault for twenty or more trial values of the bus grounding impedances, and every trial used to be a completerun_fault. A trial changes nothing but the diagonal of the nodal matrix, so only the first trial per fault location is a full solve now; every later one re-assembles the matrix values with the kernel's own assembly (same summation order), factorises them and solves the injection vector of the first solve. Matrix, factorisation and EPR are bit for bit those of a fullrun_fault, so the searches take the same steps and return identical dictionaries (checked against the same searches with the re-solve switched off). Where the re-solve cannot answer — a 0 Hz stand-in, a bus that gains or loses its electrode, an open, NaN, zero or non-passive value, a failing factorisation — the trial is a fullrun_faultagain, with its errors and messages.find_max_rho_f_scalingalso shares one factorisation per trial between fault locations whose nodal matrix is the same. Progress reports still count one unit per solve, and the network is still left as found. Measured interleaved in one process (CPU, median of three): 1000-bus ring with every bus scaled 5.47 s → 0.59 s, with five buses 2.91 s → 0.21 s, 40×40 mesh 11.3 s → 1.86 s; rho-f search on a 300-bus ring over five fault locations 3.79 s → 0.26 s, on a 1000-bus ring over ten 23.9 s → 1.42 s. (P4) Network.res_busesandNetwork.res_branchesare built column-wise. They built one Python dictionary per row and took magnitude and angle of every phasor one NumPy scalar at a time; on a 4000-bus ring at seven frequencies the frame took a quarter of the solve that produced it. The frames are unchanged bit for bit (rows, order, schema,nullfor a missing entry; compared with the former construction withcheck_exact=True). Magnitudes come fromnumpy.hypot, which agrees with Python'sabsof a complex number in every bit;numpy.absof a complex array does not.res_buses: 0.044 s → 0.010 s at 1000 buses, 0.21 s → 0.035 s at 4000, 0.96 s → 0.18 s at 20 000;res_branches4–6× likewise. (P11)- The earth-return current is the split of exactly the electrode currents
the result reports.
I_Eand the earth group of the current-based reduction factor were computed from electrode currents recomputed bus by bus with Python's complex division, whileResultBus.iacomes from the array division of the solve; the two could differ in the last bit, soI_Ewas not always exactly the sum of the reported currents of its group. The split now reads the reported currents (52 → 17 ms on a 4000-bus ring), and the check behind theTHEVENIN_COUPLINGdiagnostic reads the gathered impedance arrays instead of resolving every branch at every frequency (9.2 → 0.65 ms). (P6) - Building a network validates each derived impedance once. Every
create_bus/create_branch(and every re-derivation) packed each value of a derived impedance table into a validatedComplexNumberand then validated it a second time when the table was assigned to the element. Derived tables are now stored as the validated assignment stores them, without the second pass; the passivity check runs on the evaluated array before it is packed (same rules and message as the dictionary check), and a formula whose values all came back finite skips the masks of the NaN andinf+nan*jrepairs. The stored model is unchanged bit for bit (the JSON of a built and re-derived 5000-bus ring is byte-identical; the edit invariants — re-derivation on assignment, roll-back,input_digest— are untouched). Building a 5000-bus ring 2.02 s → 1.51 s, a 50 000-bus ring 22.9 s → 16.7 s;Branch.calculate_impedance155 → 111 µs,Bus.calculate_impedance73 → 50 µs. (P10)
Deprecated¶
gi.session,gi.db_session,gi.engineandgi.SessionLocal. They resolve to the default database's scoped session (the same object for both session names), engine and session factory, orNonewithout a started session, and raise aDeprecationWarningon every access. Removal no earlier than two releases and six months after this release. Replacement: the methods ofgi.Database(or of the objectgi.start_dbsessionreturns),with db.session() as s:for a raw session,db.engine. (ARC2)- The keywords
fault_name,u_max,t_k,n,fandfreqof the 18 callables renamed above. They work as before and emit aDeprecationWarningthat names the replacement and the policy: an old name keeps working for at least two releases and six months after the release that deprecated it. A value under both names is aTypeError. The full table is on the service API page. (USE8) set_pathfinder_max_paths,get_pathfinder_max_paths,gi.set_pathfinder_cache_sizeandgi.get_pathfinder_cache_size. They keep working with aDeprecationWarningand now set or read the process default — the settings of every network without settings of its own;set_pathfinder_cache_sizetrims the memory of those networks at once. Removal no earlier than two releases and six months after this release. Replacement:net.pathfinder_settings = gi.PathfinderSettings(max_paths=n)(orcache_size=n);net.pathfinder_settings.max_pathsto read.clear_pathfinder_cache(network)andclear_pathfinder_cache()stay as they are. (ARC2)
Fixed¶
- The inverse searches no longer leave a stale nodal system behind
(
analysis/inverse_rho.py,analysis/inverse_rho_f.py). Bothfinallyblocks restoredrho, impedances, results, paths and the active fault but notnetwork.electrical_network, so the network was left carrying theYof the last bisection step next to the restoredrho.bus_responseread a negative driving-point impedance out of that pair, without error or warning. The pre-search object is put back (orNone), andElectricalNetworkcarries a fingerprint of the model values it was assembled from sobus_responserefuses a stale system by name. BusResponse.evaluatereports the currentZ_Gdefinition. It computedZ_G = u_b/(r*I_F)— the definition 0.6.0 replaced — with the varied bus's voltage, a factor of 39 againstrun_fault. It is nowZ_E = U_E/I_Eof the bonded group, matchingrun_faultto 1e-9.BusResponse.evaluateevaluatesr_eprper electrode. It was carried through as an invariant, which it is only at the fault bus; away from it the factor moves with the electrode by 18 %. A third right-hand side of the same factorisation (the mutual-free injection) makes it exact for every electrode.analyze_cutsdecomposes the system that was solved. It assembled its own nodal matrix, which disagreed with the solver's in two places: a 0 Hz short, which the solver substitutes and the decomposition read as an open circuit (Z_dp10 Ω against 2.5 Ω), and the Thévenin loop closureY_src, which exists only in the solver's matrix and carried up to 23 % of the fault current out of the fault bus. The loop closure is reported as its own direction"source_loop";kcl_residualfalls from 22.5 % to 1e-16.find_max_rho_scalingno longer assumes monotonicity. Where only part of the impedance formula carriesrho,EPR(c)falls before it rises, and the bisection reported "no scaling factor satisfies the constraint" for limits a whole band of factors satisfies. A logarithmic pre-scan (monotonicity_grid, default 9) measures the shape first.kappaandnare validated in the thermal checks. Both docstrings promised(1, 2]and(0, 1]; neither was enforced, and every out-of-range value failed in the unsafe direction.- The 0 Hz bin is no longer counted twice in
I_th. It entered both the RMS andm; on the audit case[50 Hz]gave 1028 A and[0, 50 Hz]with 700 A of direct current gave 1255 A. classifyleaves a NaN unassessed instead of putting it in the highest band, where a failed sweep point was counted among the violations.analyze_cutsexplains an incomplete result instead of raising a bareKeyError, andCutAnalysis.to_polars()pins its schema so an unsolved analysis stacks with a solved one.-
sweep([])and a non-positive network conductance inworst_case_electroderaiseValueErrorinstead of a polars error and a negative "worst case". -
run_faultno longer enumerates every source-to-fault path in the default mode.phase_current_mode="auto"only needs to know which sources reach the fault, yetdefine_pathsran the exhaustive DFS on every call; a 6×6 grid of 36 buses spent 55–68 s on 1 262 816 paths while the solve itself took milliseconds.Network.sources_reaching(fault_name)answers the question with a breadth-first search, and the enumeration runs only forphase_current_mode="paths", the transient state-space solver and an explicitgi.create_paths(network). Results are bit-identical on every network where the old path was affordable; the 6×6 grid now solves in 0.09 s.PathFinderadditionally caps the enumeration atset_pathfinder_max_paths()(default 100 000) with an error that names the bus pair and points at"auto".analysis/shortcircuit._sources_feedingkeeps its old behaviour through the same reachability helper. - A frequency an element does not cover is an error, not an open circuit.
_construct_Y_matricesskipped any bus or branch whose impedance dict lacked the frequency being solved, silently — extendingnetwork.frequenciesin place and recomputing only the buses left the branches out of the 250 Hz bin and reported an EPR of 1000 V where 4.95 V was right.ElectricalNetworknow checks that every active element coversnetwork.frequenciesbefore assembling anything. value_currentwith a source on the fault bus.I_faultwas read as the net injection at the fault bus, which with a source there isI_src,F − ΣI_srcrather than the fault current; the current-based reduction factor came out as 0.005 instead of 0.5. It is nowΣ scaling·I_srcover the sources that reach the fault.run_sweepleaves the network as it found it, in every case. A point naming an unknown bus raised after the earlier buses had been overwritten, and because the return value of_applywas never bound, thefinallyblock skipped the restore — withon_error="record"every later point was solved on the corrupted model. Names are validated before the first mutation, the snapshot is taken once per bus (R,L,Cincluded, and a point overriding bothbus_impedanceandbus_rhoon one bus can no longer save the overwritten table as the original), restore runs in reverse order, and the previously active fault keeps its cached result.- The FFT transient solver injects only sources that reach the fault, as the stationary solver does; a source on a galvanically separate bus used to add 1000 V at that bus and shift every other trace through the fault-bus term.
- The state-space solver no longer reads its operating frequency from
frequencies[0]. With 0 Hz first in the list the source inductance becameL_src = 0(a factor 680 in the first time step).solve()takesf_eval, defaulting to the smallest frequency above 0 Hz, and refuses a reactiveZ_srcatω = 0. - Negative
R_self,L_self,C_self, busLandCare rejected by the state-space solver instead of being silently treated as absent, which made a branch withR_self = −0.5lossless. ComplexNumber == NoneisFalse, not aTypeError; the class is hashable; NumPy scalars (np.int64,np.complex64, …) work on either side of an operator;repris a valid constructor call again.Network.frequenciesand every other model field validate on assignment (validate_assignment=TrueonBus,Branch,Fault,Source,Network).apply_shortcircuit_characteristicscould writekappa = 42and a shortenedt_k_sstraight past the validators that promised to reject them, inflatingi_pby 21 andI_admby 7.7 — the unsafe direction — and left the network unserialisable. A rejected assignment is rolled back, because Pydantic writes the value before the model-level validators run.Fault.scalingsvalues are validated (finite, non-negative) —nanandinfwent through and broke the JSON round-trip of the whole network.- The
add_columnsdatabase migration works. The DDL it rendered for the eight NOT-NULL columns with Python-side defaults (position,active,source_type) had noDEFAULTclause, SQLite refused it, and becausestart_dbsessionmigrates before it binds, the file was unopenable. The column DDL is rendered with the declared default. save_networkno longer rewrites a shared type silently. Saving network B replaced the formula of aBusTypenetwork A also uses; A was then internally inconsistent (stored 1 Ω, formula 999 Ω) and every analysis that re-evaluates the formula —find_max_rho_scaling,run_sweep— switched to the wrong value. A changed formula on a type other networks reference is refused unlessoverwrite_types=True.res_buseshandles a missingia_freqentry (Noneinstead of anAttributeError), and the plot helpers release their figure when the drawing step raises (a badyscaleused to leak one figure per call).- The pandapower importer honours closed bus–bus switches when
ImportDefaults.switch_branch_typeis set, and otherwise warns and lists them in the preview together with transformers and impedances, which were dropped without a trace before — a station bonded to its neighbour by a switch came out isolated at 0 V. Bus voltage levels are matched withmath.iscloseinstead of exact equality, so rounding noise from a CSV/DGS import no longer empties the whole import. scripts/release.pyruns git in the repository root, whatever the current directory, and refuses to touch the three version files when the target tag already exists.- Three doctests had gone stale (
create_fault,create_source, thesimulation/outage.pymodule example); the suite now runs the doctests (--doctest-modules) so they cannot rot again. - The state-space solver divides the phase current of a ring like the
stationary solver. It took the phase factor of each branch from the
enumerated source-to-fault paths as
sign * parallel_coefficient(default 1.0), i.e. the legacy"paths"mode, which gives every route of a ring the full source current: 338.3 V at the fault of a symmetric four-bus ring in steady state against 166.6 V fromrun_fault(+103 %), without a warning. The split now comes from the same phase-network solve asphase_current_mode="auto", atf_eval, with 1 A per source; the complex split is folded into the coupling of each branch,R' + jωM' = (R_mut + jωM)·α, which makes thef_evalsteady state exact for every topology (keeping onlyRe αput a cable/overhead-line ring 4.4 % low at the fault). Measured againstrun_fault: 3.6e-7 in the symmetric ring, 6.9e-8 in a chain (unchanged), 3.3e-7 in the mixed ring. Against an independent reference that integrates shield and phase conductors as states: 5.8e-7 of the peak for a homogeneous ring of unequal lengths under a fully offset fault current, 0.99 % for the mixed ring, where the solver says so (TRANSIENT_PHASE_SPLIT). The study no longer rebuildsnetwork.pathsand never touchesnetwork.active_fault. (PH2) - The FFT solver's coupling warning names the right direction. The
TransientModelWarningfor the mutual coupling the FFT solver does not evaluate said "expect a lower earth potential rise"; it is higher: 77.6 V against 49.2 V in the steady state of a coupled two-bus cable link, exactly1/|1 − Z_m/Z_s|for one coupled branch, and +44 % to +101 % on the post-inception peak of a fully offset fault current in four networks. Without the coupling no induced share of the fault current returns through the shields, so the FFT answer is conservative at the fault bus and as the network maximum (higher in all of 600 random chains and meshes, while 6 % of the remote buses came out lower, which the message now says). The warning is emitted with codeTRANSIENT_MODELand every coupled branch as an element, and points at the caller's line.docs/transient.mdclaimed the same wrong direction. (PH-L1) - The FFT solver no longer needs gigabytes for mid-size networks. It
assembled 512 frequency bins as one dense
(512, n, n)block — 1.3 GB at 400 buses, 8.2 GB at 1000 — and kept the previous block alive while building the next, so the peak was about two blocks. The batch now follows thefft_block_bytesbudget and is released before the next one: a 400-bus ring over 1001 bins peaks at 293 MB (tracemalloc, whole solve), a 100-bus ring at 89 MB instead of 167 MB with the default and at 10.7 MB with a 4 MiB budget. The spectra are bit-identical to the old batching, and the run time is unchanged (200 buses, interleaved median: 1.23 s old, 1.03 s new). (P8) - A solved network can be copied and pickled again.
copy.deepcopy(net),net.model_copy(deep=True)andpickle.dumps(net)failed afterrun_faultwithTypeError: cannot pickle 'SuperLU' object-- a regression of the LU reuse. The factor cache is dropped in copies (it is rebuilt when needed); the copied solver state refers to the copy, sobus_responseworks on it without a new solve, with the same numbers as the original and as a network built from scratch. (GUI2) - Creating a bus or branch is atomic. A formula that only fails when it is
evaluated (negative resistance, NaN at one frequency, a complex
R_self) left an element without impedances in the network, and the nextrun_faultfailed on "carries no impedance" instead of on the formula. The impedances are now derived before the element is inserted; withoverwrite=Truethe previous element stays. (ARC9) create_fault(active=True)without a network raises aValueErrorthat says what is missing, instead ofAttributeErroronNone. (ARC9)- A broken shield no longer opens the phase conductor. For a branch with
a grounding conductor and an infinite self impedance (
"nan", the documented broken shield) and no declared phase impedance, the phase-split proxy1/Z_selfwas 0. That removed the phase conductor too. On a symmetric ring, the branch carried 0 A instead of half the current, and the fault EPR was 207.1 V instead of 342.0 V. Because the phase network then looked radial, the proxy note was suppressed as well. The branch now falls back to the length proxy (520.4 A / 541.3 A, 300.7 V), andPHASE_PROXYnames it. (PH3) - Earth group,
I_Eand the reduction factors are no longer decided by rounding noise. Electrode currents of zero in exact arithmetic come out of the solver at about 1e-17 of the largest one, at an arbitrary angle, and joined an arbitrary group: 786 membership flips in 514 random networks between two kernels that otherwise agree to 1e-13. Without an electrode at the fault bus,I_Eflipped sign andZ_Gmoved by a factor of 2.2. A fault bus at zero potential reported the quotient of two rounding errors asvalue(0.449 = 5.1e-14 V / 1.1e-13 V for a source behind a dead end). Currents up to1e-9·max|I_a|now join no group. Without a fault-bus electrode, the group in phase with the fault-bus EPR feeds. When no current is dropped, the split is bit for bit the previous one. (P9, F14) - The earth-return split is O(n log n). It was quadratic: 11.2 s per
frequency at 20 000 buses, now 9 ms (0.6 / 2.1 / 106 ms at 1 000 /
4 000 / 100 000). On 2 000 random phasor sets and a 4 000-bus set, the
result equals that of the previous implementation with
==. (P3) - Carson mutual impedances no longer warn at 0 Hz. The resolution test of
the DC limit compared the last step of the approach (10⁻⁷ → 10⁻⁸ Hz) with
10⁻⁶ of the value plus 10⁻¹² Ω. A real part without a constant term — the
earth-return resistance π²·10⁻⁴·f of every Carson mutual impedance — moves
by 90 % of its value per decade however small it is, so every such cable
longer than 11.3 m warned "converges only slowly" in a network that lists
0 Hz, although its value there is π²·10⁻¹²·l Ω. A step that shrinks at
least five-fold per decade now counts as resolved, since at most a quarter
of it then remains to the limit: anything linear in
fshrinks it ten-fold,f*log(1/f)8.5-fold, whilesqrt(f)(3.2-fold) andlog(f)(not at all) are still reported, now with the measured step ratio in the message. The verdict no longer depends on the branch length, and the value used at 0 Hz is unchanged. The FFT transient solver was not affected; it evaluates self impedances only. (D7) EARTHING_IMPEDANCE_UNDEFINEDis decided by structure.Z_E(z_earthing, the grounding impedance) isNonewhen no bus connected to the fault bus through shields has an electrode. That decision used to be left to the sparse solver, which caught only a fault bus standing alone. With one or three electrode-less buses behind the fault bus, the earthing matrix is singular only up to rounding, andz_earthingcame out as about −4.5e15 or −3.6e15 Ω with no diagnostic. The reverse case was wrong too: a voltage source on a bus without an electrode reportedZ_E = Nonefor a fault side earthed at both ends, and the note blamed the fault bus. Now only the fault bus's own group is factorised, and the note names that group.bus_responseuses the same rule for its earthing columns, and its check that another electrode remains now looks at the studied bus's group instead of the whole network. Checked against the closed forms of a series chain (Σ Z_s + Z_e) and a parallel pair (Z_F ∥ (Z_s + Z_B)), and against the reference solver of the tests, which finds the group by its own search and refuses a group without an electrode. (PH4, F4)- A group of buses with no path to earth is refused by the solve.
run_faultrefused a network in which no bus is earthed. A group of electrode-less buses joined by shields, for example a tower behind an overhead line without an earth wire, was solved to rounding noise: 2.18e18 V at the fault bus, with no warning. Every group of buses that the nodal matrix couples now needs a bus with an electrode. Otherwiserun_faultraises the documentedValueError("Singular admittance matrix … no path to reference earth"), naming the group. The check costs 0.5 ms per frequency on a 4000-bus ring and 2 ms on a 20 000-bus ring, less than 1 % ofrun_fault. - A purely inductive phase conductor at 0 Hz no longer makes
run_faultraiseZeroDivisionError. Aphase_impedance_formulasuch asj*2*pi*f*L*lis exactly zero at DC. The 0 Hz scan did not cover phase conductors, so a network whose only DC short was one crashed. Phase conductors now get the documented DC stand-insqrt(eps)·Z_minwith aDCLimitWarningthat names them.Z_minremains the smallest impedance of the earthing network, so the earthing results of networks that already had a DC short are unchanged, bit for bit. Where every parallel route of the phase network is an ideal short at DC, the routes split as if all conductors had one and the same impedance; declare the DC resistance where that split matters. run_sweepleaves the network exactly as found, as it always promised. It put the bus and branch parameters back but left the result and the assembled system of its last point in the network: on a four-bus ring,network.results["F"]read 52.2 V at the source bus after a sweep — the last point's value — instead of the 70.1 V of the restored network, andbus_responsewould have read the last point's matrices. Stored results and their order, active fault, path set and assembled system are now those of the moment the sweep was called, so the sweep's own fault is no longer reported bystale_results()afterwards. (GUI5)find_max_rho_scalingandfind_max_rho_f_scalingrestore the network exactly. They put back the active fault, the stored result and the assembled system one by one, but re-inserted the result at the end ofnetwork.results: with results forFandF1stored, the order becameF1, Fand the serialised network changed. (GUI5)- The pandapower import honours open line switches. A ring operated open
at a line switch (
net.switchrow withet="l",closed=False) arrived closed: only bus-to-bus switches were evaluated, so the phase-conductor network got a mesh that does not exist in operation and the fault current divided over both halves of the ring — 643 A of 1000 A took the route through the open switch on a four-bus test ring. An open line switch interrupts the phase conductor of its line at that end; the cable screen is bonded to the station earth independently of the switch and stays connected at both ends.from_pandapowernow imports such a line with itsdefault_branch_typeandphase_impedance_formula = "nan"(type<name>_phase_open): it carries no fault current, and its screen stays in the earthing network. It says so with the newInputWarningIMPORT_LINE_SWITCH_OPEN(severityinfo; elements: the branch and the switches).preview_pandapower_importmarks the switch and its lineline_switch_open, a closed line switchline_switch_closedand the switch of a line that is not importedline_not_imported. Switches at transformer terminals change nothing (transformers are not imported); an open bus-to-bus switch stays no connection. With one cable type on every line the EPR does not depend on the switch state — the coupling relief is1 - Z_m/Z_showever the phase current divides — but the phase and screen currents do, and with them the thermal check; in a ring of mixed construction the EPR moves as well. The legacyphase_current_mode="paths"enumerates routes over every active branch and does not see an open phase conductor. - A fault on the bus of every source that feeds it now says why its reduction factors are empty. Source and fault put
+Iand-Ion the same row, so nothing is injected into the earthing network: the EPR and the earth-return current are zero and both reduction factors areNoneby definition. The run was silent about it; it now records the info diagnosticFAULT_AT_FEEDING_BUS(elements: the fault and its bus) on the result.U_Eis 0 V,Z_Eremains the driving-point impedance. run_outage_study(auto_parallel_coefficients=...)warns at its caller. The deprecated keyword was forwarded torun_fault, whoseDeprecationWarningthen pointed at a line inside the package, where Python's default filters hide it. The study resolves the alias itself; the old argument still wins when given.- Warning texts name limitations, not internal audit identifiers (
THEVENIN_COUPLING). res_faultnames the bus of the largest EPR the same way on every platform. With a strict comparison, two buses with the same EPR magnitude -- both ends of a symmetric line -- were told apart by the last bit of the solution, which differs between the BLAS/LAPACK builds of Linux, macOS and Windows. Magnitudes within1e-9of the largest now count as a tie, and a tie names the fault bus if it is part of it, otherwise the first tied bus in result order.
Security¶
- The impedance formula guard is a whitelist and normalises Unicode
(
utils/validations.py). It compared raw token strings against an ASCII denylist, but CPython NFKC-normalises identifiers when it compiles the sourcesympy.lambdifygenerates: a fullwidthevalpassed the guard and reached the builtinevalthroughcreate_bus, i.e. through every JSON and database load. Names must now be ASCII and NFKC-stable, only a fixed set of SymPy functions may be called (free symbols stay unrestricted — a user may name a parameter whatever they like, and a bare name can never become a call), only+ - * / ** ( ) ,are accepted as operators, and a power whose exponent is itself a power or a literal above 1000 is refused (the10**10**9denial of service). Formulas longer than 4096 characters are rejected up front. Nothing in the repository's docs, tests or notebooks is affected; a formula calling a function outside the list (factorial,besselj, …) now fails with a message that names the allowed set. NetworkDB.frequenciesis a JSON column, no longer aPickleType. Loading a database ranpickle.loadson the stored blob before any Pydantic validator saw a field, so a.dbfile from another hand was code execution — the very thing the formula guard exists to prevent. Files written before this release are converted bygi.migrate_database(...)(start_dbsessiondoes it automatically) through a restrictive unpickler that resolves nothing butbuiltins.list/float/intand aborts before the first write when the blob names anything else.- pillow floor 13.0.0, without an upper bound (
pyproject.toml).pillow = "^11.3.0"meant<12, while every fix lies at 12.1.1 or later. pip-audit lists 73 advisories for 11.3.0 and still 39 for 12.3.0; 13.0.0 is the first release without one. groundinsight never imports PIL — matplotlib does, and asks forpillow>=8— so the declaration is a pure security floor, and it carries no upper bound: the cap is what kept the fixes out of reach of everyone installing groundinsight (SEC2). - Refreshed lock with the open Dependabot updates (#5, #6). The previous lock carried 171 known advisories in 16 packages (pillow 73, mistune 30, tornado 28, urllib3 7, …); the new one has none. numpy 2.1.3 → 2.4.6 (pandapower caps it below 2.5), scipy 1.17.1 → 1.18.1, pydantic 2.13.4 → 2.14.3, polars 1.16.0 → 1.44.2, sqlalchemy 2.0.36 → 2.1.8, matplotlib 3.10.9 → 3.11.2, pandapower 3.1.2 → 3.5.6, pytest 8.3.4 → 9.2.0, mkdocstrings 0.26.2 → 1.0.8. Installed from the lock, the suite passes on 3.12, 3.13 and 3.14 (REL2, SEC2). tornado 6.6 → 6.6.1 (development and documentation groups only) for CVE-2026-126347, published after the refresh and the first finding of the new audit job.
- Dependency audit in CI (
.github/workflows/audit.yml). On pushes and pull requests tomain, weekly and on demand,scripts/audit_dependencies.pychecks every version pinned inpoetry.lock— all groups, extras and platforms — with pip-audit, and any known advisory fails the job. The ignore list.github/pip-audit-ignore.txtis empty; an entry needs a reason and an end date, and an expired entry fails the audit (SEC2). - Every GitHub Action is pinned to a commit SHA with its release as a
comment, including
pypa/gh-action-pypi-publish, which ran from the moving branchrelease/v1inside the job that holds the PyPI OIDC token. Dependabot updates SHA and comment together (SEC3). - The workflow token is read-only by default. Every workflow declares
permissions: contents: read; only the PyPI publish (id-token: write), the GitHub release and the docs deploy (contents: write) ask for more, each with a comment saying why. Checkouts in jobs that never push no longer leave the token in.git/config. zizmor: 50 findings (28 high, 7 medium) → 1 informational (SEC4). - bandit B608 in
database/migration.pytriaged and annotated. The four f-string SQL statements interpolate only module constants, caller literals and columns of the target schema the ORM just created; names read from the file being migrated are only used in membership tests. Each site carries# nosec B608with that reason, and a test migrates a file with a hostile column and table name while recording every statement the module sends (SEC6). - Formula strings cannot make SymPy burn CPU any more. SymPy evaluates
arithmetic on numbers exactly while it parses, and the guard only capped the
literal exponent:
<4080 digits>**999cost 1.9 s per formula and a JSON with 20 such bus types 17.9 s to load;9**(99999*99999)andfloor(exp(10**12))never returned,(0*f + 9)**(f - f + 4000000)cancelled its symbols (2.2 s),Maxwith 120 symbolic arguments took 6.6 s. The guard now bounds, before SymPy runs, the digits of number literals, every exponent (by the value it can reach), the size of every exact intermediate result,floor/ceilingandexp-like arguments, and the number of terms, calls and call arguments; each message names its limit. Measured: every case above is rejected in under 4 ms; the most expensive admitted formula (eightMaxof three symbolic arguments) costs about 50 ms with cold caches. (SEC1) - The formula guard fails closed. A string Python's tokenizer cannot split was handed on to SymPy unchecked; it is now rejected by the guard ("could not be tokenized"), and so is a string that tokenizes but is no expression. The string is parsed inside parentheses, which accepts exactly the leading blanks and line breaks SymPy accepts. (SEC5)
Docs¶
find_max_rho_f_scalingstates the monotonicity assumption and that it is proven at a single bus and unproven in the coupled multi-bus case.resolve_fault_sc_characteristicsstates exactly what it averages —kappaover the sources carrying 60909 data,i_k_aover all of them — and its warning names the share of the current the data does not cover.kappa_from_r_to_xdocuments its actual range,[1.02, 2].-
CutAnalysis.identity_residualsays what it can and cannot show. -
Source.valuesandElectricalNetwork._calculate_rmsstate the convention: phasors are RMS amplitudes, the total RMS over all frequency components is√Σ|X(f)|²with the 0 Hz term entering as|X_dc|. compute_grounding_impedance,CLAUDE.md,docs/concepts.mdanddocs/api/electrical_network.mdsayZ_G = Z_E = U_E / I_Eand name the pre-0.6.0 expression as such.docs/transient.mdno longer claims the FFT solver injects mutual currents; the limitations list the Nyquist bin, the non-causal kernel of a frequency-independent reactance and the sign convention of the transient EPR.docs/api/pathfinder.mdanddocs/concepts.mdstate the real cost of the path enumeration. The transient example notebook runs again (mv_ring_transient.ipynb, cell 10), the README no longer recommends the deprecatedauto_parallel_coefficients, and the notebooks import the model classes fromgi.*.- The installation page names pillow among the runtime dependencies (DOC5).
docs/transient.mddescribes the state-space coupling the code implements. The "Mutual coupling" section derived the phase factor from "the network's path topology — same algorithm as the FFT solver's mutual Norton injection", a coupling the FFT solver does not have; it now states the auto split atf_eval, the fold of a complex split and theTRANSIENT_PHASE_SPLITwarning. The API page documentsfft_block_bytes, including that a very small budget costs time on mid-size networks (150 buses: 0.7 s at the default, 4.5 s at 1 MiB). (PH15, P8)- Project files and the database object are documented. The I/O page describes the project-file format, its guarantees and the schema-version table; the Database page the object, threading, the module-level helpers and a migration table for the deprecated globals; the plotting page the lazy import. (GUI1, ARC2, GUI8)
- "Editing a network and stale results" in the core-models API page:
re-derivation on assignment,
update_*/remove_*, read-only types, and what makes a result stale.BusType/BranchTypedocument their formula symbols and that they are read-only;core_modelsandutils/validationshave module docstrings explaining the invariants and the resource limits. (GUI3, USE2, SEC1) docs/concepts.mddefinesU_E,Z_E,I_Eandrat the fault bus. The section on the EN 50522 reduction factor and the grounding-impedance section are rewritten, anddocs/examples/fault_decomposition.ipynbprints the new quantities next to the group mean. (PH4)- A missing
scalingskey means 1.0. The DC section said 0 ("a fault that does not scale 0 Hz contributes nothing at DC"); a fault without a 0 Hz key in fact gives |u_F(0 Hz)| = 33.47 V. (PH6, USE4) - The driving point of
bus_responseis monotone only for an electrode within 90° of the network admittance. AlongY_B = t·e^{jφ},|Z_dp|falls for everytif and only ifcos(φ − arg(1/Z_net)) ≥ 0, which a resistive electrode always meets. The passive worst case|Z_net|/cos(arg Z_net)is 0.08 % above|Z_net|on a nearly resistive site and 57 % above it at the far end of a four-bus cable chain; the documentation called it "very little". (PH13) - How-to "Bus and branch types from data sheets". The documentation only
showed the illustrative formula
(0.25 + j*f*0.012)*land did not say how a cable or electrode becomes aBranchTypeorBusType. The new page derives the screen–earth loopZ_s, the couplingZ_m(Carson withD_E = 658·√(ρ/f)),r = |1 − Z_m/Z_s| = R_s'/|Z_s'|and the quantityphase_impedance_formulahas to carry,Z_red = Z_pp − Z_m²/Z_s. Worked example NA2XS(F)2Y 1×300 RM/25 12/20 kV (Prysmian data sheet, EN 60228) at 100 Ω·m, computed three ways indocs/snippets/types_from_datasheets.py: closed form, Pollaczek's integral, a one-branchrun_fault— r = 0.703286 / 0.703244 / 0.703286 at 50 Hz; the closed form stays within 1.5·10⁻⁴ of the integral in r over 16.7 Hz … 2.5 kHz and 10 … 10 000 Ω·m. Also the three-phase system in trefoil (r = 0.342 at 50 Hz; the screen of the faulted core carries 35.9 % of the bundle current, which sets the thermal cross-section), the flat formation, an overhead line with earth wire, electrode formulas and what the evaluator returns at 0 Hz. Values that no data sheet gives are named as estimates. (D7, PH5) - How-to "Compare results with EN 50522 limits". Which result is which
symbol (
3I_0→i_fault,r→value_current, notvalue;I_E,Z_E,U_Eas defined in this release), the procedure of EN 50522:2022 by clause without permissible values, EPR as the upper bound of the touch voltage, and harmonics and DC as total RMS against the 50 Hz curve — conservative for the body current by the frequency factors of IEC 60479-2, not shown for the touch voltage because the impedance of the skin falls with frequency (DIN IEC/TS 60479-1:2007-05, 4.2). Worked example indocs/snippets/en50522_check.py. (D5, D6, DOC8, PH4) - Reference pages "Formula syntax", "Conventions and units", "Glossary and
symbols". The formula symbols per type, the 28 callable functions, the
limits of the formula guard and why it exists, with the messages of 13
refused formulas; units, RMS phasors against peak waveform amplitudes, the
sign frame (earth-side phasors are the negatives of the physical ones, shield
and phase currents are physical — shown on a two-bus example), source
coverage and the
scalingsdefault;Z_Bfor the bus electrode andZ_Eonly for the earthing impedance. (DOC6, DOC7, PH8, USE2, SEC1) - Explanation pages "Standards and scope" and "Verification and
validation". What the package implements of EN 50522:2022, IEC 61936-1,
IEC 60909-0, IEC 60949 and IEC 60479, and what it does not; the verification
evidence, with the reference-case table generated at build time from
REFERENCE_CASES, and plainly: not yet validated against field measurements or other programs. (D8, DOC7) - Liability note on the home page, the EN 50522 how-to and the standards page. (D10)
- The data-sheet how-to, the formula syntax reference, the concepts chapter and the transient chapter state both rules at 0 Hz; the how-to no longer documents the Carson warning as expected. (D7)
docs/concepts.mdcovers both rules. The grounding-impedance section states whenZ_EisNoneand howz_fault_idealis used. The 0 Hz section covers phase conductors.- New page "Service functions" (
docs/api/service.md): which function answers which question,solvenext torun_fault, the fullcheck_networkcode table (kept in sync withCHECK_CODESby a test), the progress and cancellation protocol, the table of canonical names, and the API reference ofservice,checks,progress,diagnosticsandutils.compat. (ARC1, GUI9, GUI5, USE8) - I/O page: "Networks as tables" — the schema with its required columns
(kept in sync with
TABLE_SCHEMASby a test), a CSV example, the error semantics and the Excel route. (USE6) - README, concepts, quickstart, the transient guide, the API pages and the example notebooks use the canonical keywords. (USE8)
- Result tables page: "Key figures of a fault" — the columns of
res_faultwith type and meaning (kept in sync withRES_FAULT_SCHEMAby a test), the null rules and an example. (USE1, GUI6) - Service page: "Diagnostic codes" — every code the package raises, with its category and the function that raises it (kept complete by a test), how to collect the records around any call, and the route into logging. (GUI4)
- The database stores the results of a network. The Database page and the
docstrings of
Database.save_network/load_networksaid that results are not stored; they are, as a JSON column of the network row (since pass 9). A test pins the round trip (dump equality and a fresh solve, EPR rel. 1e-12). (ARC2) - The pathfinder page describes the settings and memory per network, with a migration table for the deprecated switches; the Service page drops the warning about shared path caches. (ARC2)
- "Internal API" is defined in the API reference index. Functions and methods that modules of the package share carry no underscore and say "Internal API" in their docstring; they are not exported and can change in any release. (ARC5)
- Eleven how-to guides, each with a runnable script and its stated
output. Multi-frequency input, sweeps, outages, the inverse searches, the
pandapower importers, the thermal checks, transients, persistence,
performance, diagnostics and the service layer were covered by fragments in
the quickstart and prose on the API pages, mostly without an example that
runs or a result to compare with. The new pages under
docs/howto/— harmonics, sweeps, outage, inverse-rho, pandapower, thermal, transient, persistence, performance, diagnostics, service-layer — include a script fromdocs/snippets/by section, state what it prints and explain every diagnostic code it shows. Among the contents: what a missing scaling and a scaling of 0.0 mean (F7), which sources reach a frequency (F8), the 0 Hz rules and the stand-in for an ideal bond; that the searches and sweeps scale the bus resistivity only (PH11); the minimum pandapower data of an earth-fault short-circuit case; thatderive_phase_impedancegives R₁ + jX₁ where the phase network wantsZ_red— exact only for routes of equal construction; that pandapower line switches are not evaluated, so a ring operated open at a line switch is imported closed (with the workaround); the measured numbers of the sparse kernel and of the study sessions; the exit codes ofgroundinsight run|check. Every number is recomputed a second way in the test suite — closed forms of a two-bus line, a hand-merged DC chain, the independent reference solver, IEC 60909/60949 by hand, the corner-to-corner path counts of grid graphs (2, 12, 184, 8512). (DOC5, DOC6, DOC8, DOC10, DOC12, F7, F8, PH11) - Reference "Result tables" and "Warnings and diagnostics". Fifteen
result frames with column, dtype, unit and meaning — the names and dtypes
are generated at build time from the schema constants (
RES_FAULT_SCHEMAand the others) or from a probe solve, so they cannot drift. Both reduction factors are named everywhere (r_epr/reduction_factoris the EPR ratio,r_current/reduction_factor_currenttherof EN 50522), andfrequency_Hzis a number with a null RMS row everywhere except in the outage comparison frames, where it is text with"RMS". All 63 diagnostic codes with category, severity, elements, trigger and remedy; a test holds the page to the codes insrc/in both directions. (DOC6, DOC8, DOC10, DOC12, GUI4) - Every public name is on an API page. 12 of the 104 names of
groundinsight.__all__and 2 of the 64 ofgroundinsight.apiwere rendered nowhere — among themmigrate_database,needs_migration,set_log_level,show_versions, three warning classes and the thermal catalogues. A new page "Top-level package" lists each name with the page that documents it; the API overview links every API page. (DOC4) - Seven false statements on the API pages corrected. The electrode
currents of all buses sum to zero (not to r·I_F); the branch current is
counted positive from
from_bustoto_bus; the electrical-network page names both reduction factors and calls the bus electrodeZ_B, keepingZ_Efor the earthing impedance of EN 50522; the reference-case table is generated at build time; the importer example is the connected 20 kV level ofexample_simple()with the bond switch as a branch (4 buses, 4 branches); the short-circuit example is a runnable script with the minimum pandapower data; the voltage-level comparison ismath.isclose(..., rel_tol=1e-9), as implemented, and the skip-reason table lists all twelve reasons. Also:create_pathsandauto_parallel_coefficientsare no longer taught as steps (DOC3); the EPR limit of the rho searches is not a touch-voltage limit (DOC8); the steel default is 300 °C since 0.5.0, not 400 °C; the search status"non_monotone"is documented; a waveform amplitude is a peak value, √2·1000 A for 1000 A RMS; the outage comparison frames carryfrequency_Hzas text and the averaging example leaves the RMS rows out (DOC10); no reference to an ADR outside this repository (DOC9). (DOC3, DOC7, DOC8, DOC9, DOC10) - EN 50522 how-to reads the key figures from
res_fault. The symbol table names the column for each quantity (I_F_A= 3I₀,r_current= r,I_E_A,Z_E_Ohm,U_E_V) and the worked example reads all five in one call, recomputed in the tests with the independent reference solver. - The documentation follows the Diátaxis structure: Getting started, How-to
guides, Understanding the model, Examples, Reference, Project. The flat
navigation mixed tutorials, explanations and the API, and the audit log made
up a fifth of the search index; it now sits under Project and out of the
search, like the changelog.
mkdocs build --strictvalidates links and anchors (validation: omitted files, unrecognised links, anchors). (D1, DOC12, DOC9) - The Concepts page is split into six explanation pages, and its old address
still works.
explanation/theory.md(model, assumptions and their limits: one-way coupling exact if and only ifk = Z_m/Z_sis constant per mesh, one phase conductor, inverse rho scales only bus rho, the local source in the current-based reduction factor, the sign frame),formulas.md,phase-currents.md(phase_impedance_formula=Z_red = Z_pp − Z_m²/Z_s, the proxy, the legacy"paths"mode, which gives(1 − 2k)·Iin a two-route ring instead of(1 − k)·I),reduction-factors.md(EPR ratio against the EN 50522r,U_E/Z_E/I_Ewith the chain example: on a 64-section run the group mean lies 43 % and 44.5 % below the fault-bus EPR and the driving-point impedance),decomposition.mdanddc.md. The pluginmkdocs-redirects(pinned to 1.2.2; 1.2.3 adds a second documentation tool as a dependency only for a banner) forwardsconcepts.md,quickstart.mdandinstallation.md; every former section anchor lands on its new place. Every number on the new pages is checked a second way in the test suite. (D1, PH5, PH8, PH11, PH12, PH14) - Getting started: installation with a self-test, and two tutorials whose
numbers the reader can compute by hand. Your first fault calculation
(two stations, a 5 km cable, 1000 A at 50 Hz:
U_E= 275.43 V,Z_E= 0.8440 Ω,r= 0.274064, EPR ratio 0.384615) and From a line to a ring (the split, the phase impedance, the legacy mode 2.6 times too high, a harmonic) — each number from the code included on the page and from the closed forms, both checked by the test suite against an independent nodal solve. (DOC5) - The example notebooks are executed when the site is built. They are stored without outputs, and a cell that raises stops the build: a stored output had shown a reduction factor of 0.904 next to code that gives 0.310. The six notebooks were corrected where narrative and code disagreed and use site links; five notebooks join them — thermal limits, direct current, phase currents in meshes (against a fully coupled multi-conductor solve), the electrode at the fault location (cuts, a rho-f catalogue) and the location response bracket — each checking its numbers a second way. Strict build with all eleven executed: about a minute, 23 s from the cache. (D2, D3, DOC1, DOC2, DOC9, DOC14)
- Project pages: changelog, contributing, citation, license. The new
CONTRIBUTING.mdstates the conventions a pull request is reviewed against (module header, NumPy docstrings, typing style, logging, error classes, diagnostics throughgroundinsight.diagnostics.emit, internal API, tests first with two independent methods, changelog categories with Breaking, deprecation over two releases and six months, calendar versioning, lint instead of reformat). The citation page writes BibTeX and APA fromCITATION.cffat build time; the license page carries the scope note. (D1, D10) - README rewritten: a quickstart that shows its output (checked by a
test), the current features with the measured numbers of the sparse kernel,
the model overview with the definitions of
U_E,Z_E,I_Eand both reduction factors, links to the new structure and the scope note. The advice to run a formatter over the code base is gone. (DOC5, D10) transient.mdand the DC page describe the current behaviour without release history; the history stays in this changelog. (D4)- Import from pandapower: the switch handling replaces the limitation and
its workaround; the example compares the import with the same net with
every switch closed. The I/O page lists the reasons
line_switch_open,line_switch_closedandline_not_imported; the warnings reference and the service page listIMPORT_LINE_SWITCH_OPENand the element kindswitch. find_max_rho_scalingandfind_max_rho_f_scalingno longer ask for "consistent paths": the default phase-current mode needs none, and the legacy"paths"mode enumerates its own. (DOC3)- Every object of
groundinsight.__all__has an example that runs, every public model field is documented, and every module says why it exists. The API pages are generated from the docstrings, and numpydoc found 88 places where they lacked what the NumPy convention requires: properties withoutReturns, methods without docstrings, pydantic fields that appeared nowhere. All 99 public objects have anExamplessection run by the doctests (+SKIPonly where a file, a plot or the pandapower extra is needed), every field of a public model is listed underAttributes, and every Python file of the package, the tests, the scripts, the GUI and the how-to scripts starts with its path and a docstring. numpydoc findings: 88 → 0. (STD1, STD2) - Docstrings and comments state the contract and its reason, not the history. "Until audit pass 19 …", "used to …", "since decision F4 …" next to the code aged and had to be subtracted to find what holds now: 167 comment and docstring blocks in 41 files say what holds and why, a former behaviour that motivates a rule became its reason in the conditional. History markers in the shipped code: 115 → 0, kept there by a test. The transient module describes both solvers instead of announcing the state-space solver for "the next release". (D4)
- The legacy
"paths"mode on a ring is stated exactly.run_faultand thePARALLEL_COEFFICIENT_DEFAULTwarning said a symmetric ring collapses to EPR = 0 at the default coefficient. The coupled injections of a two-route ring add up to(1 − 2k)·Iinstead of(1 − k)·I; the EPR is 0 only fork = 0.5and, for the cable of the tutorials (|1 − 2k| = 1), as if the shields did not couple. The warning no longer claimsZ_G = Noneeither —Z_Edoes not depend on the mode.compute_grounding_impedancecites the explanation page and its value: the group quotient lies 44.5 % belowZ_E. - CONTRIBUTING.md gives the lint commands, the rule for
# noqaand the warning policy of the test suite. (STD8)
Internal¶
- Performance, core:
solve_networkkeeps the per-frequencysplufactorisation andcompute_reduction_factorsreuses it instead of a densenp.linalg.solveof the same matrix;is_short_circuit,_is_open_circuitandcheck_passive_impedanceare array/mathbased (12–31× on the checks);validate_impedance_formula_valueis memoised behind the guard (model_validate_jsonof a 120-bus network 246 ms → 5 ms).run_faulton a 200-bus chain × 50 frequencies: 1.10 s → 0.71 s. - Performance, transient: the FFT path evaluates impedances as arrays,
assembles
Yas a stacked(K, n, n)array solved in blocks of 512 bins and buildsResultTransient.to_polars()column-wise — 9.3 s → 0.3 s on 25 buses × 20 000 samples, results identical to 1e-13. -
tests/test_audit_pass18_*.py— twenty files, 394 tests, one per finding of the 2026-09-08 review; each fails without its change. -
analysis/_guards.pyholds the shared completeness guard, previously private tothermal.py. Its lookup set is built once; it was quadratic (398 ms at n = 4000). -
Performance:
analyze_cutsreuses the assembledY(26.2 ms → 9.5 ms at 150 buses × 9 f),bus_responsesolves three right-hand sides against one factorisation instead of two against two,BusResponse.extremes()is linear in the frequency count (90.7 ms → 22.9 ms at 9 f), andfind_max_rho_f_scalingdrops its closing re-evaluation ((iter + 3)·N→(iter + 2)·Nrun_faultcalls). -
scripts/generate_graphify_report.pyremoved, replaced byscripts/refresh_graphify.sh. The Python script existed only becausegraphify0.7.x stopped emittinggraphify-out/GRAPH_REPORT.mdwhile theCLAUDE.mdhook still pointed at it. Verified againstgraphifyy0.9.53: the report is written again — but bycluster-only, never byextract, in either variant.extractwritesgraph.jsonand leaves the communities asCommunity Nplaceholders; skipping the second pass leaves a stale report sitting next to a fresh graph without anything failing, which is the same silent drift the removed workaround was papering over. The shell script runs both passes in order, pins the DeepSeek backend todeepseek-v4-flashwith an explicit--modelrather than relying on the backend default, prompts forDEEPSEEK_API_KEYrather than storing it, and falls back to a local AST-only run when none is given. It also checks up front that graphify's environment has theopenaipackage — DeepSeek has no extra of its own and is reached through the OpenAI-compatible client, so without it the AST pass completes and then every semantic chunk fails. Development tooling only —graphify-out/is gitignored and the package does not depend on any of it. - Dependabot for GitHub Actions and Python dependencies
(
.github/dependabot.yml), monthly, grouped into one pull request per ecosystem. Added because the Node 20 runner deprecation reached the release workflow unnoticed:v0.5.0built with actions GitHub was already forcing onto Node 24, and the warning only surfaced in a release log. Grouping is deliberate — a single-maintainer repository reads a dozen separate bump PRs as noise, which defeats the purpose. - Audit pass 18 — full review of the 0.6.0 code base, documentation and
project setup (2026-09-08). The review itself changed nothing; the
patch series that followed it is what the Security, Fixed,
Changed, Added and Docs entries above record. The complete
record — reproduction scripts, measurements, the proposed order of work
and the GUI concept it was commissioned with — is kept with the
maintainer's working notes outside this repository. The
suite was green throughout (992 passed,
mkdocs build --strictclean), and every finding listed here was reproduced twice — once by the reviewer who raised it and once independently — so the list is short on speculation. What the pass confirmed as correct is worth stating first: the coupling model and both reduction factors, the Thévenin ⇄ Norton equivalence in both solvers, the Sherman–Morrison/Möbius form (1.4e-14 at every bus), the ring current split,iec60909_magainst numerical integration (1e-15),iec60949_k, and all four closed forms inanalysis/reference.pyre-derived by hand. The findings sit one layer above the core and at the edges. - Two ways to execute code by loading foreign data. The formula guard
in
utils/validations.pycompares raw token strings against an ASCII denylist, but CPython NFKC-normalises identifiers when it compiles the source thatsympy.lambdifygenerates — a fullwidthevalpasses the guard and reaches the builtineval(verified throughcreate_bus). AndNetworkDB.frequenciesis aPickleType: a.dbfile from another hand runspickle.loadsbefore Pydantic sees a single field. Both contradict whatassert_safe_formulapromises. run_faultenumerates every simple source→fault path in every mode. The defaultphase_current_mode="auto"only needs reachability, yetdefine_pathsruns the full DFS: a 6×6 grid of 36 buses takes 54–68 s for 1.26 million paths while the solve itself is milliseconds.docs/concepts.mdanddocs/api/pathfinder.mdstate the opposite scaling.- The transient FFT solver ignores mutual coupling (17 % on the
verification case, no warning) while
docs/transient.mdsays it injects mutual currents like the stationary solver; it also injects sources that have no path to the fault, and the state-space solver reads its evaluation frequency fromfrequencies[0], so a leading 0 Hz silently drops the source inductance. run_sweepdoes not restore the network after a point fails in_apply(the return value is never bound, sofinallyskips the restore) and the following points are solved on the corrupted model; three smaller restore gaps (R/L/C, impedance-plus-rho on one bus, the previous fault's cached result) sit next to it.- The 0.6.0 analysis layer against its own core:
bus_responsepassesr_eprthrough as invariant although it is only invariant at the fault bus, and computesZ_G_Ohmwith theu/(r·I)expression that 0.6.0 replaced; the inverse-rho searches leave a stalenetwork.electrical_networkbehind from whichbus_responsethen reads a negative driving-point impedance; the bisection assumes a monotonicity that a rho-only sweep with a fixed reactive part does not have;analyze_cutsassembles its ownYand therefore treats a 0 Hz short circuit as an open end and omits the Thévenin loop admittance, while itsidentity_residualis structurally zero and cannot show either. - Persistence and models: the
add_columnsmigration cannot add the eight NOT-NULL columns with Python-side defaults it exists for and leaves the file unopenable;save_networkmerges bus/branch types globally and leaves the other network inconsistent; no model setsvalidate_assignment, soapply_shortcircuit_characteristicscan writekappa = 42past the validator that promises to reject it. - Documentation:
docs/examples/mv_ring_transient.ipynbdoes not run (KeyError: 'F1', cell 10) while its stored output shows a result; the README still recommends the deprecatedauto_parallel_coefficients=True;concepts.mdclaims an RMS row inres_all_impedancesthat does not exist; the migration API is absent from the site; and the four chapters an engineer without Python routine needs most — assumptions and limits of the stationary model, where the impedance formulas come from, how to read the result columns and carry a verification through to an EN 50522 limit, and a glossary — do not exist yet. - Runtime, without touching the architecture: reuse the
splufactorisation incompute_reduction_factorsinstead of a dense re-factorisation (13× on the linear-algebra share), vectorise the scalar passivity/short-circuit checks (three hot loops at once), anlru_cacheonvalidate_impedance_formula_value(8.4× onmodel_validate_json), and a batched(K, n, n)assembly in the FFT solver (≈10× end to end). The open items are listed under Roadmap → From the 2026-09-08 review. Fixes follow the house rule: a test that is red without the change, intests/test_audit_pass18_*.py, with the measurement protocol indocs/audit-log.md. - Audit pass 19 — review of the
audit-pass-18state together with the prepared pass-18 series (2026-11-07). Review only; nothing below is fixed yet. The pass looked at what is still open after patches 0006–0024 — which still apply cleanly onaudit-pass-18and keep the suite green (1413 passed; 1163 without them) — so that the pass-18 findings are not found a second time. Five independent tracks (numerics and performance, physics with an independently written reference solver, security, documentation and code standards, a GUI prototype) plus architecture, usability and versioning; every physical or numerical statement checked by two independent methods. Confirmed as correct first: the stationary core matches a branch-current MNA reference to ≤ 3·10⁻¹⁴ on 17 structural cases and 60 random networks, KCL, reciprocity and the power balance hold to 10⁻¹⁵,bus_responsematches re-solves to 10⁻¹⁴,iec60909_mmatches numerical integration to six digits, and the pass-18 formula guard and pickle fixes hold against 19 bypass vectors and a hostile.db. The suite also passes unchanged on Python 3.12. - Model, not numerics. A Thévenin source couples with
E/Z_srcinstead of the loop current it actually drives (fault EPR 6–38 % low against a fully coupled multi-conductor model, unconservative, no warning); the state-space transient still splits the phase current per enumerated path (a symmetric ring settles at +103 % of the stationary"auto"result); a broken shield ("nan") withoutphase_impedance_formulaalso opens the phase conductor through the proxy and silences the cycle warning (−39 % EPR); and in the textbook case of the standard — a long uniform cable feeder, remote source —u_earthingandz_earthingcome out 43–45 % below the fault-bus EPR and the driving-point impedance that the ladder closed form reproduces to six digits. The one-way coupling of the"auto"phase solve is exact iffZ_m/Z_sis constant around every mesh;phase_impedance_formulahas to describe the screened loop impedanceZ_pp − Z_m²/Z_s, which the documentation does not say. - Regressions and silent misuse. Since the
splureuse (K3) a solved network can no longer be deep-copied or pickled (SuperLUin the cached factorisation); assigningspecific_earth_resistanceorlengthis validated but leaves the stored impedance stale; a source with no value at any solved frequency solves to 0 V everywhere without a word; a failedcreate_bus/create_branchleaves a half-built element in the network; a missingscalingskey still means a factor of 1.0 whiledocs/concepts.mdsays it contributes nothing. - Scale. The phase network is solved dense per source and frequency and
the admittance matrix is assembled dense per frequency, all of them kept:
a 4000-bus ring over seven frequencies takes 28 s and 2.3 GB, a 4000-bus
radial feeder with three sources 143 s —
spluitself accounts for 19 ms of it. A sparse prototype solves the same cases in 1.0 s and 1.15 s with 93 MB, agreeing on 606 networks to ≤ 2.6·10⁻¹², while the documentation promises thousands of buses.split_earth_currentsis quadratic, and the earth-group partition behindI_EandZ_Gis decided by rounding noise in nameable cases (buses without physical earth current, a fault bus without electrode):Z_Gchanges by a factor of 2.2 between two solvers that agree to 10⁻¹⁵ everywhere else. - Security and supply chain. The guard caps the exponent but not the
size of the base (
<4080 digits>**999costs 1.9 s ofsympifyper formula, 17.9 s for a 20-type JSON); every fixed Pillow release lies outsidepillow = "^11.3.0"; third-party actions are pinned by tag, the publish action by a moving branch inside theid-token: writejob. - Documentation. The site publishes stored notebook outputs, and all six
curated notebooks are stale —
mv_ringshowsr = 0.904against 0.310 today; the tutorials still teachcreate_pathsas a mandatory step; 24 of 95 public symbols have no API page; seven factual statements on API pages are wrong; there is no route from installation to a first verified number. - For a graphical interface the library lacks a stable project file
(UTF-8, atomic write, schema version), copyable networks, edit
invariants, structured diagnostics with element references, progress
and cancellation hooks and a key-figure accessor at the fault.
The planned work is listed under Roadmap → From the 2026-11-07 review.
The house rule stands: a test that is red without the change, in
tests/test_audit_pass19_*.py.
- CI on macOS and Windows. The test matrix runs 3.12/3.13/3.14 on Linux
and the two ends, 3.12 and 3.14, on macOS and Windows — seven jobs — with
bash as the job shell,
MPLBACKEND=Agg, no restored virtualenv on Windows and a single coverage upload. Four test sites read or wrote text with the platform's default encoding (cp1252 on Windows) and now say UTF-8; an AST scan overtests/keeps it that way (REL7, F10). - The lock is checked where the suite runs. It had been solved for
^3.14whilepyproject.tomlsaid^3.13, which Poetry 2 refuses atpoetry install, so every CI job would have stopped before its first test. The suite compares the lock with the declaration and runspoetry check --lockwhen Poetry is installed (REL2). - The documentation is deployed only from a strict build
(
mkdocs gh-deploy --strict) (STD11, DOC15). tests/test_audit_pass19_supply_chain.pyandtests/test_audit_pass19_workflows.py— 63 tests on the dependency floor, the lock, the audit script, the workflows and the migration triage. Workflow checks read the YAML as text, because PyYAML is not in the CI test environment, and repeat each check on the parsed document where PyYAML is installed.- Independent reference solver for transient tests
(
tests/_transient_reference.py): modified nodal analysis with shield and phase-conductor branch currents as unknowns, phasor and trapezoidal time-domain solve, optionally with a prescribed phase split; reproducesrun_faultto 1e-15.tests/test_audit_pass19_transient.py(35 tests) checks PH2, PH-L1, PH15 and P8 against it, against the stationary solver, against1/|1 − Z_m/Z_s|and against a verbatim copy of the old FFT block loop. Three pass-10 tests that pinned the path-based factor (paths rebuilt with a log line, factor exactly 1.0) now assert untouched paths and the factor to 1e-12. - The package
__init__lost its persistence code (878 → 455 lines): JSON I/O moved toio/project_file.py, the database session and its wrappers todatabase/store.py. Tests that pinned the removed globals (_set_session, direct assignment ofgi.engine/gi.session) were rewritten to the new contract. A project file written by the genuine 0.6.0 writer is a test fixture. (ARC2, GUI1) ElectricalNetwork._UNCOPYABLE_CACHESlists the attributes that hold SciPy factorisations; a new factor cache has to be listed there, or a solved network stops being copyable. (GUI2)Bus/Branch._derive()computes every derived field without writing;calculate_impedance()is_apply_derived(_derive(...)). Elements share a_NetworkElementbase with a weak, equality-neutral link to their network. A test keeps the table of digested and exempt model fields complete, so a new field has to be classified before a result can silently stay "current". (GUI3, ARC9)- Four tests in
test_core_models.pyused the formula"1+roh+f", a typo the symbol check now catches; they use"1+rho+f". (USE2) - An independent reference solver as a test helper.
tests/_reference_mna.pyuses modified nodal analysis with branch currents as unknowns, in the physical sign frame. With it, the permanent physics tests (tests/test_audit_pass19_physics.py) pin 17 structural networks to 1e-12, and KCL, reciprocity, passivity and Tellegen on seeded random meshes (plus a hypothesis variant when hypothesis is installed). A 1e-6 error in the coupling injection turns 38 of 39 of these tests red. (PQ-REF, PQ-INV) groundinsight.utils.earth_current:NOISE_REL = 1e-9,earth_current_vanishes(), andsplit_earth_currents(..., anchor=, noise_rel=). The pytest markerslowis registered inpyproject.toml. (P3, P9)- CI runs every test the suite has; a missing test dependency fails.
The CI test job installs only the
devgroup, but PyYAML (for the YAML cross-checks of the workflow tests) sat in thedocsgroup, and bandit (for the SEC6 check) and hypothesis (for one variant of the PQ-INV invariant tests) were in no group at all. So 12 tests were skipped in CI without anyone seeing it, and the hypothesis variant was not even defined there. All three are dev dependencies now (pyyaml ^6.0,bandit ^1.9,hypothesis ^6.0); the lock keeps every other version and adds bandit 1.9.4, hypothesis 6.170.15, rich 15.0.0, sortedcontainers 2.4.0 and stevedore 5.9.1 (pip-audit: 133 pins, no known advisory). The test jobs ofci.ymlandrelease.ymlsetGROUNDINSIGHT_CI=1, under whichtests/conftest.pyturns a skip caused bypytest.importorskip— in a test, a fixture or at module level — into a failure, and a newrequire_toolfixture does the same for a missing executable (poetry). Without hypothesis, the PQ-INV module now defines a stand-in that skips visibly instead of leaving no trace. Skips for any other reason (platform, permissions,+SKIPdoctests) are untouched, and outside CI everything skips as before. A test scans the suite'simportorskiptargets and requires each of them in thedevgroup, so the next optional import cannot go missing in CI either. - Documentation examples run in the test suite.
docs/snippets/*.pyare included into the pages withpymdownx.snippets(now withcheck_paths) and executed bytests/test_audit_pass19_docs_examples.py;tests/test_audit_pass19_docs_pages.pyreads the formula whitelist and the guard limits from the code, replays the documented error messages, checks the sign-frame and RMS examples a second way and runs every code block of the new pages. A build hook,docs/hooks/reference_cases.py, writes the reference-case table.mkdocs-jupyteris limited to*.ipynb: its default turned every*.pyfile underdocs/into a notebook page. (DOC13) - One pass over the model per assembly. Impedances, flags and topology are
gathered into
(elements, frequencies)arrays once (_NetworkTables), with the 0 Hz stand-in applied to whole columns; the passivity rules, the Thevenin loop closures (thevenin_loop_admittancesreads the same table rule the assembly stamps with), the mutual Norton injections, the floating-network guard, the electrode and shield currents and the result rows run on those arrays. The element-wise passivity check (0.18 s on a 4000-bus ring at seven frequencies, against 0.7 ms vectorised) still raises its full message when the vectorised one fails. (P6) - The state fingerprint is a BLAKE2 digest of the gathered arrays with the
same coverage as the former tuple (every bus, branch and voltage source by
name, values at all stored frequencies). A build digests the tables the
assembly has gathered (about 5 ms on a 4000-bus ring at seven frequencies)
instead of a separate pass over the model (about 26 ms);
matches_network_statereads the model afresh and costs about the same as before (about 25 ms). (P6) - Result rows are built with the cyclic garbage collector paused
(
_gc_paused: restores a collector that was on, also on error; pauses nest and overlap across threads; a collector the caller switched off stays off). Result-building stage: 0.49 → 0.19 s on a 4000-bus ring at seven frequencies, 0.69 → 0.26 s on a 10 000-bus ring at three. (P5a) - Equivalence harness for the stationary kernel.
tests/_dense_oracle.pyre-implements the model densely from the public data (noElectricalNetworkcode), optionally with iterative refinement inclongdouble;tests/test_audit_pass19_performance.pycompares every physical quantity of 150 random and 7 structured networks (n ≤ 300) at 1e-12 — with the earth group oriented as the kernel orients it andZ_E = Z_dp(F)at every bin — checks the sparse matrices against the dense assembly (1e-15, and bit for bit with the same division), guards against densen x nallocations (with current and with Thevenin sources, also inbus_response/analyze_cuts) and checks linear memory, checks large networks against exact (tree KCL, closed-form ring split) and refined references, checks that the sparse matrices and their dense view travel together throughcopy.deepcopyandpickle, and holds theslow-marked size acceptance. (P1, P2, P6, P7, P13) - The reference solver of the tests is group-aware.
tests/_reference_mna.pygainsearthing_group,has_electrode,driving_point_systemandFloatingEarthError. The driving point is now solved on the bus's earthing group only, and a group without an electrode is refused. groundinsight._state.NetworkState: exact snapshot and restore of the network-level state — every field with the content of its containers, the private attributes of the network and its faults, the fields-set bookkeeping — used by the cancellation and by the searches.groundinsight.utils.compat.renamed_parameters: the alias decorator; it checks its renames when the function is decorated and records them in__deprecated_parameters__.analysis._bisection.planned_steps.- The outage study and the frequency-dependent search call
run_faultwith the canonical keyword, so no study triggers the deprecation warning itself. groundinsight.utils.compat.warn_stacklevel: thestacklevelfor a warning raised under the alias decorator, counted without its wrapper frame, so the warnings of functions with a renamed parameter — the diagnostics and theDeprecationWarningofauto_parallel_coefficients— name the caller's line on Python 3.12 as on 3.14 (warnings.warn(skip_file_prefixes=...)matches no complete file name on 3.12).- Tests:
tests/test_audit_pass19_api.py(126),tests/test_audit_pass19_studies_progress.py(27),tests/test_audit_pass19_tables_io.py(33),tests/test_audit_pass19_res_fault.py(21: every column against the result objects and the reference solver oftests/_reference_mna.py),tests/test_audit_pass19_diagnostics_inventory.py(42: the remaining log sites pinned with the reason each is operational, so a newlogger.warningfails until it is classified; every converted code raised in its module and documented there; a triggering network or table per code), eight doctests. Three older tests match the new message wording, one test of the edit invariants expects the sweep to leave no stale result, and 21 older tests in six files read the structured records instead ofcaplog. - The package
__init__holds imports,__all__,__version__and the deprecation__getattr__only. The logging default andset_log_levelmoved togroundinsight/_logging.py,show_versionstogroundinsight/_versions.py; both stay re-exported. Re-importing the package (importlib.reload) no longer adds a secondNullHandler. A test checks the allowed statements and that each of the 103 names of the previous__all__stays importable. Import time unchanged: median 0.912 s → 0.895 s (30 interleaved runs in fresh interpreters). (ARC3) - One reachability search and one passivity classification. The transient
study asks
Network.sources_reachingfor the sources that feed the fault instead of running a breadth-first search of its own. The four passivity rules have one implementation,passivity_classes, used by the dictionary checker, the array checker of the transient solver and the vectorised check of the stationary kernel (non_passive_mask); the message builder exists once as well. Decisions and messages are unchanged: both checkers agree with a rule-by-rule oracle on 48 edge cases (zero, signed zero, subnormal, ±∞, NaN, …), and the reachability agrees with connected components fromscipy.sparse.csgraphon 40 random networks with inactive elements and islands. (ARC6) - Internal API instead of underscore names across modules. Modules used 23
underscore names of other modules (
electrical._resolved_impedance,fault._set_active,network._needs_path_rebuild, …). They are now internal API without the underscore:ElectricalNetwork.resolved_impedance,.grounding_shunts,.earthed_buses,.remove_loop_closures,.compute_phase_currents;electrical_network.component_labels,.restricted_columns;Fault.mark_active(was_set_active);Network.needs_path_rebuild,Network.input_digest;impedance_calculator.render_frequencies,.short_circuit_mask;analysis.shortcircuit.sources_feeding;io.pandapower_import.bus_index_to_name,.require_pandapower. The rules ofNetwork.frequenciesmoved from the field validator intomodels.core_models.validate_frequencies, which the validator andcheck_networkcall; the order warning still points at the code that builds the network. Code that used the former underscore names has to use the new ones. An AST test finds every remaining use of another module's underscore name (also throughgetattr/setattr/hasattr/delattr/object.__setattr__); it finds none, with an empty allow-list. (ARC5) - Tests use
gi.Databaseinstead of the deprecated session globals, except the tests of the deprecation path, which assert the warning; the suite raises 11DeprecationWarnings fewer. (ARC2) - Release and CI keep the GUI on the library's version.
scripts/release.pyrewritesgui/pyproject.toml(version andgroundinsight==pin) andgui/groundinsight_gui/__init__.pywith the other version sources and stops on drift — the drift check no longer keeps one entry per file, which would have hidden a pin disagreeing with the version line of the same file. The release workflow's guard refuses a tag that one of them disagrees with (tested by executing the guard on copies of the files). A CI job installs the library and the GUI from the checkout in one pip call and runs the GUI tests on ubuntu/Python 3.14; Dependabot watches the GUI's NiceGUI range and leaves the library pin to the release script. - Concurrent solves of different networks are tested under thread
pressure. While the pathfinder kept module-level caches shared by every
network, clearing one network's entries while another thread inserted failed
with
OrderedDict mutated during iteration(4 threads × 150 solves: 7 of 600 raised); the per-network memo of ARC2 removes the shared state, and the new tests keep it that way (results bit-identical to solo solves). - New internal API (not exported, see
docs/api/index.md):ElectricalNetwork.nodal_parts()with theNodalPartstuple,assemble_nodal_matrices,bus_admittances,rms_columnsandstack_columnsingroundinsight.electrical_network, andimpedance_tableingroundinsight.utils.impedance_calculator. - Every Python block of the documentation runs or is marked as a
fragment.
tests/test_audit_pass19_docs_codeblocks.py(runnertests/_docs_codeblocks.py) executes the Python blocks ofdocs/**/*.mdpage by page in one namespace, in a subprocess with a 120 s timeout per block; a block whose first line is# fragmentis an excerpt,>>>sessions arepyconblocks, a snippet include runs the whole script once, and blocks needing the pandapower extra are skipped without it except underGROUNDINSIGHT_CI=1. Before, 12 pages failed this; now 119 blocks on 43 pages pass (21 inline, 69 snippet includes, 29 fragments). (DOC13) - The docs CI job checks the built inventory. After
mkdocs build --strict,scripts/check_api_inventory.py site/objects.invfails the job when a public name ofgroundinsightorgroundinsight.apiis not rendered;tests/test_audit_pass19_docs_api.pychecks the same statically from the:::directives. (DOC4) - Build hook for the result tables.
docs/hooks/result_tables.pyreplaces<!-- result-table: <key> -->markers with tables generated from the code; a column without a description stops the build. It is called from the registereddocs/hooks/reference_cases.pyuntilmkdocs.ymllists it. - Build hooks for the documentation.
docs/hooks/notebooks.pypoints the notebook kernel atsrc/, limits a cell to 600 s and names the notebook cache after a digest of the package source, so a local build never shows outputs of older code; it also fails a strict build when a notebook page shows a path of the build machine (an unhandled warning).docs/hooks/project_pages.pyshowsCHANGELOG.mdandCONTRIBUTING.mdwith their links rewritten for the site and writes the citation.docs/hooks/result_tables.pyis registered. A theme override adds a download button to the notebook pages. - CI runs the notebooks in one place, the strict docs build, which now installs the pandapower extra and has a 30-minute limit; the separate nbconvert job is removed. The deploy workflow installs the same.
- Structure gates in
tests/test_audit_pass19_docs_structure.py: every page in the navigation and the sections in order, redirects and every former anchor, the documented Python floor, the tutorial snippets against their pages and the closed forms, notebooks stored clean, executed at build, listed and linked with site addresses, the hooks, the project pages,CONTRIBUTING.mdlinked from README and docs, the README quickstart. - Tests:
tests/test_audit_pass19_line_switches.py(14) — the open switch against the same pandapower net with the switch closed and with the line removed, against the documented construction by hand and against the reference solver oftests/_reference_mna.py(EPR, screen and phase currents to 1e-12), and the preview. - ruff and numpydoc gate every push; their 367 and 88 findings were fixed
by hand. The house conventions were written down and checked by no
tool.
pyproject.tomlconfigures ruff (E, W, F, B, N, D, SIM, UP, RUF013, T20, every ignored code with its reason) oversrc,tests,scripts,guianddocs/snippets, and numpydoc validation for the package. Lint, never format: no formatter in the configuration, the dependency groups (black is gone from the dev group) or CI; every finding was a deliberate edit — 78zip()calls statestrict=or becameitertools.pairwise, 14 unclosed files in the migration tests are closed. ruff 0.17.4, numpydoc 1.11.0 and radon 6.0.1 are exact pins in the dev group, and the new blocking CI joblintruns both linters at those versions. ruff 367 → 0, numpydoc 88 → 0. (STD8) - The test suite runs warning-free under strict filters: 1152 warnings
per run → 0. A new warning could not be told from the noise. 351
DeprecationWarnings came from tests that still passed
fault_name=,u_max=,t_k=orauto_parallel_coefficients=; they use the canonical names now, and the alias tests assert their warning.pytestturns DeprecationWarnings of the package and the tests, ResourceWarnings, unraisable exceptions and everyGroundinsightWarninginto errors; a test that provokes a package warning asserts it or acknowledges it by name with a reason (tests/_warning_policy.py, 35 names), and the one remaining ignore — a pandas FutureWarning inside pandapower — says why. The strict filters found an unclosed database in a test that makesdisposefail on purpose. The doctest sweep fails on a module it cannot import instead of passing over it. (STD5) - Code standards are tests.
tests/test_audit_pass19_standards.pychecks the lint configuration and pins, module headers (203 files), field documentation and examples of the public API, docstrings without history, noprintin the package, a package or removal category for everywarnings.warn, the order of the[Unreleased]sections, the documented Python floor on every page and in the GUI, the canonical parameter names with an allowlist of 18 deprecated aliases that can only shrink, and a complexity ratchet: the 80 functions above radon complexity 10 are listed intests/data/complexity_ratchet.tomland none may become more complex. (STD1, STD2, STD3, STD5, STD7, STD10, STD11) - The test suite runs on macOS and Windows. The first CI run on those systems found assertions that measured the platform: a doctest printing a float to its last digit, a child process read as UTF-8 on Windows, platform path separators, a refined reference that needs the 80-bit extended long double of x86-64 Linux (skipped with that reason elsewhere), Poetry's lock check on Windows runners (runs on Linux and macOS), and an absolute timing bound (now relative to the solve on the same machine).
0.6.0 — 2026-09-01¶
Added¶
-
Closed-form reference cases (
gi.run_reference_cases). Six configurations whose answer is known in closed form, run through the ordinary public API and compared, with the derivation in each case's docstring rather than a quoted equation number. Measured deviations: the textbookr = |1 - Z_m/Z_s|under its own condition of negligible station electrodes (2e-6), the same line with finite earthing (5e-16), the EN 50522 chain (1e-16), the ladder-network input impedanceZ_in = -Z'/2 + sqrt(Z'^2/4 + Z_e*Z')over 80 sections (3e-9), the potential decayu_n/u_0 = e^(-n*gamma)withgamma = arccosh(1 + Z'/(2*Z_e))(3e-7), and the parallel decomposition at a station (1e-15). Each case states the boundary conditions its closed form needs, because a deviation more often means a condition was not met than that the model is wrong. Also run as tests, so a change that quietly breaks agreement cannot reach a release. -
Characterising a location without knowing the electrode there (
gi.bus_response). Adding an electrode is a rank-one change to the nodal matrix, so by Sherman-Morrison every nodal voltage is a Möbius function of its admittance. Two solves with the electrode removed therefore determine the response for every electrode — measured against genuine solves atZ_Bfrom 0.05 Ω to 500 Ω and at4+9jΩ, the closed form agrees to3e-15relative, on every bus and for the current-based reduction factor as well.BusResponse.extremes()gives the bracket:open(no electrode),ideal(Z_B = 0) andworst_passive. Both endpoints are exact limits rather than numerical stand-ins — the ideal electrode in particular, which the solver rejects outright because a zero impedance is not invertible..evaluate(z)and.sweep([...])cost no solve at all. BusResponse.z_networkis the site-independent number the analysis is built around: the driving-point impedance of everything except the local electrode. Verified identical whether the response was built from a network carrying a 0.5 Ω electrode or a 200 Ω one.Z_dp = 1/(Y_B + 1/Z_net)exactly, so it runs monotonically fromZ_netto zero. The largest magnitude over all passive electrodes is not at the open end but at the reactive resonanceY_B = -j·Im(1/Z_net), worth 0.1 % more in the verification network — small, but reported rather than assumed.- The closed form derives the invariance of the EPR-based reduction factor
that the electrode sweep above measured:
u_b(Y_B) = u_0b/(1 + Y_B·Z_net)holds with and without mutual coupling alike, so the quotient cancels. Algebra, not an accident. -
The guard that the location is characterisable at all is structural, not a tolerance: at least one other bus must carry a finite grounding impedance once the electrode is removed. Leaving it to the linear solver is not enough — on the exactly singular case numpy returns a finite but meaningless
-2.25e15instead of raising, the same inconsistency the DC work found in scipy'ssplu. -
Splitting the network at the fault location (
gi.Cut,gi.analyze_cuts). A cut is a named set of branches, all incident to the fault bus; the analysis reports what each direction contributes.parallel impedance left --- fault location --- parallel impedance right
Z_side comes from source-free current division: one ampere is injected
at the fault bus with all sources and mutual injections removed, and the share
leaving through each cut gives Z_side = u_fault / i_cut. The decomposition
closes by construction — 1/Z_local + Σ 1/Z_side reproduces the
driving-point impedance of the whole network, measured residual 1.2e-15 on a
five-bus chain and on the same network with the ring closed. Isolating each
side into its own sub-network would have been equivalent for a radial network
and wrong in a ring, where removing one branch separates nothing and the
far side comes out empty; that formulation was discarded before it shipped.
From a solved fault the analysis additionally reports i_shield and
current_share per direction (KCL at the fault bus closes to 2.4e-16), and
where the directions are disjoint also i_earth, i_total and the side
reduction factor. sides_are_disjoint says which case you are in; a passive
spur gets r = None rather than a division by zero. Results as a typed
CutAnalysis and as a long-format frame via .to_polars().
-
A second reduction factor, on a current basis (
ResultReductionFactor.value_current). The existing EPR-basedvalueis structurally blind to the impedance at the fault bus: both solves use the sameY, so changingY_ffis a rank-1 update that cancels in the quotient. Measured: sweeping the fault-bus electrode over four decades leaves it at0.500000whileZ_Gmoves by two orders of magnitude and the potential rise by a factor of fifty. A rho-f sensitivity study plotted against it would be a horizontal line.value_currentis the share of the fault current that returned through earth rather than through the shields and does respond —0.0414 → 0.00053over the same sweep. Both are kept:valueso earlier results stay reproducible and so the closed formr = |1 - Z_m/Z_s|keeps its meaning,value_currentfor sensitivity work.res_all_impedances()reports both. -
Parameter sweeps (
gi.run_sweep,gi.SweepPoint,gi.rho_f_points). Solve one fault once per parameter combination and stack the results into long-format frames that carry the parameters as ordinary columns (.buses(),.branches(),.impedances(),.cuts()). A point can override bus impedance tables, soil resistivity, the fault location or the harmonic scalings.rho_f_pointsbuilds the points from a catalogue of five-parameter rho-f vectors — the formgroundfieldexports — and rejects a vector that givesRe(Z) <= 0where it is built rather than three layers down in the solver, because an unconstrained least-squares fit can land there. Overrides are undone in afinallyblock, so a failing point leaves neither the network nor the remaining points contaminated; failures are recorded per point and the sweep carries on (on_error="raise"for the strict variant). -
Statistics and classification (
gi.summarize,gi.classify). Count, spread, named quantiles and extremes for any numeric column, grouped or not; and a class column that bins a quantity into user-supplied bands, closed on the right so a value exactly on a limit stays in the lower band. There is deliberately no built-in table of admissible values — touch-voltage limits depend on the clearing time, the standard edition and the assumed additional resistances, and a constant baked in here would be carried into a result without ever being checked. The edges come from the caller, who can cite them.summarizenames thefrequency_Hz-is-a-string trap in its error message rather than just refusing. -
BranchType.phase_impedance_formula(optional, symbolsf,rho,l) and the evaluatedBranch.phase_impedance, mirrored in SQLite and JSON. It describes the phase conductor -- the faulted conductor whose current induces the longitudinal EMF on the shield -- and is what the automatic phase-current distribution solves on. It never enters the nodal admittance matrix and is therefore not passivity-checked. Where it is absent and the phase network around the fault carries a cycle, the solve falls back to1/Z_self(with a grounding conductor) or1/length(without) and warns once per solve, naming the branches: those two quantities are not comparable, so the split between routes of different construction is a heuristic rather than a physical result. On a ring whose two legs differ by a factor of ten in phase impedance the declared formula divides the current 909.1 A / 90.9 A, as it should.
Changed¶
-
Breaking:
ResultGroundingImpedance.valueis nowZ_Ein the EN 50522 sense — the earthing voltage of the bonded earthing system over the current it passes into the soil — instead ofu_EPR / (r_coupling * I_F). The old expression mixed the coupling ratio into an impedance: on the verification feeder it reported 0.219 Ω where the earthing system actually presents 3.298 Ω, a factor of fifteen, the same one that separates the two reduction factors. With the new definition the norm's chainU_E = 3*I_0 * Z_E * rcloses on the reported value itself. Every ingredient of the old expression is still in the result (ResultBus.uepr,ResultReductionFactor.value, the source currents), so an earlier number can be reconstructed where a comparison needs it. -
run_outage_studyforwardsphase_current_modeand defaults it to"auto"as well -- an outage study is precisely where a ring turns into a chain and back, so the modelling assumption must not change underneath it. -
Breaking (behaviour, meshed networks only): the default phase-current determination moved from the path-based scheme to the phase-network solve. A meshed network solved with the previous default returns different -- and now non-degenerate -- numbers. Radial networks are unchanged.
Branch.parallel_coefficientis ignored in"auto"mode; it still applies in"paths".
Deprecated¶
run_fault(auto_parallel_coefficients=...)is deprecated in favour ofphase_current_mode. It still wins when passed explicitly, so existing call sites keep their exact behaviour, and passing it logs that it is deprecated.
Fixed¶
- The current-based reduction factor summed the wrong thing.
I_Eis the total earth-return current, and in a cable network with continuous shields the stations are bonded to one another, so the current spreads along the shields and leaks into the soil at every bonded station — the earthing current is distributed by construction. The first implementation summed the electrode currents of every bus except the faulted one, which by Kirchhoff (Σ I_a = 0over the whole network) is identically the electrode current of the faulted station alone. Measured on a six-station feeder at 50 Hz:
| fault position | as shipped first | correct | factor |
|---|---|---|---|
| mid-feeder | 0.010947 | 0.032385 | 2.96× |
| one station from the infeed | 0.001955 | 0.009138 | 4.67× |
| far end | 0.026939 | 0.048327 | 1.79× |
The group is not found from the potential profile: the crossing falls
between stations rather than on one, and with the fault near the infeed
|EPR| runs 91.4, 19.6, 18.7, 18.1, 17.7, 17.5 V — no crossing anywhere. What
is unambiguous per bus is the direction of its electrode current, so the
split is made in the complex plane over the half-plane whose sum is largest:
threshold-free, no angle nominated, and it reduces to the obvious answer when
the two groups are cleanly opposed. New groundinsight.utils.earth_current
with split_earth_currents; ResultReductionFactor gains i_earth (the
ampere value) and earth_buses (the group) so the split is inspectable, and a
separation diagnostic is logged when the phasors are spread in angle. Both
groups carry the same sum with opposite signs, so |I_E| is independent of
which is named which; the fault bus anchors the naming. BusResponse uses the
same definition, and there the electrode under test contributes its own current
rather than the one the response happened to be built with.
-
The EN 50522 chain
U_E = 3*I_0 * Z_E * rnow closes in the result.ResultReductionFactorgainsu_earthing(the earthing voltage of the bonded group, the mean potential weighted by each station's electrode current) andz_earthing(Z_E = U_E / I_E). All three routes tor— the current ratio|I_E|/|3I_0|, the voltage routeU_E/(Z_E*3I_0), and the reportedvalue_current— agree to machine precision across three decades of electrode impedance, which settles thatvalue_currentis the norm's reduction factor. Rearranging the norm toU_E(r)/U_E(r=1) = ris correct and its reference case isr = 1, meaning the whole fault current throughZ_E: 3298 V on the verification feeder, against the 214 V that removing only the mutual coupling gives while the shield stays in place as a metallic return. The ratio of those two reference voltages is exactly the ratio of the two factors and nothing else. Two further things are worth knowing and are pinned by tests:Z_Eis not the electrodes in parallel — the shield sections between the bonded stations add to it, 3.30 Ω against 2.50 Ω — and where the group is not actually equipotential the lumpedU_Eis a weighted average of different voltages, which is reported at INFO. -
The two reduction factors are now documented as the different quantities they are, and the gap between them is reported. They are not two computations of one number: for a route with shield impedance
Z_s, mutual impedanceZ_mand station electrodes summing toZ_E,r_coupling = (Z_s-Z_m)/Z_sagainstr_current = (Z_s-Z_m)/(Z_s+Z_E), so their ratio is the current dividerZ_s/(Z_s+Z_E)and nothing else.ResultReductionFactor.valueis the ideally bonded limit — the tabulated cable property1 - Z_m/Z_s, blind to the station earths by construction — whilevalue_currentis what this earthing system actually passes into the soil. Verified against the closed form to machine precision over five decades of electrode impedance: exact convergence asZ_E → 0(ratio 0.999980 at 10 µΩ) and a factor of 45 apart at 10 Ω electrodes against a 0.45 Ω shield. The divider is logged at INFO where it drops below 0.5 — a wide gap is a property of the network rather than a defect, and with ordinary station electrodes it is the normal case. -
BusResponse.extremes()was documented as a bracket for more than it brackets. The three cases are extremes of the local quantities — the potential rise at the bus itself and its driving-point impedance. Transfer quantities are not bounded by them: at the verification feeder a purely capacitiveZ_B = -0.5569jat the faulted station — passive, so inside the same class theworst_passivecase is drawn from — reachesEPR_S0 = 1032.5 Vagainst theidealcase's 928.0 V (+11 %) andr_current = 0.3429against 0.2799 (+23 %), confirmed by a genuine solve and not only by the closed form. The module docstring said the current-based factor and the potential rise "are reported as brackets"; it now says which columns the bracket covers and points at.sweep([...]), which costs no solve, for the worst case of a transfer quantity. Behaviour unchanged — the numbersextremes()returns were always correct for what they are. EarthCurrentSplit.__repr__was dead code. It sat insideearthing_voltageafter that function'sreturn, so the class never had it and inspecting a split printed the default<... object at 0x...>. Moved into the class.-
earth_busesnow reports the fault side. The two groups carry the same sum with opposite signs, so|I_E|never depended on the choice, but the reported membership did. It is now the set of stations from the fault outwards, in every direction — a ring or a mesh has more than one — up to where the potential profile turns, which is how the earthing current is read off a network. -
compute_reduction_factorsraised a bareKeyErrorinstead of skipping. Itsexcept LinAlgError: continuenever wroteu_vectors_no_mutual[freq], and the loop straight after it dereferenced that key. A frequency whose no-mutual solve fails is now reported asNone. -
A ring, a mesh or a second parallel cable no longer collapses the result. The phase current per branch used to be handed out by walking the enumerated source-to-fault paths and giving every branch on any path the full source current, scaled by
Branch.parallel_coefficient. Without a cycle that is exact -- there is one route and it carries everything. With a cycle the same current was handed out more than once instead of being divided, and the mutual injections it drives were multiplied with it. Measured on a symmetric ring (S-A-F / S-B-F,Z_self = (0.1+0.2j)*l,Z_mutual = (0.05+0.1j)*l, 1000 A) at the default coefficient of1.0, the two contributions cancelled the source exactly and the network solved toEPR = 0 V,r = 0,Z_G = Noneacross every bus -- announced with nothing louder than a log line. Two identical cables between the same two buses did the same thing. In a mesh the outcome additionally depended on the order the branches had been declared in, because "the first path a branch appears on fixes its direction": the same topology gaveZ_G = -0.00272 + 0.11121jor+0.00272 - 0.11121jdepending on insertion order. -
run_faultgainedphase_current_mode, defaulting to"auto". The new default solves a reduced phase-conductor network per source -- fault bus as reference, source current injected at the source bus -- and reads the branch phase currents off that solution. On the ring above it lands onEPR = 55.6208 V,r = 0.5,Z_G = 0.0507 + 0.0990j, which is bit-for-bit the result a user previously had to reach by settingparallel_coefficient = 0.5on every branch by hand. Radial networks are unaffected: both modes agree to 1e-9 there, so existing studies keep their numbers.phase_current_mode="paths"restores the old behaviour verbatim, including the collapse, so pre-0.6 studies stay reproducible. -
An island no longer discards a whole source contribution in silence. The phase-network solve pinned the fault bus over the whole bus index range, which leaves any other island without a reference node and makes the reduced matrix singular; the resulting
LinAlgErrorwas caught and the source skipped, removing all mutual coupling --rjumped from 0.5 to 1.0 and the EPR doubled, with no warning. This hitrun_outage_study(auto_parallel_coefficients=True)directly, since an outage disables named elements and leaves orphaned buses active. The solve is now restricted to the fault bus's own galvanic component, a source with no phase-conductor route to the fault is reported by name, and a genuinely singular restricted system raises with the branch types to check. -
_warning_parallel_coeffcientno longer false-alarms. It counted paths across all faults, so a strictly radial network that merely carried two fault definitions triggered the meshed-network warning. The check is now scoped to the active fault and to a single source reaching it over more than one path -- the only configuration in which the path-based mode multiplies the current.
Docs¶
-
docs/concepts.md: the path-finding section now describes the two modes, what the phase impedance is for and when the proxy fallback matters. The branch-current formula was corrected -- the page had(u_from - u_to)/Z_selfwhilecompute_branch_currentsevaluates(u_to - u_from)/Z_self, so a positiveResultBranch.i_smeansto_bus->from_bus, the opposite of the phase-current convention. That sign is load-bearing for any side-resolved evaluation. -
New notebook
notebooks/25_mesh_phase_currents.ipynbreproducing the collapse, the fix and the phase-impedance-driven split. -
New notebook
notebooks/26_cuts_and_rho_f_sweep.ipynbwalking the whole chain on a 20 kV feeder: cuts left and right of the fault, both reduction factors, a rho-f catalogue sweep and the statistics on top. -
docs/concepts.mdgains "Reduction factor on a current basis", "Splitting the network at the fault" and "Characterising a location without its electrode"; new API pagesapi/decomposition.md,api/sweep.md,api/statistics.mdandapi/response.md, all registered in the nav. -
New notebook
notebooks/27_bus_response_extremes.ipynb: the extremes, the closed form against genuine solves, and the whole curve at no solve cost. It also shows the counter-intuitive consequence the extremes exist to surface — an ideal electrode at the faulted station roughly doubles the potential rise at the source station. -
New published example
docs/examples/fault_decomposition.ipynb, the curated counterpart to the three research notebooks above: a six-station 20 kV feeder carried through both reduction factors,analyze_cuts,bus_responseand a soil-resistivity sweep withsummarize/classify, closing onrun_reference_cases. Registered in the nav and indocs/examples/index.md. It also puts theU_E-versus-bus-EPR confusion on the page rather than leaving it to be rediscovered: the norm's chain closes onu_earthing(353.46 V here), not on the EPR at the fault bus (500.17 V), and the notebook prints both side by side. README.mdanddocs/index.md: the feature lists were still those of 0.5.0 and mentioned none of the analysis layer. Both now carry the phase current solve, the two reduction factors, cuts, sweeps,bus_responseand the reference cases. The README's model overview said the reduction factor is the EPR quotient; it now names the quotient's structural blindness to the fault-bus electrode and points at the current-based factor for sensitivity work.
0.5.0 — 2026-07-31¶
This release makes direct current a real operating point, adds transient simulation with two independent solver paths, and adds the equipment-integrity side of a grounding study — thermal limits for the conductor between two buses and for the two grounding elements at a bus — next to the potential rise that was there before. It also carries fourteen audit passes worth of correctness work. The full measurement protocol for every finding (reproduction, negative control, and mutation testing where the change touched drawing or matrix-assembly code) is kept out of these notes and lives in
docs/audit-log.md.Breaking changes are marked in Changed. Databases written by an earlier release are converted automatically — see Added.
Added¶
f = 0 Hzis a frequency, not a special case. A study at zero frequency used to raise, and the documented workaround was to enterf = 0.1 Hzinstead. Both solvers now evaluate the DC bin, and the three singularities a formula string can hit there are told apart rather than lumped together: Carson's removable0·∞resolves to its limit, the capacitive1/(jωC)stays an infinite open circuit, and a genuine failure (√ρwith negativeρ, aNaN) still raises. An impedance that becomes a true short circuit at DC is replaced by a substitute impedance sized from the network's own smallest impedance (√eps · |Z|min) and reported through the newgi.DCLimitWarning;docs/concepts.mdexplains when to merge the two buses instead. New public helpersis_short_circuit(z)anddc_substitute_impedance(...)ingroundinsight.utils.impedance_calculator. What the old workaround cost, measured: for the common(0.25 + j*0.6)*lspelling it reported 718.54 V instead of 456.62 V andZ_G = 2.87 Ωinstead of1.82 Ω, and the error did not shrink with the frequency.- Transient simulation — the new
groundinsight.simulation.transientsub-module, with two solver paths behind one contract:gi.TransientStudy(network, fault_name)plusset_source_waveform,set_observation(buses=, branches=)andsolve(t_end, dt, solver=), returninggi.ResultTransient(time_s,epr_t,i_branch_t,source_t,to_polars()). Switching solver paths is a one-line change. solver="fft"— frequency-domain superposition of a user waveform.solver="state_space"— modified nodal analysis assembled asdx/dt = A·x + B·uand integrated withscipy.signal.lsim. Resolves the true ring-down that the FFT path cannot, and supports bus capacitance, automatic pi-section lumping of branch shunt capacitance, voltage sources (Norton reduction for a resistive loop, an explicit inductor state forL_src > 0) and Carson-style mutual coupling.- Lumped RLC parameterisation — optional
R_formula,L_formula,C_formulaonBusTypeandR_self_formula,L_self_formula,C_self_formula,R_mutual_formula,M_mutual_formulaonBranchType, evaluated into realDict[float, float]fields onBusandBranchby the newcompute_real_valuehelper. All default toNone, so the frequency-domain path and existing networks are unaffected; the duplication againstimpedance_formulais intentional so the stationary and transient parameterisations can be maintained independently. gi.waveforms—step,sinusoidal_with_dc_offsetanddamped_oscillationfactory functions returning vectorised time-domain callables, plus the plotting helpersgi.plot_epr_transientandgi.plot_branch_current_transient.- Thermal limit check for conductors (roadmap F1).
gi.check_conductor_limits(network, fault, t_k, *, kappa=/r_to_x=, n=, f=)compares every grounding branch's thermally equivalent short-time current against its adiabatic limit and returns a long-format Polars frame.I_th = I_rms·√(m + n)(IEC 60909-0) is applied to the superposed AC RMS shield current — linear superposition first, the non-linear factor on the aggregate — againstI_adm = k·S/√t_k(IEC 60949).BranchTypegainsconductor_material,cross_section_mm2,theta_initial_Candtheta_final_C; new helpersgi.iec60949_k,gi.iec60909_m,gi.kappa_from_r_to_xand the cataloggi.IEC60949_MATERIALS, verified against the publishedktables (Cu/XLPE 143, Cu/PVC 115, Al/XLPE 94). - Thermal limit check for nodes (roadmap F4). EN 50522 and IEC 61936-1
size the earthing conductor and the earth electrode for different
currents, and the solver did not expose the first of them at all — in the
verification network the two differ by a factor of 41.
gi.check_node_limits(...)assesses both per bus and reports every bus, leavingwithin_limit = Nonewhere theBusTypedeclares nothing.ResultBus.i_inj/i_inj_freqreport the source-only nodal injection — the current a lumped earthing conductor carries into the system — which is notResultBus.ia = u_EPR / Z_B, the share dissipated into the soil through the electrode.BusTypegains five fields per element (material,cross_section_mm2,theta_initial_C,theta_final_C,current_split).current_split ∈ (0, 1]is a declared factor, not a derived one: the split depends on geometry the nodal model does not carry.gi.final_temperature(material, covering)andgi.FINAL_TEMPERATURESname their source per entry and raise rather than return a plausible-looking number for an entry they cannot cite. - IEC 60909 short-circuit characteristics from a solved pandapower case
(roadmap F2/F3).
gi.read_shortcircuit_results(net_pp, ...)reads acalc_scresult as 60909 quantities in amperes,gi.apply_shortcircuit_characteristics(...)writes them onto the model and returns an audit frame including the previous values, andgi.resolve_fault_sc_characteristics(...)reduces several infeeds to one effectivekappa(current-weighted by default, reproducing the sum of the individual peaks to 1.6e-16;aggregation="max"for the conservative variant).Sourcegainsi_k_a,r_to_x,kappa,Faultgainst_k_s,n_factor— metadata that never enters the linear solve. Two deliberate deviations from pandapower, both pinned by tests:ip_kaandith_kaare derived here because pandapower returnsNaNfor the1phcase that matters for grounding, andI_this always recomputed because pandapower setsm = 0forkappa > 1.99where the analytic limit ism = 2, which under-estimates the thermal stress. TheR/Xdrivingkappais that of the earth-fault loop2·Z1 + Z0, notR1/X1. - Databases written by an older release are converted, not rejected.
gi.migrate_database(path)converts a file written by the name-keyed schema to the current one andgi.needs_migration(path)classifies a file without touching it;gi.start_dbsession()migrates automatically (migrate=Falserestores the previous behaviour, which now raises aRuntimeErrornaming the tool and your file). The original is copied to<path>.bakfirst and an existing backup is never overwritten; the conversion is written to a temporary sibling and moved in withos.replace, so an interruption leaves either the old file or the new one. Every converted network is loaded back before the swap, because a structurally valid file is not necessarily a usable one.gi.MigrationReportnames what could not be recovered — shared elements, paths whose segment order does not form a connected chain, orphans, dangling memberships, defaulted cells — instead of quietly guessing, and a missinglengthorscalingsaborts the migration rather than being invented. - The plotting helpers accept
ax=andclose=.ax=draws into an axis you already have, which is what makes a base case and an outage case comparable in one figure;close=Trueunregisters the figure the call created, so a parameter sweep no longer accumulates figures until matplotlib warns at twenty. Both are keyword-only and appended behind a*, so the historical positional signature is unaffected.
Changed¶
- Breaking: the SQLite schema keys elements per network. Buses,
branches, faults, sources and paths carry the composite primary key
(network_name, name); the fivenetwork_*association tables are gone, the relationships are ordinary one-to-many, andpath_segmentswas promoted to a mappedPathSegmentDBkeyed(network_name, path_name, position). Two networks in one file that both contained a bus called"A"previously shared a single row, so saving the second silently overwrote the first one's impedance. Element order now survives the round-trip — before, the load order was whatever SQLite returned, which reordered the Y-matrix assembly and changed the LU factorisation in the last bits; a save/load/re-solve is now bit-identical. - Breaking: a zero, a sub-invertible or a negative-real-part impedance
raises
ValueError.Z = 0was assembled as an open circuit — the exact opposite of the ideal earth it is written to mean — and an impedance too small to invert putinfon the diagonal andNaNin the result. The rule covers bus grounding impedances, branch self impedances wheregrounding_conductor=True, andSource.source_impedance, and it runs again immediately before the matrix is assembled. Deliberately out of scope: mutual impedances (Z_mutual = 0is the ordinary way to say "no coupling"), non-grounding branches, inactive elements, frequencies outsidenetwork.frequencies, andinf, which remains the documented open-end sentinel. Replace a deliberate0.0with a small finite value —1e-6 Ωis seven digits of the ideal limit in a 1 Ω network and, unlike0.0, actually behaves like one. - Breaking:
create_paths— and thereforerun_fault— rejects a network with no sources or no faults, which previously produced a complete, structurally valid all-zero result. The check is on the collections being empty, never on the resulting path count: an outage scenario that islands the fault bus still runs and still legitimately returns all zeros. - Breaking:
create_network_assistantvalidatesnumber_busesandbranch_length. A line ofnbuses hasn − 1branches; passingnlengths silently dropped the last one and passing too few raised a bareIndexError. A scalarbranch_length=1.0now gets a message instead ofTypeError: 'float' object is not subscriptable. - Breaking:
max_itermust be anint >= 1infind_max_rho_scalingandfind_max_rho_f_scaling.max_iter=60.0was never harmless — the loop condition rounds up, so2.7meant three steps, and a cap that does not mean what it says is worse than no cap. - Breaking: the plotting helpers reject two argument combinations and an
unusable
figsize.ax=withfigsize=andax=withclose=Trueboth raiseValueError, because the figure belongs to the caller in that case. Afigsizethat cannot be used raises instead of being swapped for the default: matplotlib acceptsfigsize=(0, 0)at creation and only fails when the figure is drawn, which pointed the traceback atsavefigrather than at the call responsible. - Final temperatures now have two regimes with one source each. The
catalogue previously mixed the National Grid Earthing Technical
Specification and IEC 60364-5-54 in one table. Uninsulated conductors
follow EN 50522 Table 2 — 300 °C for bare copper, aluminium, steel and
galvanised steel, 150 °C for tinned copper, whose tin coating melts at
231.9 °C. Insulated conductors are capped by their insulation, not by the
metal: IEC 60364-5-54 Table 54.2 gives 160 °C for PVC and 250 °C for
XLPE and EPR, for every conductor material, because the insulation fails
first.
IEC60949_MATERIALS["Steel"]["theta_final_default_C"]is lowered from 400 °C to 300 °C:θ_fenters the IEC 60949 material constantkunder a logarithm, so the old default produced a largerkand permitted more current — the unsafe direction for a limit check. Passtheta_final_C=400.0explicitly to reproduce earlier studies."PE"is deliberately not tabulated and raises, as do physically impossible pairings such as("Al", "tinned"). - A finite reactance at 0 Hz falls back to the real part, with a warning.
(0.25 + j·0.6)·lreports 0.6 Ω of reactance at every frequency, and at DC that is a statement about nothing — a reactance either vanishes or is infinite. The warning quotes the length-invariant X/R ratio rather than the two values, so Python's default filter collapses a hundred-branch network into one line, and it names the remedy: write the reactance asj*2*pi*f*Land it vanishes at DC by itself. The fallback is off for R/L/C parameters, which are real at every frequency by contract. Correspondingly,Z = 0and a non-invertible|Z|are accepted at 0 Hz and rejected above it — an inductance really is a short circuit at DC and really is not one at 50 Hz — while a negative real part stays rejected at every frequency, because a passive element is passive at DC too. find_max_rho_scalingandfind_max_rho_f_scalingreturn four new keys.statusis one of"converged","bracket_within_tol_on_entry","bracket_fully_admissible"or"max_iter_reached",convergedisTruefor the first two,c_bracketis the interval that provably contains the threshold, andbracket_rel_widthis its relative width. For a fully admissible bracket the interval is(c_hi, inf), which makes "widenc_bounds" machine-readable. Every previous key keeps its name and meaning, so code readingc_maxstill works — it now has a way to find out whether that number is a maximum.- An unsolvable nodal system is diagnosed instead of being reported as a
singular matrix. A
NaNinYor in the injection vector is now a computation error naming the buses and branches whose stored impedance isNaN, with self and mutual told apart, rather than reaching SciPy and coming back as "singular matrix" — which sends the engineer looking for a topology error. "No path to reference earth" lists which buses were examined and why each failed, grouped intoZ = 0, infinite,NaNand no value stored at that frequency, truncated after five names with the total reported. The wordSingularis kept at the front for callers matching on it.
Fixed¶
- Security: an impedance or RLC formula string was an arbitrary-code
execution vector, and
mkdocs.ymlloadedpolyfill.io, a domain that had changed hands and was serving malicious redirects. Both closed. - Formula evaluation. A formula that merely contained the letters
nan(nan_factor,tanh) became an open circuit. A parameter whose name collides with one of SymPy's ~680 exported names was shadowed, andparams={"I": ...}was silently overwritten with the imaginary unit. Every formula whose argument goes negative — the common√(1 − x)fit outside its range — collapsed toNaN, which was then passed on as if it were a number, intoComplexNumber, intoY, and out the far side as a result.compute_real_value(..., name=...)now actually reaches the caller, so twoBranchTypefields sharing an expression no longer produce two byte-identical messages. - Paths and topology. The path set went stale after a fault or a source
was added following the first
run_fault: the new element was never given paths, which madefind_max_rho_scalingover-estimate the admissible soil resistivity.run_faultnow rebuilds when the active topology changed, andNetwork.invalidate_paths()is an atomic rebind scoped to the calling network rather than a clear of the global cache. Two topology fingerprints collapsed parallel branches into one key, so two structurally different networks hashed alike.Network.define_pathsno longer shadows(source, fault)pairs that share a source. - Transient solvers. With
network.pathsempty or stale the state-space path dropped the entire Carson coupling silently, and a branch shared by two parallel paths of one source received the coupling twice. Branch currents from the state-space solver were inverted relative tocompute_branch_currentsand the FFT solver; both now followi_branch = (v_to − v_from) · Y_self, so the two traces sit on top of each other for the forced response. The source waveform is treated as the literal injection instead of being rescaled. - Persistence.
save_networkcommitted its delete-then-insert in two steps, so an interruption could leave a half-written network on disk, and it wrote raw type rows instead of merging them.Network.results,Fault.activeand open-endinfvalues now survive the JSON and SQLite round-trips. Inconsistent path segments are rejected before anything is written. - pandapower import.
calc_sc'stk_s=1.0signature default was read as the protection's actual clearing time. Threepl.DataFrame(...)sites relied on polars inferring a schema from the first row. A missing line length was silently replaced by 1.0 km — a fabricated length changes the earth potential rise with nothing in the output to show it was invented — and zero or negative lengths are now rejected. Duplicate line names no longer abort the import. - Results that looked like answers. A frequency that was never computed
was plotted as a bar of height zero, indistinguishable from a computed
zero. The relative delta of an outage study divided by the reference value
without guarding a zero reference.
check_conductor_limitsandcheck_node_limitsreported "no violations" on a result that was only half built, and an element carrying just one half of its thermal data was skipped without a word.str()onResultReductionFactorandResultGroundingImpedanceraisedAttributeError. An unresolvable bus or branch type surfaced as anAttributeErrorfrom deep inside the solver, and two documentedValueErrors were never raised at all. - The inverse-
ρsearches.iterations == 0meant three different things; exhaustingmax_iterwas silent;tol_relandmax_iterwere unvalidated; aNaNEPR limit passed the positivity guard becausenan <= 0isFalse; andc_bounds=(1e-3, inf)passed the ordering check. The shared checks and the report builder now live inanalysis/_bisection.pyso the two searches cannot drift apart. The routines also restore network state instead of leaving the scaling they last tried in place. - A single un-earthed tower no longer fails the whole network, and a
genuinely singular or floating network raises a clear
ValueErrornaming the cause instead of surfacing as a SciPy factorisation error. - Session and cache handling.
_set_sessionis the single source of truth for the module globals;start_dbsessionis hardened against a second call andclose_dbsessiontears down all three globals;set_log_levelis handler-idempotent across repeated calls; the pathfinder caches are bounded LRUs that no longer key onid(network);outage_contextclears them and is re-entrant.Network.frequenciesis validated at construction and warns on a non-monotonic order.gi.set_active_fault(network, fault_name, keep_results=False)is available at the top level, and__all__lists every public helper.
Docs¶
docs/concepts.mdgains "Direct current (f = 0)" — the three singularities and how they are told apart, the reactance fallback and how to write a formula that does not need it, what the short-circuit substitution costs and when to merge two buses instead — and "Which values a formula may produce" under Impedance formulas.docs/transient.mddocuments the state-space solver, the DC bin, the Carson-mutual substitution and the waveform contract.- New API pages for the transient sub-module and the analysis helpers;
docs/api/analysis.mdcarries the documented discrepancy between theIEC60949_MATERIALS["Steel"]default and EN 50522 Table 2. - The dead "Research notebooks" nav section was removed from
mkdocs.yml. mkdocs only collects files belowdocs_dir, so every../notebooks/*.ipynbentry was reported as unresolvable and silently dropped — the section never appeared on the site, and the build stayed green becausemkdocs gh-deployruns without--strict. Curated notebooks live indocs/examples/. mkdocs.ymlusesdocstring_style: numpy, matching the docstrings the project actually writes.
Internal¶
- The audit narrative moved out of this file into
docs/audit-log.md: fourteen passes, each finding with its reproduction, its negative control, and — where the change touched drawing or matrix-assembly code — a mutation-testing result. The open findings not yet scheduled are in the same document; the roadmap is at the end of this file. - The thermal assessment is opt-in and provably so. A grounding study is
useful long before anybody has decided on a cross-section, so an element
with no thermal data is reported with its current columns filled and
within_limit = Nonerather than being dropped or defaulted. The excitation is not optional: once a check is requested,t_kand the peak factor must be resolvable, and a half-declared element is a warning rather than a silent skip. - The release tooling's own preconditions are now tested rather than
assumed.
pyproject.toml,src/groundinsight/__init__.pyandCITATION.cffare checked against each other bytest_version_matches_pyprojectandtest_version_matches_citation_cff, which read the expectation from the project metadata instead of pinning a literal thatscripts/release.pyrewrites on every release commit.
0.4.0 — 2026-05-09¶
Added¶
- Thevenin (voltage) source mode for
Source— opt-in alternative to the legacy current-source injection, intended for transient simulations where the actual fault current is determined by the loop impedance rather than being prescribed. New fields onSource:source_type("current"default,"voltage"for Thevenin),voltage, andsource_impedance(bothDict[float, ComplexNumber]). Amodel_validatorenforces that exactly the fields belonging to the declared mode are populated, thatvoltageandsource_impedanceshare frequency keys, and that nosource_impedanceentry is zero. gi.create_voltage_source(name, bus, voltage, source_impedance, ...)— convenience factory that mirrorsgi.create_sourcebut constructs a Thevenin source and validates that the bus exists in the optional network argument.- Y-matrix loop closure for Thevenin sources —
ElectricalNetwork._construct_Y_matricesnow adds an admittanceY_src = 1/Z_srcbetween source bus and the active fault bus for every voltage-mode source. Together with the Norton-equivalent injectionI_N = scaling * U / Z_srcat the source bus and-I_Nat the fault bus this is the exact Norton-Thevenin translation of the legacy current-source formulation. Default behaviour is unchanged: a network without any voltage-mode source produces bit-identical results to0.3.x. - Notebook
notebooks/08_thevenin_source.ipynb— demonstrates that a Thevenin source with very largeZ_srcreproduces the current-source EPR, that a finiteZ_srcreduces the effective fault loop current below the open-circuit Norton value, and visualises the transition between the two limits via aZ_srcsweep.
Internal¶
-
Persistence:
SourceDBgainedsource_type,voltageandsource_impedancecolumns; the existingvaluescolumn became nullable.from_pydantic/to_pydanticroute the data through the new helpers_freq_dict_to_pydantic/_freq_dict_to_json. JSON and SQLite roundtrip tests cover both source modes. -
groundinsight.iosub-package — new home for external-network importers. First inhabitant: a pandapower importer. ImportDefaultsPydantic model (groundinsight.io.defaults) — shared shape for every importer:rho,frequencies,default_bus_type,default_branch_type. Future importers (PowerFactory.dgs, NEPLAN, PSS®E) reuse the same model so a singleImportDefaultsinstance can drive all of them.- Pandapower importer (
groundinsight.io.pandapower_import) with two entry points: from_pandapower(net, *, defaults, voltage_level_kV, network_name=None, include_trafos=False) -> Network— mapspp.busandpp.linerows on a single voltage level to groundinsightBusandBranchobjects, usingdefaults.default_bus_type/default_branch_typeandlength=length_km. Switches, ext_grids, sgens and loads are ignored;include_trafos=Trueis reserved for a future release. Pandapowerin_service=Falsepropagates to the newBus.active/Branch.activeflag so the imported network plugs straight into the outage / what-if layer.preview_pandapower_import(net, *, voltage_level_kV) -> pl.DataFrame— pre-flight summary listing kept and skipped elements with explicitreason(voltage_level_mismatch,endpoint_off_target_voltage_level,endpoint_bus_missing).- Public re-exports:
gi.ImportDefaults,gi.from_pandapower,gi.preview_pandapower_import. - Optional dependency: pandapower is now declared as an optional
extra. Install with
pip install 'groundinsight[pandapower]'(orpoetry install --extras pandapower); the core install stays lean. activeflag onBusandBranch— both Pydantic models now carry a booleanactivefield (defaultTrue). An inactiveBusis removed from the nodal system entirely; an inactiveBranchbehaves like an open circuit (no contribution to the admittance matrix, no Norton-equivalent injection from the mutual coupling, branch current in the result is zero). The pathfinder skips inactive elements when building the adjacency graph, sodefine_pathsno longer enumerates paths that cross them. Backwards compatible: existing JSON / SQLite payloads load withactive=Truefor every element.groundinsight.simulation.outage— new sub-module for what-if studies built on top of the newactiveflag. Exposes:Outage— Pydantic model describing a scenario (named, withdisabled_busesanddisabled_brancheslists).outage_context(network, outage)— context manager that flips the listed elements toactive=Falsefor the duration of awithblock and restores them afterwards (including the previous path cache).run_outage_study(network, fault=..., scenarios=[...])— runsrun_faultfor the base case (optional) and every scenario in one call and returns anOutageStudyResultaggregating per-scenariores_buses/res_branchesDataFrames.OutageStudyResult.compare_buses(...)/compare_branches(...)— long-format Polars DataFrames with absolute and relative deltas against a reference scenario (default: the base case). Same names are re-exported on the package:gi.Outage,gi.run_outage_study, …groundinsight.analysissub-package — new home for higher-level analysis routines on top ofrun_fault. First inhabitant: an inverse determination of the maximum admissible bus rho-f characteristic.find_max_rho_scaling(groundinsight.analysis.inverse_rho) — given an existing network, an active fault and a set of selected buses, log-bisects the largest uniform scaling factorcof those buses'specific_earth_resistancesuch that the RMS earth potential rise at the fault bus stays at or below a user-supplied limitu_max. Returnsc_max, the EPR atc_max, the per-busrho_max = c_max * rho_0, and the iteration count. Honours every user-definedBusType.impedance_formula, restores the originalrhovalues via afinallyblock (success or failure). Re-exported on the package asgi.find_max_rho_scaling.- rho-f model inversion (
groundinsight.analysis.inverse_rho_f) — foundation layer for inverting the canonical rho-f bus modelZ(rho, f) = k1*rho + (k2+jk3)*f + (k4+jk5)*rho*f(the same form fitted bygroundmeas.services.analytics.rho_f_model). Two public entry points, both re-exported on the package: evaluate_max_epr_under_k(network, bus_names, k, *, fault_scalings=None, run_fault_kwargs=None) -> Dict[str, float]— overwrites every selected bus' impedance with the rho-f form for the givenk = (k1..k5), sweeps each bus once as the active fault (reusing pre-existing faults at swept buses, otherwise creating temporary ones withfault_scalings), runsrun_faultand returns the per-bus RMS EPR. Restores bus impedances, drops temporary faults, and rebuilds the path cache in afinallyblock.find_max_rho_f_scaling(network, bus_names, u_limit, k_ref, *, c_bounds=(1e-3, 1e3), tol_rel=1e-3, max_iter=60, ...)— log-bisects the largest scaling factorcsuch thatk = c * k_refkeeps the maximum RMS EPR across the swept buses at or belowu_limit. Returnsc_max,k_max = c_max * k_ref, the achieved max EPR and the per-bus EPR breakdown atc_max.select_rho_f_from_catalog(network, bus_names, u_limit, candidates, *, fault_scalings=None, run_fault_kwargs=None, sort_by="max_epr_asc")— evaluates every entry of a curated catalog{name: (k1..k5)}and returns a Polars DataFrame with columnsname,k1..k5,max_epr_rms_V,admissible(bool) and oneepr_<bus>_Vper swept bus. Default sort puts admissible candidates first, ordered by ascending EPR margin. Useful for picking the feasible soil/curve from a hand-curated list (e.g.groundmeasfits per soil class). A full Pareto front in ℝ⁵ remains a roadmap item and will land as a separatefind_max_rho_f_pareto_fronton top of the same helper.notebooks/07_inverse_rho_f.ipynb— step-by-step demonstration of the three rho-f inversion entry points on a small three-bus MV line with frequency-dependent excitation.
Changed¶
BusDB/BranchDBschema gains aactive BOOLEAN NOT NULL DEFAULT 1column to mirror the new Pydantic field.from_pydantic/to_pydanticround-trip the value; existing SQLite databases that predate this change still load (the column defaults toTrue).- Pathfinder graph and solver assembly filter inactive elements
(see Added). The behaviour is unchanged whenever every bus and
branch keeps the default
active=True.
0.3.2 — 2026-05-07¶
Added¶
groundinsight.set_log_level(level)helper — convenience entry point for interactive use. Attaches a singleStreamHandlerwith a simple formatter to the package logger and sets the requested level. Idempotent: repeated calls only adjust the level. Default behaviour of the library is unchanged (aNullHandleris attached on import, no output without explicit configuration).
Changed¶
- Minimum Python version raised to 3.14.
pyproject.tomlnow declarespython = "^3.14"; the CI matrix runs only against 3.14 and the docs / release workflows pin the same version. This aligns the dissertation tool family (groundinsight,groundmeas,groundfield) on a single supported interpreter. Breaking for users still on 3.12 / 3.13 — pin togroundinsight<0.3.2if you cannot upgrade your Python yet. - User-facing messages migrated from
print()to the standardloggingmodule. Every call previously printing status, warnings or solver errors in__init__.py,network_operations.py,electrical_network.pyandmodels/core_models.pynow goes through a per-modulelogging.getLogger(__name__). Level mapping: INFOfor status (database session started/closed).WARNINGfor recoverable issues that the user should notice (already-started/no-session-to-close, overwriting an existingBus/Branch/Fault/Source, missing results when aggregating, parallel-coefficient guidance inbuild_electrical_network).ERROR(withexc_info=True) fornumpy.linalg.LinAlgErrorraised while solving the nodal equation per frequency.
Callers can silence everything by doing nothing (the default), enable
console output with groundinsight.set_log_level("INFO"), or wire the
package logger into their own logging configuration. Doctests
continue to use plain print(...) as before — they are not library
output.
0.3.1 — 2026-05-06¶
Changed¶
- Impedance evaluation is now cached and vectorised.
utils.impedance_calculator.compute_impedanceno longer callssympy.sympifyandsympy.lambdifyon every invocation. Compiled functions are memoised with anlru_cachekeyed on the formula string and parameter signature, so all buses sharing aBusType(and all branches sharing aBranchType) reuse the same compiled callable. Evaluation across all frequencies happens in a single vectorised numpy call instead of a Python loop. The public API ofcompute_impedanceis unchanged. Expected speed-up for the impedance-build phase ofrun_fault: roughly one to two orders of magnitude on networks with many buses/branches per type.
Internal¶
- Added
_compile_formula(formula_str, param_names)helper inutils/impedance_calculator.pyexposing the cached compilation step, plus aclear_formula_cache()function for tests and long-running processes that want to release compiled SymPy callables. - (existing)
_compile_formula(...)+clear_formula_cache()… - Topology test bench extended in
tests/test_topology_and_reduction.pywith two frequency-sweep cases (single cable, 20-bus symmetric ring with the fault diametrically opposite to the source). Both assert the closed formr(f) = R / sqrt(R² + (ωL)²)and convergence to 0 for rising frequency. New helper_ms_cable_branch_type_freq_dependentderives constantL_self = M ≈ 1.910 mH/kmfrom the existing 50 Hz reference values.
Docs¶
notebooks/02_topologies.ipynbextended with two new sections: a 20-bus symmetric ring (EPR profile assertions: maximum at the fault, mirror symmetry, source-side rise) and a frequency sweep showing the reduction factor decaying from ~0.385 at 50 Hz to ~0.004 at 5 kHz, with a side-by-side comparison against the closed-form analytical curve.
0.3.0 — 2026-04-23¶
Bug fix for mutual coupling in meshed topologies, new automatic parallel-path distribution, first MkDocs documentation site, and a complete CI/release pipeline.
Added¶
run_fault(..., auto_parallel_coefficients=True)runs a phase-only pre-solve to derive the per-path current share for ring and mesh topologies, instead of requiring hand-tunedparallel_coefficientvalues on each branch.- Reference test suite
(
tests/test_topology_and_reduction.py) covering reduction factor on line, ring and mixed line/ring topologies. - MkDocs Material documentation site with Installation, Quickstart,
Concepts, Examples (three notebooks) and an
mkdocstrings-driven API reference. Published automatically to https://ce1ectric.github.io/groundinsight/. CITATION.cfffor scientific citation metadata.scripts/release.py— Poetry-invoked release script (poetry run release {patch|minor|major|set X.Y.Z}) that bumps the version inpyproject.toml,src/groundinsight/__init__.pyandCITATION.cff, commits, tags and pushes.scripts/generate_third_party_licenses.py— regenerates the third-party license report on release.- GitHub Actions workflows:
ci.yml— pytest matrix on Python 3.12 and 3.13, coverage report.docs.yml—mkdocs gh-deployon push tomain.release.yml— build → publish to PyPI via OIDC Trusted Publishing → create GitHub Release with auto-generated notes, on tagv*.
Changed¶
README.mdrewritten: new badges, feature list including ring/mesh support, quickstart, model overview with math, mermaid workflow diagram, link to the docs site..gitignoreextended to cover AI-assistant context (CLAUDE.md,.claude/), regenerated notebook and test artefacts (notebooks/grounding.db,notebooks/network.json,tests/test_grounding.db) and the third-party license report.
Fixed¶
- Mutual-coupling direction in meshed topologies: the Norton equivalent current injected along the path from source to fault now uses the path-derived direction (Variant A) instead of an index-based heuristic. The old behaviour produced wrong EPR and reduction factors on rings and meshes.
- Math rendering in the Jupyter notebooks on the docs site: replaced
the Markdown-ambiguous
*with\cdotinside the$...$blocks of the low-voltage example, somkdocs-jupyter's Markdown parser no longer eats the multiplication signs as emphasis markers.
Internal¶
- Added MathJax 3 configuration (
docs/javascripts/mathjax.js) supporting both\(...\)/\[...\](arithmatex) and$...$/$$...$$(notebooks) delimiters, with re-typesetting on Material's instant-loading navigation. - Consistency checks in the Y-matrix assembly
(
_construct_Y_matrices) to catch dimension and symmetry bugs earlier. utils/impedance_calculator.pyhardened against missing symbols and case-insensitivenanstrings (open-ended branches).
0.2.0 — 2024-12-07¶
First PyPI release with the full object model and solver.
Added¶
- Public API:
create_network,create_bus,create_branch,create_source,create_fault,run_fault. - Pydantic v2 data model:
Bus,Branch,Fault,Source,Network,BusType,BranchType,Path,Result*,ComplexNumber. - Electrical network solver: nodal-admittance assembly per frequency,
SciPy sparse LU (
splu), mutual-coupling Norton equivalents, reduction factor and grounding impedance computation. - DFS-based path finder between source and fault buses.
- SQLite persistence via SQLAlchemy (
save_/load_network) and JSON import/export via Pydantic. - Polars-DataFrame accessors
res_buses,res_branches,res_all_impedances. - Matplotlib helpers for EPR, branch-current and bus-current bar plots.
- Three example notebooks:
simple,CIRED,low_voltage_network.
0.1.2 — 2024-12-05¶
Development release. See the git history for details.
0.1.1 — 2024-12-01¶
Development release. See the git history for details.
0.1.0 — 2024-12-01¶
Initial development release. Not installable via PyPI in the current form — superseded by 0.2.0.
Roadmap¶
Feature ideas and scheduled work. Graduate an item from here into the
appropriate category of [Unreleased] once it is implemented and ready
for release.
Scope boundary¶
groundinsight is a reduced-model solver for networked grounding
systems: nodal admittance assembly in the frequency domain, driven by
formula-based or tabulated impedance values. PDE/FEM field computation
is an explicit non-goal — it belongs in a companion package
groundfield that depends on groundinsight and produces reduced
models (impedance tables, multi-port Z matrices, Network objects)
which groundinsight consumes. The roadmap below is organised around
that split: the "bridge" items below define the data-exchange surface
between the two packages.
Near term — bridge to groundfield¶
These items define the data-exchange surface between field-level
computations in groundfield and circuit-level solves in
groundinsight. The first work package (AP 1) of the dissertation
drives the priority.
- Two-layer
SoilModel— dedicated Pydantic model withrho_1,rho_2andh_12fields, recognised as symbols by the formula evaluator (rho1,rho2,hinutils/impedance_calculator.pyandutils/validations.py). Backwards compatible: single-layer behaviour when onlyrhois given. Shared type withgroundfield. ImpedanceTableas an alternative to formula strings — acceptDict[Tuple[rho, f], ComplexNumber]or a user callback onBusType/BranchTypealongside the existing SymPy formula path. Primary use case: ingest FEM-computed impedances fromgroundfieldwithout pressing them into a closed-form formula.- Multi-port impedance matrix export (
Z_ON) — functionNetwork.impedance_matrix(f)returning the full multi-port Z matrix of the grounding subsystem for a chosen set of terminal buses. This is the return channel: a field solution ingroundfieldcan be reduced to a multi-port representation thatgroundinsightproduces or consumes through the same interface. - Parametric TN-Ortsnetz builder (new module
src/groundinsight/simulation/tn_builder.py) — constructs aNetworkfrom structural parameters (number of family houses, small / medium commercial connections, cable-distributor quota, topology class). Directly supports the AP 1 parameter grid (5 / 10 / 30 / 80 / 200 × …). - Parameter-sweep runner (
src/groundinsight/simulation/sweep.py) — sweeps overrho, soil-layer thickness, network size, fault location and frequency; returns a long-format Polars DataFrame. Matches the AP 1 investigation programme. - Touch-voltage result type —
ResultTouchVoltageplusNetwork.res_touch_voltages(). Initial implementation uses a simple analytical surface-potential model in layered earth; higher-fidelity surface potentials come fromgroundfieldviaImpedanceTable.
Near term — external network import¶
Building grounding networks by hand is the single most time-consuming
step in any case study. Re-using existing distribution-network models
from established power-system tools eliminates that work and makes
groundinsight directly applicable to real network data. The two
priority importers below cover the dominant tools in the German
distribution-network space.
pandapowerimporter — new modulesrc/groundinsight/io/pandapower_import.pyexposingfrom_pandapower(net, *, defaults: ImportDefaults) -> Network. Maps pandapowerbus,line,trafo(and optionallyswitch,ext_grid) tables togroundinsightBusandBranchobjects. Required user-supplied defaults:rho,frequencies, defaultBusTypeandBranchType(impedance formulas), plus a per-std_typeoverride map for cable shields / overhead PEN conductors. Length is taken fromline.length_km; transformer branches default to a configurable star-point impedance formula. Round-trip example notebook undernotebooks/import_pandapower.ipynb. Shipped —gi.from_pandapower,gi.ImportDefaults,gi.preview_pandapower_import. The PowerFactory paths below are still open.- PowerFactory importer — new module
src/groundinsight/io/powerfactory_import.pywith two ingestion paths: .dgsexport (preferred, no PowerFactory installation needed) —from_powerfactory_dgs(path, *, defaults)parses the PowerFactory data-grid CSV/XML export and emits aNetwork.- Live PowerFactory Python API —
from_powerfactory(app, *, defaults)for users runninggroundinsightnext to a PowerFactory session (powerfactory.GetApplication()); kept behind a soft import so the dependency stays optional. Both paths share the sameImportDefaultsschema as the pandapower importer. ImportDefaultsPydantic model — common schema for all importers:rho,frequencies, defaultBusType/BranchTypereferences, per-element-type overrides, and a hook for user-supplied resolver callbacks (resolve_bus_type(row) -> BusType). Lives insrc/groundinsight/io/__init__.pyso future importers (DIgSILENT NEPLAN, PSS®E raw files) reuse it.- CLI / notebook helper —
groundinsight.io.preview_import(net, defaults)returns a Polars DataFrame summarising which buses and branches will be created and which elements were skipped (with reason), so users can validate the mapping before committing to a full network build. Shipped asgi.preview_pandapower_import.
Near term — other¶
- Codecov / Coveralls integration — upload coverage from CI and show a PR diff badge; currently the XML report is only uploaded as a workflow artifact.
CITATION.cffvalidation in CI —cff-validatorstep to catch broken metadata before a release is cut.- Release-notes template — the GitHub Release body is currently
auto-generated from PR titles, which reads rough. Either a manual
release_notes/vX.Y.Z.mdworkflow or arelease-drafterconfig would give cleaner user-facing notes. (Partially addressed by the newCHANGELOG.mdflow.)
Medium term¶
MeasurementScenarioabstraction — model the earthing measurement (auxiliary electrode at distanced, measurement-loop source) as a first-class object instead of an ad-hocFault. Lets the AP 1 reference-case studies (variation of auxiliary-electrode position) be expressed without notebook scaffolding. Add a measurement setup with current injection into the power system to the neighbour bus. Add a comparing function of real earthfault to, measurement with auxiliary electrode and current injection to the neighbour substation, to understand systematic errors.- Optional bus geometry (
position_xy) — no hard dependency, but enables Carson distance calculations and map-style visualisations. Must stay optional so existing networks keep working. - Plot refactor: the matplotlib helpers are one-shot bar plots. Extract an optional Plotly backend so results can be explored interactively in notebooks and embedded in the docs site.
- REST/HTTP API surface — the empty
src/groundinsight/api/package was reserved for this. Likely FastAPI-based, exposingrun_faultand theres_*accessors. Decide scope (thin RPC vs. job-oriented) before writing code. - Performance: parallelise the per-frequency solve in
ElectricalNetwork.solve_networkwithconcurrent.futures(threads are enough — the work is in SciPy's native sparse LU, which releases the GIL). Roadmap item in the README.
Long term¶
- Kron reduction / multi-port model reduction — eliminate
internal buses and emit a reduced-port Z (or Y) matrix. This is the
groundinsight-side counterpart of the dissertation's AP 2: once a large reference network exists, reduce it to a transferable model class. - Time-domain extension — convert frequency-domain results into
transient EPR / branch-current waveforms via inverse FFT, given a
user-supplied fault-current time function. Needs design work on how
to spec the input and what assumptions (linearity, bandwidth) to
guard.
Shipped —
gi.TransientStudywithsolver="fft"for exactly this, andsolver="state_space"beyond it. - Typed impedance DSL — replace SymPy formula strings with a small typed expression tree so units and argument domains can be checked at construction time. Would also let the docs site render a formula catalogue automatically.
- Grey-box measurement identification — given a measurement
data set (e.g. from
groundmeas), estimate bus grounding impedances and coupling parameters. Likely lives in a dedicated identification package or ingroundmeasitself; the hook on thegroundinsightside is theImpedanceTableinterface listed under thegroundfieldbridge.
From the audit passes (2026-05 – 2026-07)¶
Open items raised by the audit passes, de-duplicated across passes.
Items the passes proposed and that have since shipped are not repeated
here — they are in [Unreleased] or in an earlier version section. The
verbatim per-pass roadmap blocks are preserved in
docs/audit-log.md, Part 4.
Safety assessment — the missing half of a grounding study. 0.5.0 added the equipment-integrity side (thermal limits for conductors and nodes); person safety is still unassessed.
Network.res_touch_voltages()andResultTouchVoltage, then a thinassess_touch_voltage(t_clearing_ms, standard="EN50522"|"IEEE80")returning the admissible limit and a pass/fail flag per bus. Initial implementation from a simple analytical surface-potential model in layered earth; higher-fidelity surface potentials come fromgroundfieldthroughImpedanceTable. This is the single most useful safety-engineering deliverable on top of the present steady-state solver.- Mechanical (electrodynamic) limits —
F ∝ i_p²between parallel conductors, the deliberate second step after the thermal check. Needs conductor geometry (spacing, support distance), which the nodal model does not carry today.
Modelling.
- PEN-conductor-aware
BranchType—BranchTypedistinguishes onlygrounding_conductor: bool. In a TN-Ortsnetz the PEN sits in parallel with the cable shield and the soil; modelling it explicitly (pen_impedance_formula) gives a cleaner reduction-factor split for low-voltage networks. Directly relevant to AP 1 of the dissertation. Network.frequenciesas atuple[float, ...]— a tuple plus the existing validator makes the network hashable, which is what the pathfinder cache key wants; it currently keys on a network fingerprint becauseList[float]is unhashable.gi.PathfinderConfig(cache_scope="per_network"|"global"|"none")— make the cache-scope decision explicit rather than a property of the module-level dictionaries.
Convenience factories — each of these removes notebook boilerplate that the example notebooks currently carry by hand.
Source.from_waveform(waveform, frequencies)— do the FFT once for a Thevenin source instead of forcing the user to assemble a per-frequencyvoltagedict.gi.waveforms.from_array(t_samples, values)— wrap a measured fault-current trace (e.g. from a digital fault recorder) into theCallable[[np.ndarray], np.ndarray]contract vianp.interp.gi.TransientStudy.from_steady_state(network, fault_name)— pre-populate a transient study from the most recentrun_faultresult on the same network, copying fault scalings and the observation set.gi.from_pandapower_multi_voltage(net, defaults_map)— take aDict[float, ImportDefaults]and produce oneNetworkper voltage level (or one combined network once transformer branches land). Closes the gap to the AP 1 case studies that span 110 / 20 / 0.4 kV.
Diagnostics.
Network.verify_steady_state_match(transient_result)— promote the manual cross-check intest_state_space_matches_fft_on_lti_networkto a public diagnostic, so a user can validate a new transient setup against the per-frequency phasor solve.gi.diagnose(network)— one-call health check: stalenetwork.paths, duplicate frequencies, missing impedance formulas, untyped branches, the inverse-ρbus mismatch. Useful before eachrun_faultin a long notebook.
Performance.
- Parallel per-frequency solve — a
ThreadPoolExecutorover the frequency loop insolve_network. SciPy'ssplureleases the GIL, so a near-linear speed-up is realistic for a harmonic study over 10–30 frequencies. Low effort, high payoff. (Also listed under Medium term.)
Cross-repo toolchain (groundfield field solver, groundinsight
reduced network, groundmeas measurement store).
- ADR for the
show_versionsreturn shape —gi.show_versions()shipped in 0.5.0, but the key set must be pinned acrossgf.show_versions()and the plannedgm-cli doctorbefore the other two implement it, so one dashboard or CI pipeline can consume all three. Tie toADR-0013ingroundfield. gi.cross_reponamespace anddocs/cross-repo.md— one page naming the three packages and their data-flow contracts (ρ(f)fit handoff,multilayer_soil_modelbridge, plannedMeasurement → ImpedanceTableexporter), which currently live in three separateCLAUDE.mdfiles. Blocked onADR-0013.gi.audit_apply(report_path)— read a Markdown audit report and insert its bullets into the matching section of[Unreleased]. Seventeen passes of hand-merging is the argument for it; thedocs/audit-log.mdsplit in 0.5.0 is the argument against, since the destination is no longer a single file.gi.docs.assert_api_pages_exist— walk__all__and assert every public symbol has at least one mkdocstrings:::directive underdocs/api/. Companion to themkdocs build --strictcheck.gi.connectors.dashboard_state— a serialisable state object so a future dashboard can resume a notebook session.docs/api/database.mdsub-section forgi.show_versions()— the helper is in__all__but has no rendered docs page entry.
From the 2026-09-08 review (audit pass 18)¶
Implemented by the pass-18 series that is recorded under Security,
Fixed, Changed, Added and Docs of [Unreleased]. What the series
deliberately left open is carried forward into the 2026-11-07 work packages
below:
- the two follow-up de-duplications the integration exposed — one
reachability search instead of
transient._sources_reaching_faultnext toNetwork.sources_reaching, one passivity mask instead of two (→ WP 6); - the residual JSON risk of plain float fields outside
ComplexNumberthat are not covered by the RFC-8259-safe encoding (→ WP 5, project file); - a fresh
poetry lockafter the Python floor change (→ WP 4); - the nine documentation chapters and the Diátaxis navigation (→ WP 9).
From the 2026-11-07 review (audit pass 19)¶
Implemented in this release and recorded under [Unreleased]: work packages
0–10 of the review -- the pass-18 series, no silent wrong result, the
EN 50522 quantities, the transient phase split, the sparse kernel and the
study sessions, supply chain and CI, the API and service-layer
prerequisites, the architecture steps, standards and lint gates, calendar
versioning, the documentation, and phase 0 of the graphical interface.
Carried forward:
Model fidelity.
- Thévenin sources with the loop current as an unknown of a bordered
system; until then
THEVENIN_COUPLINGwarns. - A fully coupled
phase_current_mode="coupled"(2×2 branch blocks, twice the nodes, still sparse) that removes the one-way-coupling approximation and the phase proxy together;ImportDefaults.derive_phase_impedancethen derivesZ_red = Z_pp − Z_m²/Z_sinstead ofR₁ + jX₁. - Eight further reference cases through
run_fault: uniform and asymmetric ring split, long feeder against the ladder limit, Thévenin single line, superposition of two sources, resistive DC chain, the ladder cases through the solver, a coupled uniform ring. - Phase-conductor dynamics as states of the state-space transient (the split
taken from the fundamental leaves about 1 % in rings of mixed
construction,
TRANSIENT_PHASE_SPLIT), and an FFT path that couples per spectral line.
Scale.
- Array-backed result objects (P5c): they now dominate a large run (0.2–0.3 s of 0.53 s on a 4000-bus ring) and a sweep step (45–58 %).
- A solve session for
run_sweeponce the result objects are cheap (a bit-identical prototype saved 11–24 % per point). - Vectorised formula evaluation in the network build, provided it stays
bit-identical to the per-element evaluation that
input_digestrelies on.
API and naming.
- The
bus_responseframes still call the driving-point impedanceZ_G_Ohm; rename it toZ_E_Ohmwith a deprecation period, asres_faultnames it. - The frequency rules exist a second time in
io/defaults.py.
Graphical interface.
- Phase 1: adding and pasting elements, a network graph, a session that
survives a page reload, the remaining studies (
find_max_rho_f_scaling,TransientStudy) as jobs, packaging with signed Windows and notarised macOS builds. - The server variant (FastAPI with its own front end, single sign-on for
the internal deployment, a public demo) on the REST-ready DTOs of
groundinsight.api. - Report upstream: with NiceGUI 4.0 and AG Grid 36 the browser drops
rowClickedevents (circular context); the GUI works around it.
Repository and CI.
- Register the
lintjob as a required status check so that it blocks merges. - Strict warning filters for the GUI test suite as in the library suite, and
the remaining local
simplefilter("ignore")blocks of the tests (68 in 22 modules) asserted or acknowledged by name.
Explicit non-goals¶
- PDE / FEM field computation. The 3-D field solve (potential
function φ(x, y, z, f), surface potentials, current distribution
in the soil) is out of scope for
groundinsight. It will live in a dedicated companion packagegroundfield, developed separately, with a one-way dependency ongroundinsightfor shared data types (SoilModel,ComplexNumber,Network). The bridge in both directions is theImpedanceTable/Network.impedance_matrixsurface listed under Near term — bridge togroundfield. - Mesh generation and 3-D visualisation (gmsh, meshio, pyvista,
VTK). Same reasoning — these belong in
groundfield, not here, because they pull in heavy native dependencies that the reduced-model user ofgroundinsightshould not be forced to install.