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 the key is not found, return the default if given; otherwise, raise a KeyError.
popitem()Remove and return a (key, value) pair as a 2-tuple.
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