Skip to content

Commit 595a516

Browse files
author
Cloud User
committed
fixed pymas single varible code issue AND fixed automated test to match new tweaks of pymas
1 parent 9b15266 commit 595a516

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/sasctl/utils/pymas/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def build_wrapper_function(func, variables, array_input, setup=None,
7676
' result = {}(inputrun)'.format(func))
7777
else:
7878
func_call = '{}({})'.format(func, ','.join(args))
79-
middle = (' result = {}'.format(func_call))
79+
middle = (' result = {}'.format(func_call),)
8080

8181
# TODO: Verify that # of values returned by wrapped func matches length of output_names
8282
# TODO: cast all return types before returning (DS2 errors out if not exact match)

tests/integration/test_pymas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_from_pickle(train_data, pickle_file):
165165
166166
if null(py) then do;
167167
py = _new_ pymas();
168-
rc = py.useModule('mypymodule', 1);
168+
rc = py.useModule('DF74A4B18C9E41A2A34B0053E123AA67', 1);
169169
if rc then do;
170170
rc = py.appendSrcLine('try:');
171171
rc = py.appendSrcLine(' import pickle, base64');
@@ -196,7 +196,7 @@ def test_from_pickle(train_data, pickle_file):
196196
rc = py.appendSrcLine(' else: ');
197197
rc = py.appendSrcLine(' return result, msg');
198198
pycode = py.getSource();
199-
revision = py.publish(pycode, 'mypymodule');
199+
revision = py.publish(pycode, 'DF74A4B18C9E41A2A34B0053E123AA67');
200200
if revision lt 1 then do;
201201
logr.log('e', 'py.publish() failed.');
202202
rc = -1;

tests/unit/test_pymas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def domath(a, b):
357357
d = py.getDouble('d');
358358
end;
359359
"""
360-
method = DS2PyMASMethod([
360+
method = DS2PyMASMethod('mypymodule',[
361361
DS2Variable('a', 'double', False),
362362
DS2Variable('b', 'double', False),
363363
DS2Variable('c', 'double', True),
@@ -452,15 +452,15 @@ def test_ds2_package():
452452
453453
if null(py) then do;
454454
py = _new_ pymas();
455-
rc = py.useModule('mypymodule', 1);
455+
rc = py.useModule('pyscore', 1);
456456
if rc then do;
457457
rc = py.appendSrcLine('def domath(a, b):');
458458
rc = py.appendSrcLine(' "Output: c, d"');
459459
rc = py.appendSrcLine(' c = a * b');
460460
rc = py.appendSrcLine(' d = a / b');
461461
rc = py.appendSrcLine(' return c, d');
462462
pycode = py.getSource();
463-
revision = py.publish(pycode, 'mypymodule');
463+
revision = py.publish(pycode, 'pyscore');
464464
if revision lt 1 then do;
465465
logr.log('e', 'py.publish() failed.');
466466
rc = -1;

0 commit comments

Comments
 (0)