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 throws ValueError #153

Open
tjduigna opened this issue Apr 20, 2019 · 2 comments
Open

GUI throws ValueError #153

tjduigna opened this issue Apr 20, 2019 · 2 comments
Labels
Bug Usage is unexpected or incorrect Visualizations Feature requests related to visualization functionality

Comments

@tjduigna
Copy link
Contributor

tjduigna commented Apr 20, 2019

Describe the bug
Occasionally when using the Distance functionality in the GUI, depending on some previous interactions with the scene, the code will throw a ValueError which gets printed below the widget.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/github/exatomic/exatomic/widgets/widget.py in _atom_df(c)
    504             c.value = not c.value
    505             if c.value:
--> 506                 self._update_output(out)
    507                 #link((self.scenes[0].selected, 'value'), (selected, 'value'))
    508             else:

~/github/exatomic/exatomic/widgets/widget.py in _update_output(self, out)
    471             idx[sdx] = [int(''.join(filter(lambda x: x.isdigit(), i))) for i in scn.selected['idx']]
    472             if len(idx[sdx])%2 != 0:
--> 473                 raise ValueError("Must select an even number of atoms. Last selected atom has been truncated.")
    474             atom_coords = self._df[sdx].atom.groupby('frame').get_group(scn.frame_idx). \
    475                                reset_index(drop=True).loc[[i for i in idx[sdx]], ['x', 'y', 'z']]

ValueError: Must select an even number of atoms. Last selected atom has been truncated.

To Reproduce
Relies on multiple GUI interactions (may be intermittent). Easier to reproduce when you have multiple universes in a single widget.

Expected behavior
I think that critical errors for the computational kernel that prevent functionality in the GUI should be handled and logged but not displayed to the front end.

Desktop (please complete the following information):

  • OS: WS Linux 4.4.0-17134-Microsoft
  • Browser: Chrome (Windows 10)
  • Version: 73.0.3683.103

Additional context
This may only be reproducible in the case with multiple universes per UniverseWidget

@herbertludowieg
Copy link
Member

I'll look into this. I think what I initially came up with was too unstable, @adamphil also showed some possible issues with the visualization in the UniverseWidget.

@herbertludowieg
Copy link
Member

I think it might be a good idea for the time being to deprecate the distance stuff. I would like to fix it but don't have the time to do it right now.

@tjduigna tjduigna added Bug Usage is unexpected or incorrect Visualizations Feature requests related to visualization functionality labels Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Usage is unexpected or incorrect Visualizations Feature requests related to visualization functionality
Projects
None yet
Development

No branches or pull requests

2 participants