roahmlab / zonopy

Zonotopes in Python
https://roahmlab.github.io/zonopy/
MIT License
12 stars 2 forks source link

Assertion Error: zp.remove_dependence_and_compress #6

Closed rahulswa08 closed 7 months ago

rahulswa08 commented 7 months ago

zp.remove_dependence_and_compress throws an assertion error when tried to get reduced zonotope of more than one dimension.

x_zono: zp.polyZonotope = zp.polyZonotope([[1.0],[1.0]], n_dep_gens=1, id=0, device='cpu') 
y_zono: zp.polyZonotope = zp.polyZonotope([[2.0],[2.0]], n_dep_gens= 1, id=1, device='cpu') 
z_zono: zp.polyZonotope = zp.polyZonotope([[3.0],[3.0]], n_dep_gens= 1, id=2, device='cpu') 
mul_mini = zp.remove_dependence_and_compress(mul_pz, id=np.array([0,1]))
image
rahulswa08 commented 7 months ago

Solved this by commenting out the assertion (similar to matPolyZonotope case). Not sure if its correct

image
BuildingAtom commented 7 months ago

mul_pz is not shared so I can't verify for sure that this is the case; however, this assertion is thrown to indicate that a remaining indeterminate is not independently sliceable. This clarification should be addressed with #5 (and perhaps an additional argument to disable this independent slice requirement), so I'll be closing this issue.