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

StructureViewer crashes when Selection is out of bounds #413

Closed
danielhollas opened this issue Dec 10, 2022 · 2 comments · Fixed by #371
Closed

StructureViewer crashes when Selection is out of bounds #413

danielhollas opened this issue Dec 10, 2022 · 2 comments · Fixed by #371

Comments

@danielhollas
Copy link
Contributor

Automated report

This issue was created with the app's automated bug reporting feature.
Attached to this issue is the full traceback as well as an environment
fingerprint that contains information about the operating system as well as all
installed libraries.

Additional comments (optional):

To reproduce, go to the Selection tab, and try to select for an atom that is not there, e.g. atom number 10 in the methane molecule. The exception appears when you click the "Apply selection" button

obrazek

Attachments

Traceback
/opt/conda/lib/python3.8/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    684                 # Send new state to front-end
    685                 self.send_state(key=name)
--> 686         super(Widget, self).notify_change(change)
    687 
    688     def __repr__(self):

/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

~/apps/aiidalab-widgets-base/aiidalab_widgets_base/viewers.py in _observe_selection_2(self, _)
   1061     @observe("selection")
   1062     def _observe_selection_2(self, _=None):
-> 1063         self.selection_info.value = self.create_selection_info()
   1064 
   1065 

~/apps/aiidalab-widgets-base/aiidalab_widgets_base/viewers.py in create_selection_info(self)
   1002         # Find geometric center.
   1003         geom_center = print_pos(
-> 1004             np.average(self.structure[self.selection].get_positions(), axis=0)
   1005         )
   1006 

/opt/conda/lib/python3.8/site-packages/ase/atoms.py in __getitem__(self, i)
   1073         atoms.arrays = {}
   1074         for name, a in self.arrays.items():
-> 1075             atoms.arrays[name] = a[i].copy()
   1076 
   1077         atoms.constraints = conadd

IndexError: index 9 is out of bounds for axis 0 with size 5
Environment fingerprint
eNplWFtv67gR_iuB-7oyLMmxk7wt0u5DcdI9bfa0KIrigKJomTFFMiQVR1mc_97hzNBWuvCTPg7JuXxzoX9fvakQtbOrh_qnlTci
HVwYVw-_r0SQR52UTFNQq4f_rHbbTqfVT6u_fPll9V8QndPR2e-X3at2fbeuWxC4Qn-qt_vqWzfZNN08P329-SXom19luqm3N_X-
YbN_aJqbb7893jSbpln9gDOFPIlBRbxe615U0uXLV_V6t76HoxH87oIUAG4A3BTQiA6gplnv1_UCq0QaXfRKVmcXTvIotMWdn2SU
YXDdLGEd_fBH4bPuB5Vi1YlImm15l6u8PmW9duAIhsL4ip5p6QzTv6hxxjPvGVFjpyWec0eIjbo5ptEwhgZ63-sQ-bZtRnJs3lTl
RTricQ1tDoOzTSUPB52dUcO9m89w1WnbaztEWm94Pbgznt6scwDJMtD5nj9tLcPsk0OZW7oqpuB0n48BLXeIzFZWg7IqiOQCytZ4
fHKjlucAZCo24AkpoU0QsxrV6CD6UhjDBiGE96IyDfoU1BdhdsG6hGLkjs4oIbMjbtcUrc6d1BF126IJ3as3vKMGG7O6XXDJaE_R
2ONtj3CIenQWLDNFts7HybyQnDNZX4g3Xir_YIBUIWlyPRAaQtygHEUDnHFLUofhbUEK4GToVWLlN4xElSoL9BFGf6iAlvAdRzVq
e3CfFJc6yCmSysR_abQ8AbBnUuM3ZNPojUqUnBuI5HLJHvRQHbRRi9Sitei1tahFzhGMqXTGBTEKDsItQrYX6J-agodAxTldHYXt
DTBvwXW603UvbPwOMXfSSk4pKaLQHgNI_BuC8MdseAt2UxBmaYpm5KBHrEvEIeBvtrAXErjHZSTL9KqbBvRgRlpEoNIwbW-zkYgd
pqj699Gwqwn0QUHoyYclKr2OQKYO5Vq0488vwg4OReB3l2Vs9EW3hhO2n8xZS05hsC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FYNuA71M8siL7vw6D6OiRt2UsuZnKB2pEIp2QipCkynkpn
z_Oj_Nz3__wu-EFpG_iUezZOf8q1f2-flLiSyBWTPKiexGzJMZkJguXr_je-MICRi5pNClz1BEI2cyCTHftpmzjOSuCL1VcWwafu
vwSgTOUE_flXSABWiXL5GncT7GvUgxek4b0j0FMfMAxRs_0C11ccG_f376gnQop3zg66opHSzPGCnMnNstIjgliFLKd3cIvk5gFy
nUkD8KVuGkz47fLRdGxwWY8zocZHt_t-fL8NxJjMqsZ8HzIkziyI4FvpZlSGzodFyq8lJVxudNHkvu8hVRakiJCt42wRbiNoQzty
lRowzky_IWjUqdfGkh9-s9QM8wgTS_BRGPi64Jj4zJl_q1K26MR2XyoH4UI59JKHhymnTPlMncijo_J_I0QRPoHo2K-p0cRbM2PK
IvE8oOCxRQ-2eTx48SKnwmXdHq22XkamlHfDWYc_zaQBuTCLncq1JMCAxQaascm7a9p1qQ4bn0H562oBhPecbgUo4vGkiR_EyYsR
OzmArw1hK9K2EhuZguz-4dQ--pmqzOj4ieinxmXya-6D34VybDMzqKu8IQKhUw5PMlO_p-7UfKOnI9JIZOhsarW25jiEHVU3Hx_I
dviNt3nDfzPzBl8sUNHzAjCUrZLDvZ_FoVUI80npGV2yOusxF5fM7jZx5JcP_kD1CkKw52To8cmCmY6zN1MTsADkFvqbZy8fingG
ScF53yTQOjoGfj-JAfChTss0jy2LuhuCiT4yxhwrz81YFSqsM3KM87DUHKgvL898aG_6k4H5Uif_OThYbV6v87c8uW8ixru4sfcZ
Ha9hkeN6n0lXzpe-qq67OOeDMDNRfP3A_tffl_bPXjx_8Ad1VwzQ==

By submitting this issue I confirm that I am aware that this information can
potentially be used to determine what kind of calculation was performed at the
time of error.

@yakutovicha
Copy link
Member

I think this might be fixed as a part of #371. @superstar54 correct me if I am wrong.

@superstar54
Copy link
Member

Yes, this is fixed in #371.

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

Successfully merging a pull request may close this issue.

3 participants