Skip to content

BF: Fix error detecting eyetracker config files #5883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

TEParsons
Copy link
Contributor

Fixes #5880

@TEParsons TEParsons requested a review from mdcutone September 6, 2023 13:27
@TEParsons
Copy link
Contributor Author

@peircej peircej merged commit e75aa18 into psychopy:release Sep 7, 2023
@peircej
Copy link
Member

peircej commented Sep 7, 2023

JWP: I'm concerned that import __file__ from one file to another might do BadThings:tm:. Suggesting this instead (which @mdcutone will implement/test)

Todds:

psychopy/iohub/devices/eyetracker/hw/gazepoint/init.py

from psychopy_eyetracker_tobii.tobii import __file__

in psychopy/iohub/devices/deviceConfigValidation.py

    validation_module = importlib.import_module(relative_module_path)
    validation_dir_path = os.path.dirname(validation_module.__file__)
    # get config file from subdiretory path
    validation_file_path = os.path.join(validation_dir_path,
                                        'supported_config_settings_{0}.yaml'.format(device_class_name.lower()))

suggested:

in psychopy/iohub/devices/eyetracker/hw/tobii/init.py

from psychopy_eyetracker_tobii import tobii
import pathlib
yaml_file = pathlib.Path(tobii.__file__).parent / 'supported_config_settings_{0}.yaml'.format(device_class_name.lower())

in psychopy/iohub/devices/deviceConfigValidation.py

validation_module = importlib.import_module(relative_module_path)
validation_file_path = validation_module.yaml_file

@TEParsons TEParsons deleted the release-iohub-yaml branch October 4, 2023 10:08
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