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

ValueError: zero-size array to reduction operation maximum which has no identity #321

Open
olegs opened this issue Nov 30, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@olegs
Copy link
Member

olegs commented Nov 30, 2022

[2022-11-30 08:24:51,804: INFO/MainProcess] Received task: analyze_search_terms[14fe8823-b764-45ca-8e00-1a1ab5a7643a]  
[2022-11-30 08:24:51,806: INFO/ForkPoolWorker-3] Analyzing search query
[2022-11-30 08:24:51,807: INFO/ForkPoolWorker-3] Searching 1000 most cited publications matching rat scenic
[2022-11-30 08:24:53,956: INFO/ForkPoolWorker-3] Found 2 publications in the database
[2022-11-30 08:24:53,957: INFO/ForkPoolWorker-3] Expanding related papers by references
[2022-11-30 08:24:53,963: WARNING/ForkPoolWorker-3] /home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3474: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
[2022-11-30 08:24:53,964: WARNING/ForkPoolWorker-3] /home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
[2022-11-30 08:24:53,964: WARNING/ForkPoolWorker-3] /home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/_methods.py:264: RuntimeWarning: Degrees of freedom <= 0 for slice
  ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
[2022-11-30 08:24:53,964: WARNING/ForkPoolWorker-3] /home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/_methods.py:222: RuntimeWarning: invalid value encountered in true_divide
  arrmean = um.true_divide(arrmean, div, out=arrmean, casting='unsafe',
[2022-11-30 08:24:53,965: WARNING/ForkPoolWorker-3] /home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/_methods.py:256: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
[2022-11-30 08:24:53,967: ERROR/ForkPoolWorker-3] Task analyze_search_terms[14fe8823-b764-45ca-8e00-1a1ab5a7643a] raised unexpected: ValueError('zero-size array to reduction operation maximum which has no identity')
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/celery/app/trace.py", line 650, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/user/pysrc/celery/tasks_main.py", line 40, in analyze_search_terms
    ids = expand_ids(loader=loader, ids=ids, single_paper=False,
  File "/home/user/pysrc/papers/analysis/expand.py", line 45, in expand_ids
    cit_mean, cit_std = estimate_citations(ids, single_paper, loader,
  File "/home/user/pysrc/papers/analysis/expand.py", line 142, in estimate_citations
    logger.debug(f'Filtered citations min={np.mean(filtered)}, max={np.max(filtered)}, mean={mean}, std={std}')
  File "<__array_function__ internals>", line 180, in amax
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 2791, in amax
    return _wrapreduction(a, np.maximum, 'max', axis, None, out,
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity
@olegs olegs added the bug Something isn't working label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant