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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file steam_tfm-2026.7.0.tar.gz.
File metadata
- Download URL: steam_tfm-2026.7.0.tar.gz
- Upload date:
- Size: 84.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3c626837dda1503a439478028a55350a5aba907d854f73c51b8becc55d9e8ec
|
|
| MD5 |
69f4a0669693dc4e0263fe21bc157f2b
|
|
| BLAKE2b-256 |
b08067edbf0394f35c550d2ce72dfaaeee9b5ff0edb9c79b2895037c0eb2c9c7
|
File details
Details for the file steam_tfm-2026.7.0-py3-none-any.whl.
File metadata
- Download URL: steam_tfm-2026.7.0-py3-none-any.whl
- Upload date:
- Size: 75.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5f734087a8e392254ebee79ca3c496041588ea5a6a0f5c8c0a3d2ea85960474
|
|
| MD5 |
1d8c5da6810c14e7db80d6cb6f953f2d
|
|
| BLAKE2b-256 |
d91a5b5fbd9417646c0a938ab053bab38d0bc22301787dccbc2833fdb8930d18
|