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

formula autocomplete: tuple index out of range #407

Open
tschaume opened this issue Apr 27, 2022 · 0 comments
Open

formula autocomplete: tuple index out of range #407

tschaume opened this issue Apr 27, 2022 · 0 comments
Assignees

Comments

@tschaume
Copy link
Member

/materials/formula_autocomplete

builtins.IndexError: tuple index out of range
Traceback (most recent call last):
  File "/root/.local/lib/python3.9/site-packages/ddtrace/contrib/asgi/middleware.py", line 173, in __call__
    return await self.app(scope, receive, wrapped_send)
  File "/root/.local/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc
  File "/root/.local/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/root/.local/lib/python3.9/site-packages/starlette/routing.py", line 656, in __call__
    await route.handle(scope, receive, send)
  File "/root/.local/lib/python3.9/site-packages/starlette/routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "/root/.local/lib/python3.9/site-packages/starlette/routing.py", line 61, in app
    response = await func(request)
  File "/root/.local/lib/python3.9/site-packages/fastapi/routing.py", line 216, in app
    solved_result = await solve_dependencies(
  File "/root/.local/lib/python3.9/site-packages/fastapi/dependencies/utils.py", line 527, in solve_dependencies
    solved = await run_in_threadpool(call, **sub_values)
  File "/root/.local/lib/python3.9/site-packages/starlette/concurrency.py", line 39, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/.local/lib/python3.9/site-packages/anyio/to_thread.py", line 28, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(func, *args, cancellable=cancellable,
  File "/root/.local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 818, in run_sync_in_worker_thread
    return await future
  File "/root/.local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 754, in run
    result = context.run(func, *args)
  File "/emmet-api/emmet/api/routes/materials/query_operators.py", line 360, in query
    comp_red = comp.reduced_composition.items()
  File "/root/.local/lib/python3.9/site-packages/pymatgen/core/composition.py", line 349, in reduced_composition
    return self.get_reduced_composition_and_factor()[0]
  File "/root/.local/lib/python3.9/site-packages/pymatgen/core/composition.py", line 359, in get_reduced_composition_and_factor
    factor = self.get_reduced_formula_and_factor()[1]
  File "/root/.local/lib/python3.9/site-packages/pymatgen/core/composition.py", line 384, in get_reduced_formula_and_factor
    (formula, factor) = reduce_formula(d, iupac_ordering=iupac_ordering)
  File "/root/.local/lib/python3.9/site-packages/pymatgen/core/composition.py", line 1183, in reduce_formula
    factor = abs(gcd(*(int(i) for i in sym_amt.values())))
  File "/root/.local/lib/python3.9/site-packages/monty/fractions.py", line 17, in gcd
    n = numbers[0]
IndexError: tuple 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

2 participants