Skip to content

API reference

This part of the reference documents every public class, function, constant and type of groundfield, generated from the docstrings with mkdocstrings. Use the map below to find the page of a name. Every physical parameter is documented with its unit; the conventions shared by all modules are collected in Units and conventions. How the pieces fit together is explained in Concepts and shown in the tutorials.

Map of the pages

Page Module What is there
Factories groundfield.api the create_* functions and run_simulation, with the literal types of their arguments
World groundfield.world World, the container of soil, electrodes, junctions, conductors and sources
Soil groundfield.soil homogeneous, two-layer and multi-layer soil; effective_resistivity, penetration_depth
Geometry groundfield.geometry the seven electrode kinds, Junction, the wire segments, the concrete-shell coefficients
Conductors groundfield.conductors Conductor (PEN, cable screen, lead), skin effect, wire-proximity checks
Sources groundfield.sources CurrentSource, VoltageSource and the Source union
Boundary groundfield.boundary BoundaryConditions: remote earth, insulating surface
Solver groundfield.solver Engine, FieldResult, mutual-impedance matrices, the backend solve functions, the solver warnings
Backend registry groundfield.solver.registry available_backends, register_backend, capabilities, backend options
Coupling groundfield.coupling Neumann inductance, Carson and Sommerfeld earth return, two-layer Green's function
Postprocess groundfield.postprocess touch and step voltage, current sharing, sweeps, rho-f fits, plots
Diagnostics groundfield.diagnostics diagnose and the pre-solve checks, problem-size limits
Validation groundfield.validation compare_engines: one world, several engines, one table
Result files groundfield.io.results save_result, load_result, world_fingerprint
IO and groundinsight groundfield.io BusType export to groundinsight, CSV with provenance, VTK
Geo / OSM groundfield.geo OpenStreetMap building footprints, the local projection
Generators groundfield.generators TN low-voltage networks, distributions, specs, measurement set-ups
References groundfield.references closed forms of Dwight, IEEE 80, Oeding, Carson and Pollaczek
Utilities groundfield.utils logging, name suggestions, deprecation and inert-setting warnings

Every warning category and exception is documented on the page of the module that defines it; Warnings and errors explains what to do when one appears.

Top-level namespace

import groundfield as gf loads the data model, the factories and the engine. Everything else is imported on first use, so the import stays light (no pandas, matplotlib or most of scipy until a function needs them). Every name of groundfield.__all__ is available under its flat name (gf.touch_voltage) and is the same object as the one of its home module (groundfield.postprocess.safety.touch_voltage), documented once, on the page of that module. The post-processing API is also grouped in curated namespaces:

Namespace Content Page
gf.plot potential maps and profiles, world geometry, current sharing, sweeps, convergence Postprocess
gf.safety touch and step voltage, touch points (touch_voltage_at_part), EN 50522 permissible touch voltage Postprocess
gf.fit rho-f models: vector fitting and the research standard form Postprocess
gf.io BusType export to groundinsight, CSV, VTK, result files IO, Result files
import groundfield as gf
from groundfield.references import dwight1936

world = gf.create_world(soil=gf.HomogeneousSoil(rho=100.0))
gf.create_electrode(world, "rod", name="g1", position=(0.0, 0.0, 0.0), length=3.0)
gf.create_source(world, attached_to="g1", magnitude=1.0)
result = gf.create_engine(frequencies=[50.0]).solve(world)

Z = result.input_impedance()[0]                      # 35.99 Ω
R_dwight = dwight1936.rod(rho=100.0, length=3.0, radius=0.005)
assert abs(Z.real - R_dwight) / R_dwight < 1e-3      # Dwight (1936): 35.99 Ω
assert gf.safety.touch_voltage is gf.touch_voltage   # same function, two names

What counts as public

The public API is the __all__ list of groundfield and of every module whose dotted path has no part that starts with an underscore. tests/test_docs_api_coverage.py checks that each of these names is rendered on one of the pages above and has a docstring summary, that every public function documents its parameters and its return value, and that every public method has a docstring. Modules with a leading underscore (groundfield.solver._kernels, …) are internal and are not documented here.

Package version

__version__ module-attribute

__version__ = '2026.11.0'

Version of the installed package (calendar versioning since 2026.11, ADR-0013).