5050import org .scijava .code .lsp .Environment ;
5151import org .scijava .code .lsp .ScriptDialect ;
5252import org .scijava .code .lsp .ScriptDialect .Header ;
53+ import org .scijava .code .lsp .ScriptDialect .Variable ;
5354import org .scijava .plugin .PluginService ;
5455import org .scijava .plugins .scripting .appose .python .ScriptEnvironment ;
5556import org .scijava .plugins .scripting .appose .python ._internal .ResidentWorkerService ;
@@ -110,10 +111,10 @@ public void testHeader() {
110111 // SciJava Script parameters should be declared in Python code with the
111112 // types Appose converts them to, e.g. "image: numpy.ndarray"; and
112113 // scripts can use Appose's task variable
113- final Map <String , Class <?> > parameters = new LinkedHashMap <>();
114- parameters .put ("image" , Img .class );
115- parameters .put ("sigma" , double .class );
116- parameters .put ("context" , Context .class );
114+ final Map <String , Variable > parameters = new LinkedHashMap <>();
115+ parameters .put ("image" , Variable . ofType ( Img .class ) );
116+ parameters .put ("sigma" , Variable . ofType ( double .class ) );
117+ parameters .put ("context" , Variable . ofType ( Context .class ) );
117118 Header header = dialect .header (parameters );
118119 assertEquals ("import appose.python_worker; import numpy; " +
119120 "image: numpy.ndarray; sigma: float; " +
@@ -122,8 +123,8 @@ public void testHeader() {
122123 assertEquals (Arrays .asList ("appose" , "numpy" ), Arrays .asList (header
123124 .hiddenNames ().toArray ()));
124125 // numpy is imported only when a parameter needs it
125- header = dialect .header (Collections .singletonMap ("sigma" ,
126- double .class ));
126+ header = dialect .header (Collections .singletonMap ("sigma" , Variable
127+ . ofType ( double .class ) ));
127128 assertEquals ("import appose.python_worker; sigma: float; " +
128129 "task: appose.python_worker.Task" , header .code ());
129130 assertEquals (Collections .singleton ("appose" ), header .hiddenNames ());
0 commit comments