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

Dimension related problems in simple_n_dim_visualizer #54

Open
ssomnath opened this issue Sep 17, 2020 · 4 comments
Open

Dimension related problems in simple_n_dim_visualizer #54

ssomnath opened this issue Sep 17, 2020 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists help wanted Extra attention is needed
Milestone

Comments

@ssomnath
Copy link
Member

ssomnath commented Sep 17, 2020

Raising issue on behalf of svenson. Bug reported in google groups:

I've downloaded jupyter notebook for 3D Spectral Image example from https://pycroscopy.github.io/USID/auto_examples/plot_3D_spectral_image.html

Unfortunately, when I try to execute the following commands:
usid.plot_utils.use_nice_plot_params()
h5_main.visualize()

I got the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-7-032b56d332ff> in <module>
      1 usid.plot_utils.use_nice_plot_params()
----> 2 h5_main.visualize()

~/miniconda3/lib/python3.8/site-packages/pyUSID/io/usi_data.py in visualize(self, slice_dict, verbose, **kwargs)
   1045 
   1046         # If data has at least one dimension with 2 values in pos. AND spec., it can be visualized interactively:
-> 1047         return simple_ndim_visualizer(data_slice, pos_dims, spec_dims, verbose=verbose, **kwargs)
   1048 
   1049     def reduce(self, dims, ufunc=da.mean, to_hdf5=False, dset_name=None, verbose=False):

~/miniconda3/lib/python3.8/site-packages/sidpy/viz/jupyter_utils.py in simple_ndim_visualizer(data_mat, pos_dims, spec_dims, spec_xdim, pos_xdim, verbose)
     53         for item in parm:
     54             if not isinstance(item, Dimension):
---> 55                 raise TypeError('Expected items in {} to be of type: Dimension'.format(parm_name))
     56         if len(parm) > 2:
     57             raise NotImplementedError('Currently not able to handle more than 2 position or spectroscopic dimensions.'

TypeError: Expected items in pos_dims to be of type: Dimension

OS: Ubuntu Bionic

How the problem could be solved?

@ssomnath ssomnath added bug Something isn't working help wanted Extra attention is needed labels Sep 17, 2020
@ssomnath
Copy link
Member Author

This bug seems to be arising from differences in pyUSID's and sidpy's Dimension classes I think. @rajgiriUW - have you come across this error?

For now, we may want to fix this in simple_n_dim_visualizer.

In the long run we want pyUSID.USIDataset to utilize the Visualizers that @gduscher has put together instead.

@rajgiriUW
Copy link
Member

Yep, if I'm reading this correctly I think it's related to this:
#34

Which means unless that fix is pushed to latest version of PyUSID it will still fail. I think the current version is behind.

@ssomnath
Copy link
Member Author

Ah! of course. We have already discussed and even fixed this. We're just waiting for some cleanup on the Dimension and Dataset classes before 0.0.3 of sidpy is released. After that, I will update pyUSID requirements to only pick up sidpy 0.0.3 or newer. I will mark this issue as a duplicate but will leave this open as a reminder that we need to push out 0.0.3

@ssomnath ssomnath added the duplicate This issue or pull request already exists label Sep 17, 2020
@ssomnath ssomnath added this to the Version 0.0.3 milestone Sep 17, 2020
@ssomnath
Copy link
Member Author

Posting on behalf of Svensen7 (original issue on Google groups)

Unfortunately, it solves only a half of the problem.
Now I could see only 'initial' static visualization. If I change sliders, nothing happens.

And the following warning is shown:

Supported dimension_types for plotting are only: ['UNKNOWN', 'SPATIAL', 'RECIPROCAL', 'SPECTRAL', 'TEMPORAL'] 
Setting DimensionTypes to UNKNOWN 
Supported dimension_types for plotting are only: ['UNKNOWN', 'SPATIAL', 'RECIPROCAL', 'SPECTRAL', 'TEMPORAL'] 
Setting DimensionTypes to UNKNOWN 
Supported dimension_types for plotting are only: ['UNKNOWN', 'SPATIAL', 'RECIPROCAL', 'SPECTRAL', 'TEMPORAL'] 
Setting DimensionTypes to UNKNOWN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants