lsst.dax.apdb gd2a12a3803+c2a56858ff
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
lsst.dax.apdb.apdbConfigFreezer.ApdbConfigFreezer Class Reference
Inheritance diagram for lsst.dax.apdb.apdbConfigFreezer.ApdbConfigFreezer:

Public Member Functions

 __init__ (self, Iterable[str] field_names)
 
str to_json (self, ApdbConfig config)
 
_Config update (self, _Config config, str json_str)
 

Protected Attributes

 _field_names
 

Detailed Description

Class that handles freezing of the configuration parameters, this is
an implementation detail for use in Apdb subclasses.

Parameters
----------
field_names : `~collections.abc.Iterable` [`str`]
    Names of configuration fields to be frozen.

Member Function Documentation

◆ to_json()

str lsst.dax.apdb.apdbConfigFreezer.ApdbConfigFreezer.to_json ( self,
ApdbConfig config )
Convert part of the configuration object to JSON string.

Parameters
----------
config : `ApdbConfig`
    Configuration object.

Returns
-------
json_str : `str`
    JSON representation of the frozen part of the config.

◆ update()

_Config lsst.dax.apdb.apdbConfigFreezer.ApdbConfigFreezer.update ( self,
_Config config,
str json_str )
Update configuration field values from a JSON string.

Parameters
----------
config : `ApdbConfig`
    Configuration object.
json_str : str
    String containing JSON representation of configuration.

Returns
-------
updated : `ApdbConfig`
    Copy of the ``config`` with some fields updated from JSON object.

Raises
------
TypeError
    Raised if JSON string does not represent JSON object.
ValueError
    Raised if JSON object contains key which is not present in
    ``field_names``.

The documentation for this class was generated from the following file: