BCDA-APS / mdaviz

Data visualization for mda
https://bcda-aps.github.io/mdaviz/
Other
3 stars 0 forks source link

BUG: test files, some crash the app #107

Closed prjemian closed 1 month ago

prjemian commented 3 months ago

Using mdaviz from main branch, encountered this repeatable error:

========= Selected file: 14BMC_0015.mda in dev_sampler/mda

doPlot called: args=('replace', {'Y': [], 'X': 1})
Traceback (most recent call last):
  File "projects/BCDA-APS/mdaviz/mdaviz/mda_folder.py", line 309, in doFileSelected
    self.handlePlotBasedOnMode()
  File "projects/BCDA-APS/mdaviz/mdaviz/mda_folder.py", line 332, in handlePlotBasedOnMode
    self.doPlot("replace", self.selectionField())
  File "projects/BCDA-APS/mdaviz/mdaviz/mda_folder.py", line 357, in doPlot
    datasets, plot_options = to_datasets(
                             ^^^^^^^^^^^^
  File "/home/prjemian/Documents/projects/BCDA-APS/mdaviz/mdaviz/select_fields_table_view.py", line 241, in to_datasets
    "y_units": y_units,
               ^^^^^^^
UnboundLocalError: cannot access local variable 'y_units' where it is not associated with a value

Here: https://github.com/BCDA-APS/mdaviz/blob/d6e04896d3f8f73fa0a8d7a171861ed058b6522b/mdaviz/select_fields_table_view.py#L241

Perhaps the for ... loop at line 221, which includes assigned y_units, is not run in this case? https://github.com/BCDA-APS/mdaviz/blob/d6e04896d3f8f73fa0a8d7a171861ed058b6522b/mdaviz/select_fields_table_view.py#L221-L225

File in attached zip: 14BMC_0015.zip

prjemian commented 3 months ago

Hrmph. Didn't happen the next time I ran the app and selected this file. Other test files cause crashes. Attaching the bunch of them here.

test_mda_files.zip

Here's another error that crashes the app when the file is selected:

========= Selected file: 2iddf_0106.mda in dev_sampler/mda

doPlot called: args=('replace', {'X': 1, 'Y': [3]})
Traceback (most recent call last):
  File "projects/BCDA-APS/mdaviz/mdaviz/mda_folder.py", line 309, in doFileSelected
    self.handlePlotBasedOnMode()
  File "projects/BCDA-APS/mdaviz/mdaviz/mda_folder.py", line 332, in handlePlotBasedOnMode
    self.doPlot("replace", self.selectionField())
  File "projects/BCDA-APS/mdaviz/mdaviz/mda_folder.py", line 357, in doPlot
    datasets, plot_options = to_datasets(
                             ^^^^^^^^^^^^
  File "projects/BCDA-APS/mdaviz/mdaviz/select_fields_table_view.py", line 222, in to_datasets
    y = detsDict[y_axis]
        ~~~~~~~~^^^^^^^^
KeyError: 3
prjemian commented 3 months ago

I shared a folder on box.com with additional test files.