Skip to content

Commit 6d54554

Browse files
author
Kevin D Smith
committed
Change option name for better option hierarchy
1 parent 459c261 commit 6d54554

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

swat/cas/datamsghandlers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,10 @@ def get(arr, idx, default=0):
336336
self._sw_databuffer)
337337
elif vrtype == 'NUMERIC' and vtype in ['INT32', 'DATE']:
338338
if pd.isnull(value):
339-
value = get_option('cas.%s_missing' % vtype.lower())
339+
value = get_option('cas.missing.%s' % vtype.lower())
340340
warnings.warn(("Missing value found in 32-bit integer-based column '%s'.\n" %
341341
v['name']) +
342-
("Substituting cas.%s_missing option value (%s)." %
342+
("Substituting cas.missing.%s option value (%s)." %
343343
(vtype.lower(), value)),
344344
RuntimeWarning)
345345
if length > 4:
@@ -353,10 +353,10 @@ def get(arr, idx, default=0):
353353
self._sw_databuffer)
354354
elif vrtype == 'NUMERIC' and vtype in ['INT64', 'DATETIME', 'TIME']:
355355
if pd.isnull(value):
356-
value = get_option('cas.%s_missing' % vtype.lower())
356+
value = get_option('cas.missing.%s' % vtype.lower())
357357
warnings.warn(("Missing value found in 64-bit integer-based column '%s'.\n"
358358
% v['name']) +
359-
("Substituting cas.%s_missing option value (%s)." %
359+
("Substituting cas.missing.%s option value (%s)." %
360360
(vtype.lower(), value)),
361361
RuntimeWarning)
362362
if length > 8:

swat/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,19 @@ def check_severity(sev):
140140
# Integer missing value substitutions
141141
#
142142

143-
register_option('cas.int64_missing', 'int', check_int, -2**(64-1),
143+
register_option('cas.missing.int64', 'int', check_int, -2**(64-1),
144144
'Sets substitution value for int64 missing values.')
145145

146-
register_option('cas.int32_missing', 'int', check_int, -2**(32-1),
146+
register_option('cas.missing.int32', 'int', check_int, -2**(32-1),
147147
'Sets substitution value for int32 missing values.')
148148

149-
register_option('cas.date_missing', 'int', check_int, -2**(32-1),
149+
register_option('cas.missing.date', 'int', check_int, -2**(32-1),
150150
'Sets substitution value for date missing values.')
151151

152-
register_option('cas.time_missing', 'int', check_int, -2**(64-1),
152+
register_option('cas.missing.time', 'int', check_int, -2**(64-1),
153153
'Sets substitution value for time missing values.')
154154

155-
register_option('cas.datetime_missing', 'int', check_int, -2**(64-1),
155+
register_option('cas.missing.datetime', 'int', check_int, -2**(64-1),
156156
'Sets substitution value for datetime missing values.')
157157

158158
#

swat/tests/cas/test_basics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def setUp(self):
5252
swat.reset_option()
5353
swat.options.cas.print_messages = False
5454
swat.options.interactive_mode = True
55-
swat.options.int64_missing = -999999
55+
swat.options.cas.missing.int64 = -999999
5656

5757
self.s = swat.CAS(HOST, PORT, USER, PASSWD, protocol=PROTOCOL)
5858

swat/tests/cas/test_datamsg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def setUp(self):
5252
swat.reset_option()
5353
swat.options.cas.print_messages = False
5454
swat.options.interactive_mode = False
55-
swat.options.int64_missing = -999999
55+
swat.options.cas.missing.int64 = -999999
5656

5757
self.s = swat.CAS(HOST, PORT, USER, PASSWD, protocol=PROTOCOL)
5858

swat/tests/cas/test_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def setUp(self):
5959
swat.options.cas.trace_actions = False
6060
swat.options.cas.trace_ui_actions = False
6161
swat.options.interactive_mode = False
62-
swat.options.int64_missing = -999999
62+
swat.options.cas.missing.int64 = -999999
6363

6464
self.s = swat.CAS(HOST, PORT, USER, PASSWD, protocol=PROTOCOL)
6565

swat/tests/test_config.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,10 @@ def test_doc(self):
245245

246246
def test_suboptions(self):
247247
self.assertEqual(list(sorted(get_suboptions('cas').keys())),
248-
['dataset', 'date_missing', 'datetime_missing',
249-
'exception_on_severity', 'hostname',
250-
'int32_missing', 'int64_missing',
248+
['dataset', 'exception_on_severity',
249+
'hostname', 'missing',
251250
'port', 'print_messages', 'protocol',
252-
'time_missing', 'trace_actions',
253-
'trace_ui_actions'])
251+
'trace_actions', 'trace_ui_actions'])
254252

255253
with self.assertRaises(SWATOptionError):
256254
get_suboptions('cas.foo')

0 commit comments

Comments
 (0)