steam-tfm
Transfer Function Model (TFM) of superconducting magnets, part of the STEAM framework at CERN.
Given a built LEDET magnet model, the TFM computes the magnet's passive coupling effects and writes an
equivalent frequency-dependent circuit library (.lib) that a circuit simulator (PSPICE / XYCE) can use
in place of a plain inductor:
- persistent currents (PC)
- inter-filament coupling currents (IFCC)
- inter-strand coupling currents (ISCC)
- eddy currents (ED)
- coupling with the passive structures: wedges, cold bore (CB), cold pipe support (CPS), aluminium ring (AlRing) and beam screen (BS)
- inter-turn shorts and capacitance to ground
This package was extracted from steam_sdk (steam_sdk.builders.BuilderTFM and
steam_sdk.data.DataTFM) so the model, its tests and its release cycle stand on their own, the same way
steam-roxie-parser was split out earlier.
Installation
pip install steam-tfm
For development, install the pinned environment first (the pins are kept in lock-step with
steam_sdk/requirements.txt so both packages coexist in one environment):
pip install -r requirements.txt
pip install -e .[test]
Usage
The model takes plain data, not a steam_sdk object. steam_sdk supplies it through
steam_sdk.builders.adapter_TFM.ledet_to_tfm_input(builder_ledet):
from steam_tfm.builders.builder_tfm import BuilderTFM
builder_tfm = BuilderTFM(
ledet_input=ledet_input, # steam_tfm.data.tfm_input.TFM_LEDET_Input
TFM_inputs=tfm_inputs, # TFMClass: flags, temperature, B_nom_center, ...
magnet_data=magnet_data, # Magnet_TFM: apertures, C_ground, passive structures, ...
local_library_path=library_path, # magnet folder holding TFM_input/Field_Map_*.csv
output_path=output_path, # where the .lib is written
library_name='MBRD_TFM', # name of the generated .lib subcircuit
domain='frequency', # or 'transient'
flag_build=True,
)
Layout:
| module | contents |
|---|---|
steam_tfm.builders.builder_tfm |
BuilderTFM, the model itself |
steam_tfm.data.data_tfm |
TFM dataclasses (General, Turns, HalfTurns, Strands, the effect classes) and the LEDET→TFM lookup tables |
steam_tfm.data.data_tfm_circuit |
circuit-side models: TFMClass, Magnet_TFM, TFM_Couplings, Component |
steam_tfm.data.tfm_input |
TFM_LEDET_Input, the input contract |
steam_tfm.parsers.tfm_library_writer |
writes the .lib |
Tests
The suite is written with unittest.TestCase and runs with
unittest-parallel (not pytest):
python -m unittest discover -s tests -p "test_*.py" -t .
# or in parallel (module level, about half the cores: every worker re-imports numba/sympy/scipy)
python -m unittest_parallel -t . -s tests -p "test_*.py" --level=module -j 4
The tests build BuilderTFM from a snapshot fixture (tests/input/MBRD_tfm_input.pkl) rather than from a
steam_sdk model build, so they need neither steam_sdk nor a magnet library. Regenerate the fixture
with python scripts/make_tfm_fixture.py [path-to-steam_sdk] after changing the input contract.
Tests that evaluate the coupling effects additionally read the per-magnet TFM field maps
(TFM_input/Field_Map_*.csv, several GB) from the steam_models library, which is too large to vendor
here. They locate it via STEAM_MODELS_PATH, a tests/input_from_steam_models submodule, a sibling
steam_models checkout or a sibling steam_sdk checkout, and skip themselves when none is present.
License
GPL-3.0-only. Contact: steam-team@cern.ch
Metadata
Release files for steam-tfm 2026.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| steam_tfm-2026.7.0.tar.gz | 84.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| steam_tfm-2026.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 159.3 kB
Release files / steam_tfm-2026.7.0.tar.gz
| Download URL | steam_tfm-2026.7.0.tar.gz |
|---|---|
| Size | 84.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3c626837dda1503a439478028a55350a5aba907d854f73c51b8becc55d9e8ec
|
|
BLAKE2b-256 checksum How to use checksums |
b08067edbf0394f35c550d2ce72dfaaeee9b5ff0edb9c79b2895037c0eb2c9c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.8
|
Release files / steam_tfm-2026.7.0-py3-none-any.whl
| Download URL | steam_tfm-2026.7.0-py3-none-any.whl |
|---|---|
| Size | 75.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b5f734087a8e392254ebee79ca3c496041588ea5a6a0f5c8c0a3d2ea85960474
|
|
BLAKE2b-256 checksum How to use checksums |
d91a5b5fbd9417646c0a938ab053bab38d0bc22301787dccbc2833fdb8930d18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.8
|
Security for steam-tfm 2026.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.