Skip to content

Commit

Permalink
Merge pull request #1656 from drroe/fix.cif.chain
Browse files Browse the repository at this point in the history
Chain ID is now a string as of cpptraj version 6.27.0
  • Loading branch information
drroe authored Jun 14, 2024
2 parents a318898 + eaa22ab commit 2f5f16d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
export PATH=$HOME/bin:$PATH
- name: Install conda packages
run: |
conda update conda
conda env update --file environment.yml --name base
- name: Install cpptraj
run: |
Expand Down
2 changes: 1 addition & 1 deletion pytraj/core/topology_objects.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ cdef extern from "Residue.h":
cdef cppclass _Residue "Residue":
_Residue()
_Residue(int onum, const _NameType& resname, int first_AtomIn)
_Residue(_NameType& n, int r, char ic, char cid)
_Residue(_NameType& n, int r, char ic, const string& cid)
inline void SetLastAtom(int i)
inline void SetOriginalNum(int i)
inline int FirstAtom() const
Expand Down
6 changes: 3 additions & 3 deletions pytraj/core/topology_objects.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ cdef class Residue:
Examples
--------
>>> Residue('ALA', resid=0, icode=0, chainID=0)
>>> Residue('ALA', resid=0, icode=0, chainID='')
'''

def __cinit__(self, name='', int resid=0, icode=0, chainID=0):
def __cinit__(self, name='', int resid=0, icode=0, chainID=''):
cdef NameType resname = NameType(name)
cdef char icode_ = <int> icode
cdef char chainID_ = <int> chainID
cdef string chainID_ = chainID.encode()
self.thisptr = new _Residue(resname.thisptr[0], <int> resid,
icode_, chainID_)

Expand Down

0 comments on commit 2f5f16d

Please sign in to comment.