使用 Python 的 JSL 脚本在 JMP 18 中不再起作用我们正在将工具链移植到 JMP 18 中。由于许多 JMP python 调用在 JMP 18 中已被弃用/更改,并且我们正在使用 python 元素,因此我正在尝试排除一些脚本的故障,这些脚本在 JMP 17 中运行良好,但在 JMP18 上运行时会抛出错误。
由于保密原因,我无法分享我们脚本的确切内容,因此在论坛中解决问题有点困难,但在我看来,主要问题是当我从另一个 jsl 外部调用函数时引起的
Include("./../Functions/doSomeThing.jsl");并且无论是在脚本调用中还是函数本身都包含一些调用 Python 的代码,例如,
Python Submit(
"\[
import scipy.signal
import numpy as _JMPnp
import scipy as _JMPsp
import pandas as _JMPpd
import sqlite3 as _JMPsq
print("Python Imports OK")<BR /><BR />doing stuff...
]\"
);这些错误信息让我想到,在 Python 中工作时,JMP 18 会出现混乱,并且也有类似的 JSL 函数
myFunction = Function({Input, otherInput},
Result = blablabla;
Return(Result);
);特别是如果函数不在同一个 jsl 中,但是被 include() 调用,或者由于某种原因,jsl 不再识别该 include。
我在 JMP18 中还有其他 jsl 示例,其中 include 可以工作(不使用 python)或者 python 可以工作(不使用 include),但是当我嵌套 jsls 相互调用时,两者的组合在 JMP 18 中似乎对我来说不起作用。
有没有提示/想法,JMP 17 和 JMP 18 之间可能有哪些变化,导致我的脚本崩溃?有人和我遇到同样的问题吗?
自动化和脚本回复:使用 Python 的 JSL 脚本在 JMP 18 中不再起作用我无法根据上述描述重现该问题。您能否创建一对 JSL/Python 脚本来演示您的问题。以下是我根据您的描述重现的尝试。
嵌套父级.jsl
// nested_parent.jsl
Names Default to Here(1);
Include("./JSL_Functions/nested.jsl");
print( "My Version: " || myVersion() );
JSL_函数/nested.jsl
// nested.jsl
Names Default to Here(1);
myVersion = Function({}, {},
Python Execute ({}, {v}, "\[
import jmp
v = jmp.__version__
]\");
Return(v);
);
运行 nested_parent.jsl 会产生以下输出。
/*:
//:*/
// nested parent
Names Default to Here(1);
Include("./JSL_Functions/nested.jsl");
print( "My Version: " || myVersion() );
/*:
//:*/
import jmp
v = jmp.__version__
/*:
"My Version: 1.0.0"
回复:使用 Python 的 JSL 脚本在 JMP 18 中不再起作用@Feli - 嗨!我建议就此问题联系技术支持 ( support@jmp.com )。