def __init__(self, parent=None, file_name: str = None): # If initializing from file_name, field extractor is initialized here # Otherwise, a parent must be passed that, at some point before reading simulation data, # has a CML reader attached # Support pass when runnnig replay in Player if parent is None and file_name is None: return # Will extract fieldExtractor from parent or initialize new fieldExtractor from file_name assert file_name is not None or hasattr(parent, 'fieldExtractor') self._parent = parent self.field_extractor = None if parent is None: assert os.path.isfile(os.path.abspath(file_name)) assert file_name.endswith('.dml'), 'file_name must specify a .dml file' self.field_extractor = PlayerPython.FieldExtractorCML() self.field_extractor.setFieldDim(LatticeDataSummaryReader.extract_lattice_dim_from_file_name(file_name)) # data extracted from LDS file *.dml self.fieldDim = None self.fieldDimPrevious = None self.ldsCoreFileName = "" self.currentFileName = "" self.ldsDir = None # list of *.vtk files containing graphics lattice data self.ldsFileList = [] self.fieldsUsed = {} self.sim = None self.simulationData = None self.simulationDataReader = None self.frequency = 0 self.currentStep = 0 self.latticeType = "Square" self.numberOfSteps = 0 self.typeIdTypeNameDict = {} self.__fileWriter = None # C++ map<int,string> providing mapping from type id to type name self.typeIdTypeNameCppMap = None self.customVis = None
def __init__(self, field_dim: Dim3D): super().__init__() self.fieldExtractor = PlayerPython.FieldExtractorCML() self.fieldExtractor.setFieldDim(field_dim)