Skip to content

Commit

Permalink
RF: Removed need for IOHUB_NUMBER
Browse files Browse the repository at this point in the history
  • Loading branch information
isolver committed Mar 17, 2021
1 parent a1199c0 commit 18dc2be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
13 changes: 0 additions & 13 deletions psychopy/iohub/devices/deviceConfigValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,19 +315,6 @@ def isValidInt(config_param_name, value, constraints):

raise IntValueError(config_param_name, value, constraints)


def isValidNumber(config_param_name, value, constraints):
try:
int_value = isValidInt(config_param_name, value, constraints)
return int_value
except Exception:
try:
float_value = isValidFloat(config_param_name, value, constraints)
return float_value
except Exception:
raise NumberValueError(config_param_name, value, constraints)


def isBool(config_param_name, value, valid_value):
try:
value = bool(value)
Expand Down
21 changes: 3 additions & 18 deletions psychopy/iohub/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,9 @@ def getDeviceParams(device_name):
# dict (basically just used for expInfo I think)
"""
builder_param_proto = dict(valType=None, inputType=None, defaultVal=None, allowedVals=None, hint=None, label=None)
iodtype2valType = dict(
IOHUB_STRING=str,
IOHUB_BOOL=bool,
IOHUB_FLOAT=float,
IOHUB_INT=isValidInt,
IOHUB_NUMBER=isValidNumber,
IOHUB_LIST=isValidList,
IOHUB_RGBA255_COLOR=isValidRgb255Color,
IOHUB_IP_ADDRESS_V4=isValidIpAddress,
)

iodtype2valType = dict(IOHUB_STRING=str, IOHUB_BOOL=bool, IOHUB_FLOAT=float, IOHUB_INT=int, IOHUB_LIST=list,
IOHUB_RGBA255_COLOR='color', IOHUB_IP_ADDRESS_V4=str)


supported_config = getDeviceSupportedConfig(device_name)
Expand Down Expand Up @@ -337,14 +330,6 @@ def settings2Params(parent_list, settings):

settings2Params([], default_config)

#import pprint
#print("SUPPORTED:")
#pprint.pprint(supported_config)
#print("DEFAULT:")
# pprint.pprint(default_config)



return default_config

if sys.platform == 'win32':
Expand Down

0 comments on commit 18dc2be

Please sign in to comment.