psychopy.org | Reference | Downloads | Github

Bug in calibTools.py which affects MonitorCenter.py [plus: need advice on GitHub in order to fix this bug]


#1

Dear all,

we just found a bug in “\monitors\calibTools.py” which affects, among others, the function of MonitorCenter.py.

Symptom: MonitorCenter.py will not show any of the existing calibration files. Any previously created calibration files are, however, correctly loaded when invoking monitors.Monitor() with the name of an existing calibration file.

Cause: The function calibTools.getAllMonitors() only looks for calibration files with the file extension ‘.calib’ which have been replaced by ‘.json’ as of PsychoPy3.

Bug fix: Open the file “\monitors\calibTools.py”. In line 1152 you’ll find the following code:

[1152]      monitorList = glob.glob(os.path.join(monitorFolder, '*.calib'))

Replace this with the following lines, without the leading [#]:

[1152]     if constants.PY3:  
[1153]         ext = ".json"
[1154]     else:
[1155]         ext = ".calib"
[1156]
[1157]     monitorList = glob.glob(os.path.join(monitorFolder, '*'+ext))

That out of the way, I’m unfortunately a total noob to GitHub but would like to contribute this bugfix to the codebase. I have never worked with GitHub so I’m a bit lost. Can someone point me to a ressource describing how to contribute to the PsychoPy project via GitHub?

Best wishes,
Malte


#2

Thanks @BlackyFuchsberger, what version of PsychoPy are you using? In the recent versions, we have:

 monitorList = glob.glob(os.path.join(monitorFolder, '*.calib'))
 if constants.PY3:
     monitorList = glob.glob(os.path.join(monitorFolder, '*.json'))

Also, if you would like to contribute, the documentation is here.


#3

Thanks so much for the update. I cannot name the version from the top of my head but the distribution was installed last Monday as part of a Miniconda install. Probably, we missed the bugfix by a few hours or days.

Also, thanks so much for pointing me to the GitHub related docs.

Best, Malte