mcstasscript.data.pyvinylData.pyvinylMcStasData
mcstasscript.data.pyvinylData.pyvinylMcStasData¶
- class mcstasscript.data.pyvinylData.pyvinylMcStasData(key, data_dict=None, filename=None, file_format_class=None, file_format_kwargs=None)¶
- __init__(key, data_dict=None, filename=None, file_format_class=None, file_format_kwargs=None)¶
Methods
__init__(key[, data_dict, filename, ...])from_dict(data_dict, key)Create the data class by a python dictionary.
from_file(filename, format_class, key, **kwargs)Create the data class by the file in the format.
get_data()Return the data in a dictionary
list_formats()Print supported formats
set_dict(data_dict)Set a mapping dict for this DataClass.
set_file(filename, format_class, **kwargs)Set a mapping file for this DataClass.
supported_formats()write(filename, format_class[, key])Write the data mapped by the Data Object into a file and return a Data Object mapping the file.
Attributes
data_dictThe data_dict of the class instance for calculator usage
expected_dataThe expected_data of the class instance for calculator usage
file_format_classThe FormatClass to map the file by this DataClass
file_format_kwargsThe kwargs needed to map the file
filenameThe filename of the file to map by this DataClass.
keyThe key of the class instance for calculator usage
mapping_contentReturns an overview of the keys of the mapped dict or the filename of the mapped file
mapping_typeIf this data class is a file mapping or python dict mapping.
- classmethod from_dict(data_dict, key)¶
Create the data class by a python dictionary.
- classmethod from_file(filename: str, format_class, key, **kwargs)¶
Create the data class by the file in the format.