Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range (frag/network/decorate.py:225) #40

Open
alanbchristie opened this issue Apr 12, 2022 · 0 comments
Open

Comments

@alanbchristie
Copy link
Collaborator

While testing an experimental stack and querying the graph database I stumbled upon a number of IndexError exceptions in the decorate.py module. Full stack trace: -

Internal Server Error: /api/vector/194/
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/viewsets.py", line 114, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/mixins.py", line 56, in retrieve
    return Response(serializer.data)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/serializers.py", line 562, in data
    ret = super().data
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/serializers.py", line 260, in data
    self._data = self.to_representation(self.instance)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/serializers.py", line 529, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/fields.py", line 1905, in to_representation
    return method(value)
  File "/code/viewer/serializers.py", line 380, in get_vectors
    out_data["indices"] = get_vect_indices_for_mol(obj.sdf_info)
  File "/usr/local/lib/python3.7/dist-packages/frag/network/decorate.py", line 101, in get_vect_indices_for_mol
    tot_dict = del_link_coord(input_mol, get_indices=True, iso_labels=False)
  File "/usr/local/lib/python3.7/dist-packages/frag/network/decorate.py", line 161, in del_link_coord
    x, Chem.MolFromMolBlock(input_mol), get_indices, ring_iso[i]
  File "/usr/local/lib/python3.7/dist-packages/frag/network/decorate.py", line 238, in get_atom_coords
    ind_list = find_atom_pairs(smiles_input, get_indices, iso_smiles)
  File "/usr/local/lib/python3.7/dist-packages/frag/network/decorate.py", line 225, in find_atom_pairs
    isotope = int(iso_matches[i][:-2])
IndexError: list index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant