Unverified Commit c5b7b964 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1742 from athomps/python-extract-compute-bug

Fixes bug in extract_compute() python method
parents 873e0142 f21b059c
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -390,20 +390,20 @@ class lammps(object):
  def extract_compute(self,id,style,type):
  def extract_compute(self,id,style,type):
    if id: id = id.encode()
    if id: id = id.encode()
    if type == 0:
    if type == 0:
      if style > 0: return None
      if style == 0:
        self.lib.lammps_extract_compute.restype = POINTER(c_double)
        self.lib.lammps_extract_compute.restype = POINTER(c_double)
        ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
        ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
        return ptr[0]
        return ptr[0]
      else if style == 1:
        return None
      else if style == 2:
        self.lib.lammps_extract_compute.restype = POINTER(c_int)
        return ptr[0]
    if type == 1:
    if type == 1:
      self.lib.lammps_extract_compute.restype = POINTER(c_double)
      self.lib.lammps_extract_compute.restype = POINTER(c_double)
      ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
      ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
      return ptr
      return ptr
    if type == 2:
    if type == 2:
      if style == 0:
        self.lib.lammps_extract_compute.restype = POINTER(c_int)
        ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
        return ptr[0]
      else:
      self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double))
      self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double))
      ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
      ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
      return ptr
      return ptr