Skip to content

Minor changes to meet ruff 0.15 standards and fix some preview issues#1185

Open
oerc0122 wants to merge 1 commit intoISISNeutronMuon:protosfrom
oerc0122:ruff-0.15-prev
Open

Minor changes to meet ruff 0.15 standards and fix some preview issues#1185
oerc0122 wants to merge 1 commit intoISISNeutronMuon:protosfrom
oerc0122:ruff-0.15-prev

Conversation

@oerc0122
Copy link
Copy Markdown
Collaborator

Description of work
Miscellaneous changes to meet Ruff 0.l5 specs and fix some of the issues raised by the preview=True

Fixes
N/A

To test
Tests should pass.

@oerc0122 oerc0122 self-assigned this Feb 20, 2026
@oerc0122 oerc0122 added the Technical Debt Legacy code which should be cleaned up. label Feb 20, 2026
@MBartkowiakSTFC
Copy link
Copy Markdown
Collaborator

As far as I can tell, the vector shell plots (in the q vector widget) don't work in this branch. That is, I can show the vectors preview showing the shell population, but the other tab with vector distribution within the shell throws an exception:

2026-02-23 15:13:56,413 - ERROR - process[25453] - main 36 - EXCEPTION:
<class 'numpy.core._exceptions._UFuncOutputCastingError'>
Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
<traceback object at 0x31c6a7080>
Traceback (most recent call last):
  File "MDANSE_GUI/InputWidgets/QVectorsWidget.py", line 257, in set_shell
    self.set_upper_limit(len(vec_dict))
  File "MDANSE_GUI/InputWidgets/QVectorsWidget.py", line 237, in set_upper_limit
    self.set_shell(current_shell, update_limit=False)
  File "MDANSE_GUI/InputWidgets/QVectorsWidget.py", line 285, in set_shell
    for dataset in vector_angular_datasets(self.qvec_config, vec_key):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "MDANSE_GUI/Tabs/Views/PlotDataView.py", line 194, in vector_angular_datasets
    return angular_datasets_from_qarray(q_array, q_weights)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "MDANSE_GUI/Tabs/Views/PlotDataView.py", line 238, in angular_datasets_from_qarray
    counts /= np.sin(mean_angles)
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'

@MBartkowiakSTFC
Copy link
Copy Markdown
Collaborator

I also think that the play button in the trajectory view doesn't work after the changes.

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

Labels

Technical Debt Legacy code which should be cleaned up.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants