clean_legacy_configuration

Full name: ase2sprkkr.configuration_migration.clean_legacy_configuration

ase2sprkkr.configuration_migration.clean_legacy_configuration(file)[source]

Remove migrated top-level config.* = ... statements from a script.

Only plain top-level assignments are removed. Conditional or otherwise dynamic uses of config are deliberately retained. A directly preceding contiguous comment block is removed together with an assignment. The from ase2sprkkr.configuration import config import is removed only when no remaining code refers to config. Runs of blank lines left by removed blocks are collapsed to a single blank line.