Settings

Settings is a dict subclass implemented in PLAMS and modified in Qmflows. This class represents the data in a hierarchical tree-like structure. for example:

>>> from qmflows import Settings, templates

>>> s = Settings()  # (1)

# generic keyword
>>> s.basis = "DZP"  #  (2)

# "specific" allows the user to apply specific keywords for a package
>>> s.specific.adf.basis.core = "large"  # (3)

>>> input_settings = templates.singlepoint.overlay(s)  # (4)

The above code snippet shows how to create a Settings instance object in (1), then in (2) the generic keyword basis declares that the “DZP” should be used together with the large keyword of ADF as shown at (3). Finally in line (4) the user’s keywords are merged with the defaults resultin in a input like:

basis
    Core large
    Type DZP
end

integration
    accint 4.0
end

scf
    converge 1e-06
    iterations 100
wnd

xc
    lda
end

API

class qmflows.Settings(*args, **kwargs)[source]

A subclass of plams.Settings.

The difference with respect to plams’ Settings are:

  • settings['a.b'] is equivalent to settings['a']['b'] = settings.a.b

__deepcopy__(_)[source]

Implement copy.deepcopy(self).

Serves as an alias for Settings.copy().

__delitem__(name)[source]

Implement del self[name].

__getitem__(name)[source]

Implement self[name].

__setitem__(name, value)[source]

Implement self[name] = value.

Like its counterpart in dict but passed dictionaries are converted into instances of type(self).

copy()[source]

Create a deep(-ish) copy of this instance.

All nested settings instances embedded within self are copied recursively; all other objects set without copying.

overlay(other)[source]

Return new instance of Settings that is a copy of this instance updated with other.