class documentation

class API:

View In Hierarchy

API class.
Static Method export_hdf5 Exports data to an HDF5 container.
Static Method export_wire Exports wire points to a TXT file.
Static Method import_hdf5 Imports data from an HDF5 container.
Static Method import_wire Imports wire points from a TXT file.
Static Method _dict_to_hdf5_group Recursively transforms a dictionary into an HDF5 group (in-place).
Static Method _hdf5_group_to_dict Recursively transforms an HDF5 group into a dictionary (in-place).
@staticmethod
def export_hdf5(filename, data):

Exports data to an HDF5 container.

Takes a dictionary and writes an HDF5 file using keys as keys, and items as groups if they are dictionaries or as datasets otherwise.

Parameters
filename:strFilename
data:Union[Dict, MagnetiCalc_Data]Dictionary or MagnetiCalc_Data object
@staticmethod
def export_wire(filename, data):
Exports wire points to a TXT file.
Parameters
filename:strFilename
data:Union[List, np.ndarray]NumPy array of 3D points
@staticmethod
def import_hdf5(filename):

Imports data from an HDF5 container.

Opens an HDF5 file and converts every group and subgroup into a dictionary where the keys are the group keys and the items are the datasets.

Parameters
filename:strFilename
Returns
MagnetiCalc_DataMagnetiCalc_Data object (can be accessed like a dictionary)
@staticmethod
def import_wire(filename):
Imports wire points from a TXT file.
Parameters
filename:strFilename
Returns
np.ndarrayNumPy array of 3D points
@staticmethod
def _dict_to_hdf5_group(hdf5_group, dictionary):
Recursively transforms a dictionary into an HDF5 group (in-place).
Parameters
hdf5_group:h5py.GroupHDF5 group
dictionary:DictDictionary
@staticmethod
def _hdf5_group_to_dict(hdf5_group, dictionary):
Recursively transforms an HDF5 group into a dictionary (in-place).
Parameters
hdf5_group:h5py.GroupHDF5 group
dictionary:DictDictionary