question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in numeric utils

See original GitHub issue

Describe the bug

(Line 191 in numeric utils)[https://github.com/arviz-devs/arviz/blob/c5edec458316501b6a9b22a718e09aa06c7fd0ff/arviz/numeric_utils.py#L191] is as follows:

width = np.round(np.max([1, bins_sturges, bins_fd])).astype(int)

When I ran this as part of running the PyMC3 getting started notebook,

round(np.max([1, bins_sturges, bins_fd]))

evaluated to 1, and, apparently 1.astype(int) raises an AttributeError:

AttributeError: 'int' object has no attribute 'astype'

I don’t, unfortunately, know how to reproduce this: when I set values for these variables and run the code outside ArviZ and PyMC3, it works fine. This works:

    import numpy as np
    bins_sturges = 1.2598237927692393
    bins_fd = 0.27849533001676674
    width = np.round(np.max([1, bins_sturges, bins_fd])).astype(int)

Is there, perhaps, some state of numpy or the python interpreter that is set and causes this to break? It seems like somehow the value of the np.round() expression ends up being a python-native int, instead of a numpy value, but I don’t know how this could happen.

Additional context

arviz 0.8.3 pandas 1.0.5 numpy 1.19.0 pymc3 3.9.2 last updated: Sun Jul 12 2020

CPython 3.7.7 IPython 7.16.1 watermark 2.0.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rpgoldmancommented, Jul 14, 2020

… but it does happen to me every time I try to run the notebook.

0reactions
aloctavodiacommented, Jul 14, 2020

BTW I tried to reproduce it, running the notebook with two numpy versions. no luck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

django.db.utils.DataError: numeric field overflow
The error message indicates that you have existing numbers longer than 8 digits (10-2) in your table. You might try modifying the offending ......
Read more >
Unable to run BRAKER - Scalar::Util::Numeric error ? #498
Hi, I installed all the dependencies, and perl v5.16.3 is my default version in the centos 7 server. Suggestions please!
Read more >
Import failed: org.postgresql.util.PSQLException: ERROR ...
This error is likely when you try to import some dimension with string type as a numerical value. Then eazyBI would import empty...
Read more >
Postgresql problem - ERROR: numeric field overflow - YouTube
How to solving : ERROR : numeric field overflow. DETAIL: A field with precision 2, scale 2 must round to an absolute value...
Read more >
4.13. Utility functions - LAMMPS documentation
In that case, the functions will stop with an error message, indicating the name of the ... double LAMMPS_NS::utils::numeric(const char *file, int line, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found