Registry / data / scikit-rf

scikit-rf

JSON →
library1.12.0pypypi✓ verified 83d ago

Scikit-RF is an object-oriented Python library for microwave engineering. It provides tools for network analysis, circuit simulation, calibration, and visualization of S-parameters and other RF components. The current version is 1.11.0, and it maintains an active, though not strictly time-bound, release cadence.

pip install scikit-rf
INSTALL
IMPORT
SIG · SCIKIT-RF
S
scikit-rf
datapythonv1.12.0
Install
11.9s avg
Import
4240ms
Disk
314MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.12.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 4.348s · 311.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 11.9s · import 4.131s · 298MB
314MB installed
● package 314MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Network
from skrf import Network
import skrf as rf; ntwk = rf.Network(...)
Frequency
from skrf import Frequency
import skrf as rf; freq = rf.Frequency(...)

This quickstart demonstrates how to create a simple 2-port `Network` object in scikit-rf, populate it with dummy S-parameter data, and then plot its S21 magnitude in dB. It highlights the use of `Frequency` and `Network` classes and the common `plot_s_db` method.

import skrf as rf import matplotlib.pyplot as plt # Create a dummy 2-port network for demonstration f = rf.Frequency(1, 10, 101, 'ghz') # 1-10 GHz, 101 points s = rf.Touchstone(f, name='my_network') # Populate with some dummy S-parameters (e.g., ideal thru) for 2-port s.s[:,0,0] = 0 # S11 s.s[:,1,1] = 0 # S22 s.s[:,0,1] = 1 # S12 s.s[:,1,0] = 1 # S21 # Create a Network object from the Touchstone data ntwk = rf.Network(s=s.s, frequency=f, name='Dummy Thru') # Plot S21 magnitude in dB ntwk.plot_s_db(m=1, n=0) plt.title(f'{ntwk.name} S21 Magnitude') plt.xlabel('Frequency (GHz)') plt.ylabel('S21 Magnitude (dB)') # plt.show() # Uncomment to display plot print(f"Network name: {ntwk.name}") print(f"Network frequency range: {ntwk.frequency.f_ghz[0]:.2f} GHz to {ntwk.frequency.f_ghz[-1]:.2f} GHz")
Debug
Known issues
gotchaScikit-RF handles frequency units internally, but users often confuse input units (Hz, kHz, MHz, GHz) leading to incorrect calculations or plots. Always be explicit.
fix
When creating a `Frequency` object, ensure the `unit` argument matches your numerical input (e.g., `rf.Frequency(1, 10, 101, 'ghz')` for GHz input). For existing `Network` objects, access frequency in desired units via properties like `ntwk.f`, `ntwk.f_khz`, `ntwk.f_mhz`, `ntwk.f_ghz`.
affects: All versions
breakingPrior to version 0.16, the `skrf.network.Network` class and other components had different constructors or attribute names. Code written for older versions might fail due to these changes.
fix
Consult the scikit-rf changelog and upgrade guide if migrating from very old versions. Common breaking changes include `Network` constructor arguments or internal attribute restructuring. Ensure your code aligns with the `1.x` series API.
affects: < 0.16
gotchaWhen loading Touchstone files, scikit-rf automatically determines the number of ports. If the file is malformed or unusual, this can lead to incorrect network dimensions or parsing errors.
fix
Validate your Touchstone file format. If issues persist, try loading the file into a text editor to confirm its structure and headers. For programmatic inspection, `rf.Network(file='path/to/file.s2p').nports` can confirm the detected port count.
affects: All versions
gotchaDefault plotting styles might not always be ideal for publication or specific analysis. Matplotlib's default may hide details or look unpolished.
fix
Utilize Matplotlib's extensive customization options. After calling `ntwk.plot_s_db(...)`, you can use `plt.xlabel()`, `plt.ylabel()`, `plt.title()`, `plt.grid(True)`, `plt.ylim()`, `plt.style.use('seaborn-v0_8-darkgrid')` (or other styles) to enhance plots. Scikit-rf plots return Matplotlib axes, allowing direct manipulation.
affects: All versions
Upgrade
Version history
1.12.0latest on PyPI · released May 5, 2026
Audit
Dependencies
numpyrequiredFundamental for numerical operations and array handling.
scipyrequiredProvides scientific computing tools, including signal processing and interpolation.
matplotlibrequiredUsed for plotting and visualization of RF data.
pandasrequiredUsed for data manipulation, particularly for tabular data and time series.
numexprrequiredOptimizes numerical expressions, speeding up computations.
h5pyrequiredFor handling HDF5 files, often used for data storage.
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources
scikit-rf — pip install scikit-rf · libregistry