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

Several bugs in override_mask #270

Open
rkishony opened this issue Dec 12, 2021 · 2 comments
Open

Several bugs in override_mask #270

rkishony opened this issue Dec 12, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@rkishony
Copy link
Collaborator

Several bugs in override_mask:

x = iquib(2)
x.assign_value(7)
x.get_override_mask().get_value()

yields

---------------------------------------------------------------------------
ExternalCallFailedException               Traceback (most recent call last)
/var/folders/90/frsch0qx4nb6qc5hzm_jrvvr0000gn/T/ipykernel_2346/3754138513.py in <module>
      3 #x[1][1] = 0
      4 x.assign_value(7)
----> 5 x.get_override_mask().get_value()

~/Git/pyquibbler/pyquibbler/quib/function_quibs/external_call_failed_exception_handling.py in _wrapper(*args, **kwargs)
     86         except ExternalCallFailedException as e:
     87             # We want to remove any context
---> 88             raise ExternalCallFailedException(exception=e.exception,
     89                                               quibs_with_calls=e.quibs_with_calls,
     90                                               tb=e.traceback) from None

ExternalCallFailedException: Failed to execute get_override_mask(QuibRef(quib=x = iquib(2)))

The following quibs were in the stack of the exception: 
  File "('/var/folders/90/frsch0qx4nb6qc5hzm_jrvvr0000gn/T/ipykernel_2346/3754138513.py', 5)", line None
	get_override_mask(QuibRef(quib=x = iquib(2))) -> get_value() 
  File "('/var/folders/90/frsch0qx4nb6qc5hzm_jrvvr0000gn/T/ipykernel_2346/3754138513.py', 5)", line None
	get_override_mask(QuibRef(quib=x = iquib(2))) -> get_shape()  

IndexError: list index out of range

@rkishony rkishony added the bug Something isn't working label Dec 12, 2021
@rkishony
Copy link
Collaborator Author

Here is another, different, error:

x = iquib([1, [2, 3], 4])
x[1][1] = 0
x.get_override_mask().get_value()

yields:

/Users/roeekishony/.conda/envs/pyquibbler/lib/python3.9/site-packages/numpy/core/fromnumeric.py:1970: 
VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences 
(which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. 
If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  result = asarray(a).shape

@rkishony
Copy link
Collaborator Author

and yet another:

x = iquib([1, 2, 3])
x[1] = 0
x.assign_value(7)
x.get_override_mask().get_value()

yields:

---------------------------------------------------------------------------
ExternalCallFailedException               Traceback (most recent call last)
/var/folders/90/frsch0qx4nb6qc5hzm_jrvvr0000gn/T/ipykernel_2346/756016232.py in <module>
      2 x[1] = 0
      3 x.assign_value(7)
----> 4 x.get_override_mask().get_value()

~/Git/pyquibbler/pyquibbler/quib/function_quibs/external_call_failed_exception_handling.py in _wrapper(*args, **kwargs)
     86         except ExternalCallFailedException as e:
     87             # We want to remove any context
---> 88             raise ExternalCallFailedException(exception=e.exception,
     89                                               quibs_with_calls=e.quibs_with_calls,
     90                                               tb=e.traceback) from None

ExternalCallFailedException: Failed to execute get_override_mask(QuibRef(quib=x = iquib([1, 2, 3])))

The following quibs were in the stack of the exception: 
  File "('/var/folders/90/frsch0qx4nb6qc5hzm_jrvvr0000gn/T/ipykernel_2346/756016232.py', 4)", line None
	get_override_mask(QuibRef(quib=x = iquib([1, 2, 3]))) -> get_value() 
  File "('/var/folders/90/frsch0qx4nb6qc5hzm_jrvvr0000gn/T/ipykernel_2346/756016232.py', 4)", line None
	get_override_mask(QuibRef(quib=x = iquib([1, 2, 3]))) -> get_shape()  

TypeError: 'bool' object does not support item assignment


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