Skip to content

Commit

Permalink
RF: Removed some unused iohub device config options
Browse files Browse the repository at this point in the history
RF: Also removed the IOHUB_DATE type from iohub and all yaml files
  • Loading branch information
isolver committed Mar 17, 2021
1 parent b5cf353 commit a1199c0
Show file tree
Hide file tree
Showing 20 changed files with 82 additions and 497 deletions.
28 changes: 1 addition & 27 deletions psychopy/iohub/devices/default_device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,4 @@ DeviceClass:
# Some device implementations will use this value to determine
# the appropriate logic to be run for a given device model supported by the ioHub Device class.
model_name: N/A
# The model_number can be used to hold a string representation of the model number of the
# eye tracker being used, assuming a model number is provided by the manufacturer.
model_number: N/A
# manufacturer_name can be used to store the name of the maker of the
# device being used. This is for informational purposes only.
manufacturer_name: N/A
# serial_number can be used to store the unique serial number of the eye tracking
# device being used. This is for informational purposes only. The serial number should be in
# a string representation.
serial_number: N/A
# manufacture_date can be used to store the date of manufacture of the eye tracking
# device being used if it is provided by the eye tracker manufacturer.
# This is for informational purposes only. The serial number should be in
# a string representation using the format DD-MM-YYYY.
manufacture_date: DD-MM-YYYY
# software_version can be used to store the native device API / SDK interface
# being used by the ioHub common eye tracker interface on the back end.
# This is generally for informational purposes only.
software_version: N/A
# hardware_version can be used to store the native device's hardware version
# number if device models also include a version or revision number by the supplier.
# This is generally for informational purposes only.
hardware_version: N/A
# firmware_version can be used to store the native device's firmware version
# if a device provides such information.
# This is generally for informational purposes only.
firmware_version: N/A
manufacturer_name: unknown
28 changes: 2 additions & 26 deletions psychopy/iohub/devices/deviceConfigValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,22 +344,6 @@ def isValidIpAddress(config_param_name, value, valid_value):
raise IpValueError(config_param_name, value)


def isValidDateString(config_param_name, value, valid_value):
try:
if value == 'DD-MM-YYYY':
return value
day, month, year = value.split('-')
if int(day) < 1 or int(day) > 31:
raise DateStringValueError(config_param_name, value)
if int(month) < 1 or int(month) > 12:
raise DateStringValueError(config_param_name, value)
if int(year) < 1900 or int(year) > 2013:
raise DateStringValueError(config_param_name, value)
return value
except Exception:
raise DateStringValueError(config_param_name, value)


def isValidList(config_param_name, value, constraints):
try:
min_length = constraints.get('min_length', 1)
Expand Down Expand Up @@ -406,23 +390,15 @@ def isValueValid(config_param_name, value, valid_values):
IOHUB_BOOL=isBool,
IOHUB_FLOAT=isValidFloat,
IOHUB_INT=isValidInt,
IOHUB_NUMBER=isValidNumber,
IOHUB_LIST=isValidList,
IOHUB_RGBA255_COLOR=isValidRgb255Color,
IOHUB_IP_ADDRESS_V4=isValidIpAddress,
IOHUB_DATE=isValidDateString)
IOHUB_IP_ADDRESS_V4=isValidIpAddress)
###############################################

# load a support_settings_values.yaml


def loadYamlFile(yaml_file_path, print_file=False):
def loadYamlFile(yaml_file_path):
yaml_file_contents = yload(open(yaml_file_path, 'r'), Loader=yLoader)
# if print_file:
# print 'yaml_file_contents:'
# print 'file: ',yaml_file_path
# print 'contents:'
# pprint(yaml_file_contents)
return yaml_file_contents

_current_dir = module_directory(isValidString)
Expand Down
39 changes: 1 addition & 38 deletions psychopy/iohub/devices/display/default_display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,44 +98,7 @@ Display:
#
auto_report_events: False

# The Display device model name can be specified here.
# It is not used by the ioHub, so is FYI only.
#
model_name: N/A

# The Display device model number can be specified here.
# It is not used by the ioHub, so is FYI only.
#
model_number: N/A

# The Display device manufacturer's name can be specified here.
# It is not used by the ioHub, so is FYI only.
#
manufacturer_name: N/A

# The Display device serial number can be specified here.
# It is not used by the ioHub, so is FYI only.
#
serial_number: N/A

# The date of manufactiurer for the Display device
# can be specified here. It is not used by the ioHub,
# so is FYI only.
#
manufacture_date: DD-MM-YYYY

# The Display device's hardware version can be specified here.
# It is not used by the ioHub, so is FYI only.
#
hardware_version: N/A

# If the Display devicehas firmware, its revision number
# can be indicated here.
# It is not used by the ioHub, so is FYI only.
#
firmware_version: N/A

