gf4-project icon indicating copy to clipboard operation
gf4-project copied to clipboard

in Mac, there is no default ascender

Open HaveF opened this issue 2 years ago • 10 comments

Hi, Thomas, ❤️

Thanks for this interesting project.

Report a issue:

When I first run in Mac

╰─$ python gf4.pyw
import_plugins: local_poly_fit plugin: No module named 'localreg'
import_plugins: local_poly_fit plugin: No module named 'localreg'
Traceback (most recent call last):
  File "/Users/mac/Desktop/proj/gf4-project/gf4/gf4.pyw", line 2634, in <module>
    cmdwindow(plotmgr)
  File "/Users/mac/Desktop/proj/gf4-project/gf4/cmdwin.py", line 444, in cmdwindow
    create_buttons_pack(win, plotmgr)
  File "/Users/mac/Desktop/proj/gf4-project/gf4/cmdwin.py", line 371, in create_buttons_pack
    sz = adjust_font_size(NEWFONT, ascender)
UnboundLocalError: local variable 'ascender' referenced before assignment

I found just because there is no default ascender for Mac, I just simple give ascender = 11 to make it pass.

https://github.com/tbpassin/gf4-project/blob/f0731cd929ca54f9b59ad309b43f7dd0358cc6d4/gf4/cmdwin.py#L371

HaveF avatar Nov 17 '23 01:11 HaveF

BTW, as you said in the doc Examples like this are usually much harder to describe than to do.

Perhaps you could record a video the next time you research some two-dimensional data; I believe that would be interesting and valuable assets for this interesting project

HaveF avatar Nov 17 '23 01:11 HaveF

Thanks for your report. With no Mac, I haven't been able to test on one, so your report is especially helpful. I will fold it into the devel branch shortly.

tbpassin avatar Nov 17 '23 01:11 tbpassin

BTW, as you said in the doc Examples like this are usually much harder to describe than to do.

Perhaps you could record a video the next time you research some two-dimensional data; I believe that would be interesting and valuable assets for this interesting project

I keep thinking I should do that. It would be new to me so I don't have a work flow for making an animation of video. I'll see, but no promises!

tbpassin avatar Nov 17 '23 01:11 tbpassin

import_plugins: local_poly_fit plugin: No module named 'localreg'

I don't know if localreg is available for the Mac. It's not my code. It seems like it should be because I think the developer uses standard libraries, scipy if I remember. It's not in the list of requirements because the plugin is just something I'm experimenting. I probably should have removed all my plugins before committing to the devel branch.

You could just remove the local_poly_fit plugin, although no harm should be done the way it is. Good thing I didn't make it part of the core so far!

tbpassin avatar Nov 17 '23 01:11 tbpassin

Thanks for this interesting project.

Thank you! I have used one or another version of the program for so long that I hardly know how one would look at 2D data without it. I'm so glad it's interesting to you!

tbpassin avatar Nov 17 '23 01:11 tbpassin

I keep thinking I should do that. It would be new to me so I don't have a work flow for making an animation of video. I'll see, but no promises!

OBS Studio is very easy to use. It's time-consuming to make/edit a video, but if it's just the next time you analyze the data, you can record it while you analyze it, grunt, and record it, and it won't take much of your time. I just feel that this pearl, like Leo editor, is known by too few people.

HaveF avatar Nov 17 '23 03:11 HaveF

I have used one or another version of the program for so long that I hardly know how one would look at 2D data without it. I'm so glad it's interesting to you!

I use Voyager 2 or pygwalker (there are all based on vega/vega lite)to see normal data, for time series data, your gp4 is the only tool I found related.

HaveF avatar Nov 17 '23 03:11 HaveF

OBS Studio is very easy to use.

Someone mentioned that, IIRC. Thanks.

tbpassin avatar Nov 17 '23 04:11 tbpassin

I just feel that this pearl, like Leo editor, is known by too few people.

Ah, that's how I feel about Leo too. I use it a lot, with some plugins and other code I've developed.

tbpassin avatar Nov 17 '23 04:11 tbpassin

UnboundLocalError: local variable 'ascender' referenced before assignment

This is not a Mac problem, but a bug. I didn't provide a default value in case none of the font tests match.

tbpassin avatar Nov 19 '23 04:11 tbpassin