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

can't assign a Ch objects as a subset of another #11

Closed
aeoleader opened this issue Mar 17, 2017 · 1 comment
Closed

can't assign a Ch objects as a subset of another #11

aeoleader opened this issue Mar 17, 2017 · 1 comment

Comments

@aeoleader
Copy link

I am trying to assign a 3x3 array as a subset of a 3x3x9 array, but it gives me
Exception: Can't assign a Ch objects as a subset of another.
The following code is troublesome:
k = ch.arange(81).reshape(3, 3, 9)
tmp = ch.eye(3)
k[:, :, 1] = tmp
The complete error message is the following:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/chumpy/ch.py", line 468, in setitem
raise Exception("Can't assign a Ch objects as a subset of another."
Exception: Can't assign a Ch objects as a subset of another.

@thmoa
Copy link

thmoa commented Jul 31, 2017

As the error says, you cannot assign Ch objects to others. You can either assign a numpy array to k or stack 9 Ch objects.

mattloper pushed a commit that referenced this issue Mar 14, 2019
These namespace relative imports work in chumpy tests, but were causing import errors like this one:

```
  File "/home/circleci/repo/blmath/geometry/transform/test_composite.py", line 172, in test_forward_reverse_equivalence
    transform.rotate(np.array([1., 2., 3.]))
  File "/home/circleci/repo/blmath/geometry/transform/composite.py", line 237, in rotate
    from blmath.geometry.transform.rodrigues import as_rotation_matrix
  File "/home/circleci/repo/blmath/geometry/transform/rodrigues.py", line 2, in <module>
    import chumpy as ch
  File "/home/circleci/repo/venv/lib/python2.7/site-packages/chumpy/__init__.py", line 1, in <module>
    from .ch import *
  File "/home/circleci/repo/venv/lib/python2.7/site-packages/chumpy/ch.py", line 1310, in <module>
    from . import ch_ops
  File "/home/circleci/repo/venv/lib/python2.7/site-packages/chumpy/ch_ops.py", line 47, in <module>
    from . import ch
ImportError: cannot import name ch
```
# Conflicts:
#	Makefile
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

3 participants