Importing from emachines.mec gives access to all public symbols without needing to know which submodule they live in.
Usage
from emachines.mec import*# or selectively:from emachines.mec import PermeabilityModelfrom emachines.mec import BranchTypefrom emachines.mec import MECSolution
Test: public API works from the installed package
Builds and solves a one-mesh air-gap circuit using only emachines.mec, so nothing defined inside the notebooks leaks in. Checks the flux against the analytic value \(\Phi = F \mu_0 A / l\).
import mathimport emachines.mec as mec_pkgF, l, A =100.0, 0.001, 0.01# A-turns, m, m^2m = mec_pkg.MEC()mesh = m.add_mesh_branch(mmf=F)gap = m.add_reluctance_branch(length=l, area=A, model=mec_pkg.LinearPermeabilityModel(mu_r=1.0), meshes=[mesh], orientations=[1])sol = m.solve()phi_exact = F *4e-7* math.pi * A / lassert sol.convergedassert math.isclose(sol.flux(gap), phi_exact, rel_tol=1e-9), (sol.flux(gap), phi_exact)print(f"✓ MEC via package: flux = {sol.flux(gap):.6e} Wb (exact {phi_exact:.6e} Wb)")