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

fix float complaint #24

Closed
wants to merge 1 commit into from
Closed

Conversation

alecjacobson
Copy link

Old error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/alecjacobson/Repos/Teg/teg/__init__.py", line 1, in <module>
    from .lang.base import *
  File "/Users/alecjacobson/Repos/Teg/teg/lang/base.py", line 189, in <module>
    true = Bool(Const(0), Const(1))
  File "/Users/alecjacobson/Repos/Teg/teg/lang/base.py", line 169, in __init__
    super(Bool, self).__init__(children=[try_making_teg_const(e) for e in (left_expr, right_expr)])
  File "/Users/alecjacobson/Repos/Teg/teg/lang/base.py", line 169, in <listcomp>
    super(Bool, self).__init__(children=[try_making_teg_const(e) for e in (left_expr, right_expr)])
  File "/Users/alecjacobson/Repos/Teg/teg/lang/base.py", line 7, in try_making_teg_const
    if type(x) in (int, float, np.int64, np.float, np.float64):
  File "/Users/alecjacobson/miniconda3/lib/python3.9/site-packages/numpy/__init__.py", line 324, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

I'm using python 3.9 with numpy 1.26.2

@martinjm97 martinjm97 closed this Mar 31, 2024
@martinjm97
Copy link
Collaborator

Thank you for the PR. I merged your fix and propagated it to a few other places. I also made a few fixes here and there so that the tests pass.

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

Successfully merging this pull request may close these issues.

None yet

2 participants