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 theInfomapsignatures.Advanced tier — the long tail of tuning and I/O options. From 2.15 they carry a versioned note on the
Infomapsignatures 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 throughOptionsinstead:import infomap options = infomap.Options(regularized=True, flow_tolerance=1e-12) result = infomap.run("network.net", options=options)
The same
Optionsobject works withNetwork.run(). A few advanced options migrate elsewhere rather than toOptions, and each keyword’s.. deprecated::note states its own path: the file-output options (no_file_output,tree,clu,out_name, …) move to theResult.write_*/Network.write_*methods;silentandverbosity_levelgive way to logging (see Running Infomap);threadsis superseded bynum_threads; andprint_config_fingerprintis 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_linksis a deprecated alias kept for backward compatibility. Self-links are included by default; passno_self_links=Trueto exclude them. Passinginclude_self_linksexplicitly emits aDeprecationWarning.prettyis a deprecated no-op — it is accepted for backward compatibility but has no effect. Passing it explicitly emits aDeprecationWarning.
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.