Pars#

class Pars(pars=None, **kwargs)[source]#

Bases: objdict

Dict-like container of parameters

Acts like an sc.objdict(), except that adding new keys are disallowed by default, and auto-updates known types.

Methods

update(pars=None, create=False, **kwargs)[source]#

Update internal dict with new pars.

Parameters:
  • pars (dict) – the parameters to update (if None, do nothing)

  • create (bool) – if create is False, then raise a KeyNotFoundError if the key does not already exist

  • kwargs (dict) – merged with pars

check_key_mismatch(pars)[source]#

Check whether additional keys are being added to the dictionary

dict_update(*args, **kwargs)[source]#

Redefine default dict.update(), since overwritten in this class; should not usually be used

to_json(**kwargs)[source]#

Convert to JSON representation