Skip to content

Update fit progress plot for numpy 2 compat, and resize it to show labels#1651

Open
barentine wants to merge 1 commit into
python-microscopy:masterfrom
barentine:numpy2progGraph
Open

Update fit progress plot for numpy 2 compat, and resize it to show labels#1651
barentine wants to merge 1 commit into
python-microscopy:masterfrom
barentine:numpy2progGraph

Conversation

@barentine

Copy link
Copy Markdown
Member

Addresses issue: progGraph is non-op on numpy2, and adding labels while we are here

Traceback

DEBUG:PYME.DSView.modules.LMAnalysis:use_cluster: newStyle=True, tq=None
ERROR:PYME.ui.mytimer:Error in timer callback
Traceback (most recent call last):
  File "C:\Userfiles\andrew\code\python-microscopy\PYME\ui\mytimer.py", line 48, in Notify
    a()
  File "C:\Userfiles\andrew\code\python-microscopy\PYME\DSView\modules\LMAnalysis.py", line 724, in refresh_analysis
    self.progPan.draw()
  File "C:\Userfiles\andrew\code\python-microscopy\PYME\LMVis\progGraph.py", line 46, in draw
    print((float(numpy.diff(ed[:2]))))
           ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: only 0-dimensional arrays can be converted to Python scalars
DEBUG:PYME.DSView.modules.LMAnalysis:use_cluster: newStyle=True, tq=None

Is this a bugfix or an enhancement?
both
Proposed changes:

  • un-hardcode plot size. Plot looks visually worse since it is smaller, but this makes room for labels and adds the ability to read the right ticks
  • add y labels
  • remove print statement
image

Checklist:
The below is a list of things what will be considered when reviewing PRs. It is not prescriptive, and does not
imply that PRs which touch any of these will be rejected but gives a rough indication of where there is a potential
for hangups (i.e. factors which could turn a 5 min review into a half hour or longer and shunt it to the bottom
of the TODO list).

  • Does the PR avoid variable renaming in existing code, whitespace changes, and other forms of tidying? [There is a place for code tidying, but it makes reviewing
    much simpler if this is kept separate from functional changes. The auto-formatting performed by some editors is particulaly egregious and can lead to files with thousands
    of non-functional changes with a few functional changes scattered amoungst them]

If an enhancement (or non-trivial bugfix):

  • Has this been discussed in advance (feature request, PR proposal, email, or direct conversation)?
  • Does this change how users interact with the software? How will these changes be communicated?
  • Does this maintain backwards compatibility with old data?
  • Does this change the required dependencies?
  • Are there any other side effects of the change?

@David-Baddeley

Copy link
Copy Markdown
Contributor

My only concern (which is why it's stayed broken this long) is that the graph is significantly less useful when shrunk down that much. I wonder if we could find some way to make it a bit more compact ... Maybe putting the axis labels in the title or a legend (although this is also likely to cause issues).

@barentine

Copy link
Copy Markdown
Member Author

I know what you mean. I remember messing with it a bit and not being totally satisfied. But at least with this someone can see what it means and expand it if they're interested. Also clears up the stderr/stdout

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