Skip to content

Commit

Permalink
Cython version update
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Jul 21, 2023
1 parent eb75d2a commit 13892c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/glypy/_c/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ cdef struct monosaccharide_count_cell:
float mass


cdef int cmp_monosaccharide_count_cell(const void* lhs, const void* rhs) nogil:
cdef int cmp_monosaccharide_count_cell(const void* lhs, const void* rhs) noexcept nogil:
cdef monosaccharide_count_cell* left = <monosaccharide_count_cell*>lhs
cdef monosaccharide_count_cell* right = <monosaccharide_count_cell*>rhs

Expand Down
5 changes: 5 additions & 0 deletions src/glypy/structure/stereochemistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,17 @@ def _update_stereocode_basic(code, monosaccharide):

def _update_stereocode_extended(code, monosaccharide):
null_position = (UnknownPosition, NoPosition)
# Count starting from 1 instead of 0 because ring coordinates are 1-base
if monosaccharide.ring_start not in null_position and monosaccharide.ring_end not in null_position:
ring_range = range(monosaccharide.ring_start, monosaccharide.ring_end + 1)
else:
ring_range = []
ring_dimensions = range(1, monosaccharide.superclass.value + 1)
termini = set(ring_dimensions) - set(ring_range)
if not termini:
# We cannot find an available carbon, so it must be on an otherwise
# occupied carbon, e.g. in xylopyranose
termini = ring_dimensions
terminal = max(termini) - 1
code[terminal] = Stereocoding.h
for i in range(len(code)):
Expand Down

0 comments on commit 13892c2

Please sign in to comment.