Skip to content

make the recarray viewer also handle tabular data (and add save) - #624

Merged
David-Baddeley merged 4 commits into
python-microscopy:masterfrom
David-Baddeley:recarray-view-tweaks
Nov 22, 2020
Merged

make the recarray viewer also handle tabular data (and add save)#624
David-Baddeley merged 4 commits into
python-microscopy:masterfrom
David-Baddeley:recarray-view-tweaks

Conversation

@David-Baddeley

Copy link
Copy Markdown
Contributor

Addresses issue #584.

Proposed changes:

Makes the existing recarray view handle tabular data as well and adds a save button.

  • currently implemented as a drop in replacement for the couple of recarray views
  • launchable by clicking on a tabular item in the pipeline

TODOs:

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@codecov

codecov Bot commented Nov 21, 2020

Copy link
Copy Markdown

Codecov Report

Merging #624 (bf6cae3) into master (2e4edb9) will decrease coverage by 0.01%.
The diff coverage is 1.69%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #624      +/-   ##
=========================================
- Coverage    8.29%   8.27%   -0.02%     
=========================================
  Files         848     849       +1     
  Lines       97595   97989     +394     
=========================================
+ Hits         8093    8110      +17     
- Misses      89502   89879     +377     
Impacted Files Coverage Δ
PYME/DSView/modules/blobFinding.py 0.00% <0.00%> (ø)
PYME/LMVis/triBlobs.py 2.29% <0.00%> (ø)
PYME/recipes/recipeGui.py 0.00% <0.00%> (ø)
PYME/ui/recArrayView.py 0.00% <0.00%> (ø)
PYME/IO/tabular.py 55.71% <9.09%> (-0.94%) ⬇️
PYME/config.py 46.80% <0.00%> (-9.83%) ⬇️
PYME/Acquire/Hardware/Camera.py 30.14% <0.00%> (-0.38%) ⬇️
PYME/LMVis/VisGUI.py 0.00% <0.00%> (ø)
PYME/LMVis/visCore.py 0.00% <0.00%> (ø)
PYME/Acquire/Spooler.py 71.90% <0.00%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e4edb9...bf6cae3. Read the comment docs.

@zacsimile

zacsimile commented Nov 21, 2020

Copy link
Copy Markdown
Member

I gave it a whirl. Pretty cool! A few thoughts.

  • The title should read Data table - <Data Source Name>. This is especially important if you launch more than one of these views at a time.
  • The window that pops up is too large. Need to drag around a bit to resize, kind of inconvenient.
  • Save should default to .csv, as I think this is the more common use case. You can already save to .hdf from the File menu.
  • I wish I could click on the line in between tiles (and the area between the line and the data source name) to launch the tabular view. It's slightly annoying to have to double-click just on the data source name only, and I think this will make this feature less discoverable. A bigger target would be helpful.
  • It would be nice if this worked on the Data pipeline view down the left side of the viewing window.
  • A bit weird that the values all appear editable, but clearly are not
  • Clicking on a column to sort would be nice

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@David-Baddeley

David-Baddeley commented Nov 22, 2020

Copy link
Copy Markdown
Contributor Author

Save should default to .csv, as I think this is the more common use case. You can already save to .hdf from the File menu.
Might arguably be the more common at present, but I'd like, e.g. a save results, open in jupyter workflow to become more common. HDF saving is going to give you much better performance (both saving and opening again) and is probably the best option if you are using either jupyter or matlab for subsequent processing, .csv is the excel fallback. Note that most use cases do not currently have any saving available from the menu.

I wish I could click on the line in between tiles (and the area between the line and the data source name) to launch the tabular view. It's slightly annoying to have to double-click just on the data source name only, and I think this will make this feature less discoverable. A bigger target would be helpful.
Should only need a single-click on the label. Could look at making lines clickable too, but might be a decent bit of work (and hard to maintain across different recipe viewers). Ultimately clicking on a label in the recipe is a somewhat secondary use case - we'd ideally pop this up or add as a tab whenever we generate results that it makes sense for the user to see (e.g. Analysis-->Measure objects should pop up one of these with the results. I.E discoverability should be less of an issue.

It would be nice if this worked on the Data pipeline view down the left side of the viewing window.
A bit weird that the values all appear editable, but clearly are not
Will call these two lowish priority for now.

Clicking on a column to sort would be nice
Needs some form of caching for acceptable performance (and a way of sorting the row labels). Punting until we integrate more of #594

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Comment thread PYME/ui/recArrayView.py
bSave = wx.BitmapButton(self, -1, wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE), style=wx.NO_BORDER | wx.BU_AUTODRAW, name='Save')
bSave.Bind(wx.EVT_BUTTON, self.OnSave)
tool_sizer.Add(bSave)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293: blank line contains whitespace

Comment thread PYME/ui/recArrayView.py
sizer = wx.BoxSizer(wx.VERTICAL)

tool_sizer = wx.BoxSizer(wx.HORIZONTAL)
bSave = wx.BitmapButton(self, -1, wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE), style=wx.NO_BORDER | wx.BU_AUTODRAW, name='Save')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501: line too long (135 > 130 characters)

Comment thread PYME/ui/recArrayView.py

self.grid = RecarrayTableGrid(self, recarray)
sizer = wx.BoxSizer(wx.VERTICAL)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293: blank line contains whitespace

Comment thread PYME/ui/recArrayView.py
class ArrayTableGrid(gridlib.Grid):
def __init__(self, parent, data):
gridlib.Grid.__init__(self, parent, -1, size = (-1,-1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293: blank line contains whitespace

Comment thread PYME/ui/recArrayView.py

class ArrayTableGrid(gridlib.Grid):
def __init__(self, parent, data):
gridlib.Grid.__init__(self, parent, -1, size = (-1,-1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E231: missing whitespace after ','

Comment thread PYME/ui/recArrayView.py

class ArrayTableGrid(gridlib.Grid):
def __init__(self, parent, data):
gridlib.Grid.__init__(self, parent, -1, size = (-1,-1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E251: unexpected spaces around keyword / parameter equals

Comment thread PYME/ui/recArrayView.py

def GetValue(self, row, col):
return str( self.recarray[row][col] )
return str(self.recarray[row][col] )

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E202: whitespace before ')'

Comment thread PYME/ui/recArrayView.py
import wx
import wx.grid as gridlib
import wx.grid as gridlib
import numpy as np

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401: 'numpy as np' imported but unused

Comment thread PYME/recipes/recipeGui.py
mode = 'lite'

dv = ViewIm3D(outp, mode=mode, glCanvas=self.recipes.dsviewer.glCanvas)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293: blank line contains whitespace



vObjFit = recArrayView.recArrayPanel(self.dsviewer, self.objFitRes[chnum]['fitResults'])
vObjFit = recArrayView.ArrayPanel(self.dsviewer, self.objFitRes[chnum]['fitResults'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E303: too many blank lines (2)

@David-Baddeley
David-Baddeley merged commit 6ea2dc4 into python-microscopy:master Nov 22, 2020
@David-Baddeley
David-Baddeley deleted the recarray-view-tweaks branch January 25, 2021 21:25
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 this pull request may close these issues.

2 participants