コード例 #1
0
ファイル: task.py プロジェクト: sikisis/pymatgen
    def from_filename(cls, filename):
        "Initialize an instance of RunMode from the configuration file (JSON format)"
        defaults = cls._defaults.copy() 
        d = json_load(filename) 

        # Put default values if they are not in d.
        for (k,v) in defaults.items():
            if k not in d:
                d[k] = v
        return cls(d)
コード例 #2
0
ファイル: task.py プロジェクト: sikisis/pymatgen
 def json_load(cls, filename):
     return cls.from_dict(json_load(filename))