omas.CodeParameters¶
- class omas.CodeParameters(string=None)[source]¶
Class used to interface with IMAS code-parameters XML files
Methods
__init__
([string])clear
()copy
()flat
(**kw)Flat dictionary representation of the data
from_file
(code_params_file)Load data from code.parameters XML file
from_string
(code_params_string)Load data from code.parameters XML string
from_structure
(structure[, depth])Generate CodeParamters starting from a hierarchical structure made of dictionaries and lists
fromkeys
([value])Create a new dictionary with keys from iterable and values set to value.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
getraw
(key)Method to access data to CodeParameters with no processing of the key.
items
()- return
key-value pairs as list
keys
()- return
keys as list
paths
(**kw)Traverse the code parameters and return paths that have data
pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised
popitem
()2-tuple; but raise KeyError if D is empty.
setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
setraw
(key, value)Method to assign data to CodeParameters with no processing of the key.
to_string
()generate an XML string from this dictionary
update
(value)Update CodeParameters NOTE: ODSs will be converted to CodeParameters classes
values
()- return
values as list