def setUpClass(cls): os.chdir("madelung") out = file("pi.log", "w") process = subprocess.Popen("../../../bin/pi-qmc", stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.communicate() process.wait() cls.h5file = pitools.openFile()
def setUpClass(cls): os.chdir("sho") out = file("pi.log", "w") process = subprocess.Popen("../../../bin/pi-qmc", stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.communicate() process.wait() cls.h5file = pitools.openFile()
def dataFromH5File(project, filename): data = SimulationModel(project) data.filename = filename try: data.file = pitools.openFile(data.filename) data.temperature = data.file.getTemperature(Unit.K) data.nslice = data.file.getNSlice() data.superCell = data.file.getSuperCell(Unit.nm) data.estimators = data.file.getEstimatorList() except IOError: return None return data
def reloadData(self): self.file.close() # Retreive remote data if needed. if hasattr(self,"hostMachine") and hasattr(self,"hostDirectory"): self.statusMessage.emit("downloaded new data from %s:%s" % (self.hostMachine, self.hostDirectory),5000) os.system('scp "%s:%s/pimc.h5" %s' % (self.hostMachine, self.hostDirectory, self.project.nameList[self.index])) try: self.file = pitools.openFile(self.filename) self.temperature = self.file.getTemperature(Unit.K) self.nslice = self.file.getNSlice() self.superCell = self.file.getSuperCell(Unit.nm) self.estimators = self.file.getEstimatorList() except IOError: return None self.dataChanged.emit()