def report(self, simulation, state): """Generate a report. Parameters: - simulation (Simulation) The Simulation to generate a report for - state (State) The current state of the simulation """ if self._nextModel == 0: PDBxFile.writeHeader(simulation.topology, self._out) self._nextModel += 1 PDBxFile.writeModel(simulation.topology, state.getPositions(), self._out, self._nextModel) self._nextModel += 1 if hasattr(self._out, 'flush') and callable(self._out.flush): self._out.flush()
def report(self, simulation, _): """Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for _ : State The current state of the simulation """ state = simulation.context.getState(getPositions=True, enforcePeriodicBox=self._enforcePeriodicBox) if self._nextModel == 0: PDBxFile.writeHeader(simulation.topology, self._out) self._nextModel += 1 PDBxFile.writeModel(simulation.topology, state.getPositions(), self._out, self._nextModel) self._nextModel += 1 if hasattr(self._out, 'flush') and callable(self._out.flush): self._out.flush()
def report(self, simulation, _): """Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for _ : State The current state of the simulation """ state = simulation.context.getState( getPositions=True, enforcePeriodicBox=self._enforcePeriodicBox) if self._nextModel == 0: PDBxFile.writeHeader(simulation.topology, self._out) self._nextModel += 1 PDBxFile.writeModel(simulation.topology, state.getPositions(), self._out, self._nextModel) self._nextModel += 1 if hasattr(self._out, 'flush') and callable(self._out.flush): self._out.flush()