thartbm / PyVMEC

A Python-based GUI to create and run visuo-motor experiments.
GNU General Public License v3.0
1 stars 3 forks source link

Exp.py looks like a script, not a module #3

Closed thartbm closed 6 years ago

thartbm commented 6 years ago

After importing some modules (and declaring some globals...) Exp.py starts executing stuff directly. This is not how you structure code.

It looks like the first few lines define the workspace on the monitor. This needs to be done, but it needs to be added to the CFG (or cfg) dictionary that it should already have... by a function:

def addWorkspaceLimits(cfg): screen_width = root.winfo_screenwidth() screen_height = root.winfo_screenheight()

trimmed_width = int((float(2)/float(3))float(screen_width)) trimmed_height = int((float(2)/float(3))float(screen_height))

if (trimmed_width < 2*trimmed_height): active_height = trimmed_width/2 else: active_height = trimmed_height/2

THIS SEEMS INCORRECT TO ME

active_width = trimmed_width max_distance = active_height

ADD THE STUFF TO CFG

cfg['screen'] = {} cfg['screen']['width'] = ... cfg['screen']['height'] = ... return(cfg)

juliusjgm12 commented 6 years ago

I think I've done it how you wanted it? I'm not sure, i'll come in this week probably Wednesday to make sure if what I've got so far is what you wanted. I'll also push the changes i've made so far today so you can check it yourself when you have the time.