Deprecation policy

Infomap’s Python API follows a predictable deprecation contract so you can rely on it across releases. Nothing listed here is removed before 3.0; until then the old spelling keeps working, and the reference docs mark each deprecated name with the release it was deprecated in.

Signature tiers

The keyword arguments on Infomap and Infomap.run() are split into two tiers:

  • Common tier — the handful of options most runs touch (seed, num_trials, two_level, directed, markov_time). These stay on the Infomap signatures.

  • Advanced tier — the long tail of tuning and I/O options. From 2.15 they carry a versioned note on the Infomap signatures and leave those signatures in 3.0. Most are tuning options that stay available — only their entry point moves, marked .. versionchanged:: 2.15 — so pass them through Options instead:

    import infomap
    
    options = infomap.Options(regularized=True, flow_tolerance=1e-12)
    result = infomap.run("network.net", options=options)
    

    The same Options object works with Network.run(). A few advanced options migrate elsewhere rather than to Options, and each keyword’s .. deprecated:: note states its own path: the file-output options (no_file_output, tree, clu, out_name, …) move to the Result.write_* / Network.write_* methods; silent and verbosity_level give way to logging (see Running Infomap); threads is superseded by num_threads; and print_config_fingerprint is a CLI-only diagnostic with no library replacement.

Passing an advanced-tier keyword to Infomap or Infomap.run() emits a PendingDeprecationWarning (silent by default; surface it with python -W or a logging filter). Routing the option through Options is the warning-free path, so existing code keeps running unchanged until 3.0.

Redesigned result access

The stateful accessors on Infomap (get_modules, codelength, num_top_modules, and friends) are .. deprecated:: 2.15 in favour of the immutable Result that run() and Infomap.run() return, and reading one from user code emits the same silent-by-default PendingDeprecationWarning as the advanced-tier keywords. Read scalars as properties (result.codelength) and collections as methods (result.modules(), result.nodes(), result.tree()). See Reading the result.

Compatibility aliases

  • include_self_links is a deprecated alias kept for backward compatibility. Self-links are included by default; pass no_self_links=True to exclude them. Passing include_self_links explicitly emits a DeprecationWarning.

  • pretty is a deprecated no-op — it is accepted for backward compatibility but has no effect. Passing it explicitly emits a DeprecationWarning.

Error base classes

Through 2.x, InfomapError inherits RuntimeError and NotRunError also keeps ValueError in its MRO, so pre-taxonomy except RuntimeError / except ValueError code keeps working. These legacy bases detach in 3.0 — catch InfomapError (or a subclass) instead. See Errors.