A dictionary based backend for testing
- class madas.backend.dictionary_backend.DictBackend(filename=None, filepath=None, make_dirs=True, key_name='mid', log=None)
Storage of materials data in a dictionary in memory.
Inteded use are development and testing, however, data can be stored by json.dump ing the dict.
- property abs_path
Included for compatibility, returns None.
- static from_json(json_data) object
Restore data from string. Inverse option to DictBackend().to_json().
- get_length() int
Return the length of the database, i.e. the total number of entries.
- has_entry(entry_id: str) bool
Check if an entry with the given id is present in the database.
- to_json() str
json.dumps the content of the database.
- update_many(mids: List[str], kwargs_list: List[dict] = [])
Update several entries in the database.
The properties attributes of entries mids will be updated with entries of kwargs_list.
- update_metadata(**kwargs) None
Updata database metadata.
- update_single(mid: str, **kwargs) None
Update a single entry in the database.
The properties attribute of entry mid will be updated with **kwargs.