Coverage for sacred/sacred/config/config_dict.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/bin/env python
2# coding=utf-8
4from sacred.config.config_summary import ConfigSummary
5from sacred.config.utils import (
6 dogmatize,
7 normalize_or_die,
8 undogmatize,
9 recursive_fill_in,
10)
13class ConfigDict:
14 def __init__(self, d):
15 self._conf = normalize_or_die(d)
17 def __call__(self, fixed=None, preset=None, fallback=None):
18 result = dogmatize(fixed or {})
19 recursive_fill_in(result, self._conf)
20 recursive_fill_in(result, preset or {})
21 added = result.revelation()
22 config_summary = ConfigSummary(added, result.modified, result.typechanges)
23 config_summary.update(undogmatize(result))
24 return config_summary