# software_version: The device driver and / or SDK software version number.
# This field is not used by ioHub, so is FYI only.
#
software_version: N/A
manufacturer_name: N/A
49 changes: 9 additions & 40 deletions psychopy/iohub/devices/display/supported_config_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ Display:
origin: [ center , top_left , bottom_left]
physical_dimensions:
width:
IOHUB_NUMBER:
min: 1
max: 2048
IOHUB_FLOAT:
min: 1.0
max: 2048.0
required: True
height:
IOHUB_NUMBER:
min: 1
max: 2048
IOHUB_FLOAT:
min: 1.0
max: 2048.0
required: True
unit_type: [ mm, cm, inch ]
default_eye_distance:
surface_center:
IOHUB_NUMBER:
min: 1
max: 2048
IOHUB_FLOAT:
min: 1.0
max: 2048.0
required: True
unit_type: [ mm, cm, inch ]
psychopy_monitor_name:
Expand All @@ -41,39 +41,8 @@ Display:
auto_report_events: False
event_buffer_length: 0
monitor_event_types:
model_name:
IOHUB_STRING:
min_length: 1
max_length: 32
default: N/A
model_number:
IOHUB_STRING:
min_length: 1
max_length: 16
default: N/A
manufacturer_name:
IOHUB_STRING:
min_length: 1
max_length: 64
default: N/A
serial_number:
IOHUB_STRING:
min_length: 1
max_length: 32
default: N/A
manufacture_date: IOHUB_DATE
software_version:
IOHUB_STRING:
min_length: 1
max_length: 8
default: N/A
hardware_version:
IOHUB_STRING:
min_length: 1
max_length: 8
default: N/A
firmware_version:
IOHUB_STRING:
min_length: 1
max_length: 8
default: N/A
43 changes: 0 additions & 43 deletions psychopy/iohub/devices/experiment/default_experiment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,48 +58,5 @@ Experiment:
#
event_buffer_length: 128

# The device manufacturer's name.
# It is not used by the ioHub, so is FYI only.
#
manufacturer_name: N/A

# The device number to assign to the device.
# Device_number is not used by this device type.
#
device_number: 0

# The serial number for the specific isnstance of device used
# can be specified here. It is not used by the ioHub, so is FYI only.
#
serial_number: N/A

# manufacture_date: The date of manufactiurer of the device
# can be specified here. It is not used by the ioHub,
# so is FYI only.
#
manufacture_date: DD-MM-YYYY

# The device model name can be specified here.
# It is not used by the ioHub, so is FYI only.
#
model_name: N/A

# The device model number can be specified here.
# It is not used by the ioHub, so is FYI only.
#
model_number: N/A

# The device driver and / or SDK software version number.
# This field is not used by ioHub, so is FYI only.
software_version: N/A

# The device's hardware version can be specified here.
# It is not used by the ioHub, so is FYI only.
#
hardware_version: N/A

# If the device has firmware, its revision number
# can be indicated here. It is not used by the ioHub, so is FYI only.
#
firmware_version: N/A

35 changes: 1 addition & 34 deletions psychopy/iohub/devices/experiment/supported_config_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,5 @@ Experiment:
monitor_event_types:
IOHUB_LIST:
valid_values: [ MessageEvent, LogEvent ]
min_length: 2
max_length: 2
device_number:
IOHUB_INT:
min: 0
max: 32
model_name:
IOHUB_STRING:
min_length: 1
max_length: 32
model_number:
IOHUB_STRING:
min_length: 1
max_length: 16
manufacturer_name:
IOHUB_STRING:
min_length: 1
max_length: 64
serial_number:
IOHUB_STRING:
min_length: 1
max_length: 32
manufacture_date: IOHUB_DATE
software_version:
IOHUB_STRING:
min_length: 1
max_length: 8
hardware_version:
IOHUB_STRING:
min_length: 1
max_length: 8
firmware_version:
IOHUB_STRING:
min_length: 1
max_length: 8
max_length: 2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ eyetracker.hw.gazepoint.gp3.EyeTracker:

# Specify the IP address and port that iohub should use to connect to the GP3 tracker.
# Default values are for localhost connection (single PC setup).
# If using 2 computer setup, consider changing device_timer: interval: to 0.001
network_settings:
ip_address: 127.0.0.1
port: 4242
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ eyetracker.hw.gazepoint.gp3.EyeTracker:
save_events: IOHUB_BOOL
stream_events: IOHUB_BOOL
auto_report_events: False
network_settings:
ip_address: IOHUB_IP_ADDRESS_V4
port:
IOHUB_INT:
min: 1
max: 9999
event_buffer_length:
IOHUB_INT:
min: 1
Expand Down
31 changes: 0 additions & 31 deletions psychopy/iohub/devices/keyboard/default_keyboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,38 +83,7 @@ Keyboard:
#
device_number: 0

# The serial number for the specific isnstance of device used
# can be specified here. It is not used by the ioHub, so is FYI only.
#
serial_number: N/A

# manufacture_date: The date of manufactiurer of the device
# can be specified here. It is not used by the ioHub,
# so is FYI only.
#
manufacture_date: DD-MM-YYYY

# The device model name can be specified here.
# It is not used by the ioHub, so is FYI only.
#
model_name: N/A

# The device model number can be specified here.
# It is not used by the ioHub, so is FYI only.
#
model_number: N/A

# The device driver and / or SDK software version number.
# This field is not used by ioHub, so is FYI only.
#
software_version: N/A

# The device's hardware version can be specified here.
# It is not used by the ioHub, so is FYI only.
#
hardware_version: N/A

# If the device has firmware, its revision number
# can be indicated here. It is not used by the ioHub, so is FYI only.
#
firmware_version: N/A
22 changes: 1 addition & 21 deletions psychopy/iohub/devices/keyboard/supported_config_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,8 @@
IOHUB_STRING:
min_length: 1
max_length: 32
model_number:
IOHUB_STRING:
min_length: 1
max_length: 16
manufacturer_name:
IOHUB_STRING:
min_length: 1
max_length: 64
serial_number:
IOHUB_STRING:
min_length: 1
max_length: 32
manufacture_date: IOHUB_DATE
software_version:
IOHUB_STRING:
min_length: 1
max_length: 8
hardware_version:
IOHUB_STRING:
min_length: 1
max_length: 8
firmware_version:
IOHUB_STRING:
min_length: 1
max_length: 8

Loading

0 comments on commit a1199c0

Please sign in to comment.