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

GUI cannot switch dimensions #1375

doutriaux1 opened this issue Jun 9, 2015 · 12 comments

GUI cannot switch dimensions #1375

doutriaux1 opened this issue Jun 9, 2015 · 12 comments


Copy link

When trying to switch/reorder the dimensions from the GUI, I get a popup window with the following message:

error executing pipeline. See log for details

The log says:

Traceback (most recent call last):
  File "/usr/local/uvcdat/2.2.0/vistrails/vistrails/core/modules/", line 327, in update
  File "/usr/local/uvcdat/2.2.0/vistrails/vistrails/packages/uvcdat_cdms/", line 378, in compute
    self.var = self.to_python()
  File "/usr/local/uvcdat/2.2.0/vistrails/vistrails/packages/uvcdat_cdms/", line 237, in to_python
    var = cdmsfile.__call__(varName, **kwargs)
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 45, in __call__
    return v(*args, **kwargs)
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 155, in __call__
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 195, in unmodified_select
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 759, in subRegion
    return self.subSlice(*slicelist, **d)
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 616, in subSlice
    result = result.reorder(order).regrid(grid)
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 950, in reorder
    permutation = order2index(axes, order)
  File "/usr/local/uvcdat/2.2.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/", line 1580, in order2index
CDMSError: Index 2 out of range in order 102
ERROR:root:Uncaught exception: "Index 2 out of range in order 102"

The command line equivalent is:

In [1]: s=f("clt",order='ytx')

and works.

@remram44 assigned to you but feel free to reassign appropriately

Picture on how to get the bug:
then click load and close.

Copy link

remram44 commented Jun 9, 2015

Duplicate of #1277? Also looks related to #1280

Copy link
Contributor Author

it is similar to #1277 but not the same. #1277 is getting the values while this re-orders the axes. But it's probably a similar fix. #1280 is vcs issue not vistrials/gui related.

Copy link

I can't reproduce your error, although plotting the variable leads to an exception (I assume the crazy-looking plot is expected; screenshot).

@aashish24 aashish24 assigned chaosphere2112 and unassigned remram44 Oct 15, 2015
Copy link

@chaosphere2112 do we care about this bug?

Copy link

@aashish24 Sure!

@doutriaux1 The problem is that Vistrails is by default applying a squeeze argument of 1, which is removing the axis you've shrunk. I'll remove that argument.

Copy link
Contributor Author

as @chaosphere2112 discovered this is really an underlying issue with cdms2, i will open a separate issue for the cdms2 bug.

Copy link
Contributor Author

actually @chaosphere2112 it seems to work in cdms


but the (kind of user error really folowing doesn't:


Indeed if you "sqeeze out" levels you can't ask for them in the ordering

Copy link

Right, but order also takes indices:

In [1]: import vcs, cdms2

In [2]: f = + "/")

In [3]: u = f("u", squeeze=1, order="0321")
CDMSError                                 Traceback (most recent call last)
<ipython-input-3-267c0c987ea2> in <module>()
----> 1 u = f("u", squeeze=1, order="0321")

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/cudsinterface.pyc in __call__(self, id, *args, **kwargs)
     31             except ( AttributeError, TypeError ):
     32                 raise CDMSError, "No such variable, " + id
---> 33         return v(*args, **kwargs)
     35     def __getitem__(self, key):

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/avariable.pyc in __call__(self, *args, **kwargs)
    157                                          squeeze=squeeze,
    158                                          order=order,
--> 159                                          grid=grid)
    161     select = __call__

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/selectors.pyc in unmodified_select(self, variable, raw, squeeze, order, grid)
    193      # result is variable when there are no components, for example.
    194             return result.subRegion(squeeze=squeeze, order=order, grid=grid,
--> 195                                     raw=raw)
    196         else:
    197             return result

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/avariable.pyc in subRegion(self, *specs, **keys)
    765                  'grid':grid,
    766                 }
--> 767             return self.subSlice(*slicelist, **d)
    769         #

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/avariable.pyc in subSlice(self, *specs, **keys)
    622                 elif order != order2:
    623                     raise CDMSError, 'grid, order options not compatible.'
--> 624             result = result.reorder(order).regrid(grid)
    625             if raw == 0:
    626                 return result

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/avariable.pyc in reorder(self, order)
    956             return self
    957         axes = self.getAxisList()
--> 958         permutation = order2index(axes, order)
    959         if permutation == range(len(axes)):
    960             return self

/Users/fries2/bin/uvcdat/2.4-rc2/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cdms2/avariable.pyc in order2index(axes, order)
   1587             if item >= n:
   1588                 raise CDMSError, 'Index %d out of range in order %s' %\
-> 1589                                  (item,order)
   1590             permutation[pos] = item
   1591             pos += 1

CDMSError: Index 3 out of range in order 0321

which is what the GUI does to reorder the dimensions.

Copy link

@doutriaux1 I can just disable the auto-squeeze in the GUI; that would resolve the issue easily enough.

Copy link
Contributor Author

an option to turn it on/off is better, so if user run into this werid case they can turn it off. I think users prefer squeeze=1 by default.

Copy link

Yeah; it looks like there's a preference to toggle it on/off globally for the app. I think a checkbox in the variable editor would be simple enough to add. I'll take a quick whack at it.

Copy link

OK, accidentally pushed to uvcdat-master, but this issue should now be resolved. I added a "Squeeze Dimensions" checkbox into the load variable window, and now the indices for the order argument are calculated based off of whether squeeze is set or not (and will correctly eliminate squeezed axes from the order list).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants