mpylab.tools.nport_migration moduleΒΆ

Migrate legacy NPORT interpolation settings in INI files.

exception mpylab.tools.nport_migration.NPortMigrationError

Bases: ValueError

Raised when an INI file cannot be migrated without ambiguity.

class mpylab.tools.nport_migration.NPortMigrationResult(source: str, replacements: int, device_type: str | None)

Bases: object

Result of inspecting or migrating one INI source.

property changed

Return whether legacy channel settings were replaced.

device_type: str | None
replacements: int
source: str
mpylab.tools.nport_migration.discover_ini_files(path, recursive=False)

Return deterministic INI inputs for one file or directory.

mpylab.tools.nport_migration.main(argv=None)

Run the mpylab-nport-migrate command.

mpylab.tools.nport_migration.migrate_nport_ini_file(path, *, write=False)

Inspect and optionally migrate one NPORT-style INI file.

mpylab.tools.nport_migration.migrate_nport_ini_source(source)

Return an explicitly configured equivalent of a legacy NPORT INI.

Only NPORT, CABLE, ANTENNA and AMPLIFIER files are considered. Both historical INTERPOLATION = LIN and LOG are converted to the explicit settings that preserve the old NPORT behavior.