asConfig

tenpy.tools.params.asConfig(config, name)[source]

Convert a dict-like config to a Config.

Parameters:
  • config (dict | Config) – If this is a Config, just return it. Otherwise, create a Config from it and return that.

  • name (str) – Name to be used for the Config.

Returns:

config – Either directly config or Config(config, name).

Return type:

Config