pycroscopy / pycroscopy/sidpy

Dimension related problems in simple_n_dim_visualizer

Open
#54 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug duplicate help wanted
Dominant language
Jupyter Notebook
Stars
12
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the 3D Spectral Image example and the h5_main.visualize() call. Inspect simple_ndim_visualizer in sidpy/viz/jupyter_utils.py and its caller in usi_data.py, focusing on the expected Dimension values in pos_dims and spec_dims; done means the example visualizes without the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.