Error de violación de acceso JMP Pro 12.2 (secuencia de comandos incluida)Estoy intentando crear un informe personalizado para ver varios datos que comparan la densidad de defectos de varias herramientas. A veces puedo tener muchas (más de 20) herramientas para mostrar, causando confusión con los ajustes de spline. Encontré una forma de enfatizar la spline cuando la herramienta se selecciona a través de la leyenda, pero la función causa bloqueos intermitentes en JMP.
Aquí hay una secuencia de comandos que puede reproducir el error, pero es intermitente; simplemente seleccione varios elementos de la leyenda y también deseleccione todos los elementos utilizando
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Consumer Preferences.jmp" );
dt << Color or Mark by Column( "Gender" );
change_lines = Function( {table, ns},
{default local},
Wait( 0.1 );
If( ns:nit > 1,
If( Is Scriptable( ns:dla ),
sd = ns:dla << Summary( Group( Column( ns:dla, ns:tool ) ), "Private" );
Current Data Table( sd );
sm = 0;
For( k = 1, k <= ns:nit, k++,
sm += Selected( Row State( k ) )
);
For( i = 1, i <= ns:nit, i++,
c = Color To HLS( Color Of( Row State( i ) ) );
s = Selected( Row State( i ) );
If( Is Scriptable( c ) & N Items( c ) == 3,
If( sm != 0,
If( s == 1,
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 - 0.5 * c[2], c[3] ) ) << Line Width( 4 )),
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 + 0.5 * c[2], c[3] ) ) << Line Width( 1 ))
),
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], c[2], c[3] ) ) << Line Width( 3 ))
)
);
);
Close( sd, nosave );
)
);
);
New Window( "Explore the SegFault",
Outline Box( "Bivariate and Oneway",
H List Box(
biv = Bivariate(
Y( :Name( "Salary" ) ),
X( :Name( "Birth Year" ) ),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 400, 300 ), Marker Size( 3 )} ) )
);
biv << Group By( "Gender" );
biv << Fit Spline( 1, standardized );
bivr = biv << Report();
bivr[Outline Box( 1 )] << Set Title( "Salary vs. Birth Year" );
bivr[Picture Box( 2 )] << Delete;
N = N Items( Associative Array( Column( dt, "Gender" ) ) << Get Keys );
For( i = 1, i <= N, i++,
biv << (Curve[i] << Report( 0 ))
);
biv;,
ow = Oneway(
Y( :Name( "Salary" ) ),
X( :Name( "Gender" ) ),
All Graphs( 0 ),
Means and Std Dev( 1 ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
Points Spread( 1 ),
SendToReport(
Dispatch(
{"Normal Quantile Plot"},
"Oneway QuantilePlot",
FrameBox,
{Frame Size( 350, 300 ), Marker Size( 3 ), Row Legend(
Column( dt, "Gender" ),
Marker( 1 ),
Marker Theme( "Paired" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
owr = ow << Report();
owr[Table Box( 1 )] << Set Selectable Rows();
owr[Outline Box( 1 )] << Set Title( "Proability Plot" );
legend = owr[String Col Box( 2 )];
legend << Sib Append( Number Col Box( "Mean", owr[Number Col Box( 2 )] << Get ) );
legend << Sib Append( Number Col Box( "Number", owr[Number Col Box( 1 )] << Get ) );
owr[Lineup Box( 1 )] << delete;
owr[Picture Box( 3 )] << delete;
owr[Outline Box( 2 )] << delete;
owr[Outline Box( 2 )] << Set Title( "" );
ns = New Namespace();
ns:nit = N;
ns:dla = dt;
ns:tool = "Gender";
ns:biv = biv;
owr[Number Col Box( 2 )] << Set Row Change Function( Function( {this}, change_lines( this, ns ) ) );
ow;
)
)
);
¿Hay algo que pueda hacer para que no se produzca este error? Incluí la función de espera inicial: parece ser un problema con la selección de leyenda que cambia los marcadores no seleccionados (tengo que los marcadores no seleccionados están difuminados) y quizás mi función también está intentando cambiar la pantalla durante una actualización alternativa. El aumento del tiempo de espera parece hacer que el error sea menos frecuente, pero no alivia completamente la situación.
¡Gracias!
Re: JMP Pro 12.2 Error de violación de acceso (secuencia de comandos incluida)El soporte técnico de JMP ha abierto un defecto para este problema y espera que se resuelva en una versión futura de JMP.
Re: JMP Pro 12.2 Error de violación de acceso (secuencia de comandos incluida)¡Gracias por toda la ayuda! Pude aceptar sus sugerencias para no eliminar los elementos y hacer que el script funcione sin errores. No me gustaba eliminar los elementos, pero no sabía de la forma práctica de ocultarlos.
Aquí está mi script original modificado para que funcione completamente.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Consumer Preferences.jmp" );
dt << Color or Mark by Column( "Gender" );
change_lines = Function( {table, ns},
{default local},
flag = 0;
lst = As List( table << Get Selected Rows() );
For( i = 1, i <= ns:nit, i++,
c = Color To HLS( Color Of( Column( ns:rs, "rsd" )[i] ) );
If( N Items( As List( Loc( lst, i ) ) ) == 0,
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 + 0.5 * c[2], c[3] ) ) << Line Width( 1 )),
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], 0.5 - 0.5 * c[2], c[3] ) ) << Line Width( 4 ));
flag = 1;
);
);
If( flag == 0,
For( i = 1, i <= ns:nit, i++,
c = Color To HLS( Color Of( Column( ns:rs, "rsd" )[i] ) );
ns:biv << (Curve[i] << Line Color( HLS Color( c[1], c[2], c[3] ) ) << Line Width( 3 ));
)
);
);
New Window( "Explore the SegFault",
Outline Box( "Bivariate and Oneway",
H List Box(
ns = New Namespace();
ns:biv = Bivariate(
Y( :Name( "Salary" ) ),
X( :Name( "Birth Year" ) ),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 400, 300 ), Marker Size( 3 )} ) )
);,
ns:ow = Oneway(
Y( :Name( "Salary" ) ),
X( :Name( "Gender" ) ),
All Graphs( 0 ),
Means and Std Dev( 1 ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
Points Spread( 1 ),
SendToReport(
Dispatch(
{"Normal Quantile Plot"},
"Oneway QuantilePlot",
FrameBox,
{Frame Size( 350, 300 ), Marker Size( 3 ), Row Legend(
Column( dt, "Gender" ),
Marker( 1 ),
Marker Theme( "Paired" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
ns:owr = ns:ow << Report();
ns:owr[Table Box( 1 )] << Set Selectable Rows();
ns:owr[Outline Box( 1 )] << Set Title( "Proability Plot" );
legend = ns:owr[String Col Box( 2 )];
legend << Sib Append( Number Col Box( "Mean", ns:owr[Number Col Box( 2 )] << Get ) );
legend << Sib Append( Number Col Box( "Number", ns:owr[Number Col Box( 1 )] << Get ) );
ns:owr[Lineup Box( 1 )] << delete;
ns:owr[Picture Box( 3 )] << delete;
ns:owr[Outline Box( 2 )] << delete;
ns:owr[Outline Box( 2 )] << Set Title( "" );
ns:dla = dt;
ns:tool = "Gender";
ns:biv = ns:biv;
ns:rs = ns:dla << Summary( Group( Column( ns:dla, ns:tool ) ), "Private" );
ns:rs << New Column( "rsd", Row State, Set Formula( Color State( Color Of( Row State() ) ) ) );
ns:nit = N Items( legend << Get );
ns:biv << group by( Column( ns:dla, ns:tool ) );
ns:biv << fit spline( 1, standardized );
ns:bivr = ns:biv << Report();
ns:bivr[Outline Box( 1 )] << Set Title( "Trend Chart" );
ns:bivr[Picture Box( 2 )] << Visibility( "Collapse" );
isdone = 0;
For( i = 1, i <= ns:nit, i++,
ns:biv << (Curve[i] << Report( 0 ));
ns:bivr[List Box( 4 + i )] << Visibility( "Collapse" );
);
ns:owr[Number Col Box( 2 )] << Set Row Change Function( Function( {this}, change_lines( this, ns ) ) );
)
)
);Re: JMP Pro 12.2 Error de violación de acceso (secuencia de comandos incluida)Agregaré que eliminar el contenido de un informe de la plataforma a menudo puede llevar a problemas. Yo sugeriría:
- Use una opción de plataforma si existe, esto es lo que hizo Georgia con
ow << Means and Std Dev(0);
- Cuando las opciones de la plataforma no están disponibles, puede utilizar el cuadro << Visibilidad ("Contraer") mensaje en lugar de borrar. Esto se comporta de manera similar a una IfBox () al saltear partes del reporte para maquetación y dibujo.
Además de evitar el bloqueo, una de las ventajas de estos enfoques es que se recordarán en scripts. Si modifica una de sus plataformas de forma interactiva y utiliza la ventana Guardar script a script, las personalizaciones se incluirán en el script. Esto también puede ser importante si desea agregar filtros, lo que también hará que las plataformas se regeneren desde el script.
Re: JMP Pro 12.2 Error de violación de acceso (secuencia de comandos incluida)Pude reproducir la infracción de acceso y envié el informe a JMP con el script y la referencia del blog.
Seleccioné M, luego seleccioné F y fui botado.
Estoy de acuerdo con David.
Encontré una sintaxis extraña, hice algunos cambios de guión y tengo un par de comentarios:
Adjunto una modificación de su script y un script más simple, publicado previamente. Utiliza la leyenda y una tabla de resumen y un controlador de estado de fila. No "desvanece" las splines no seleccionadas como lo hizo su script.
No puedo garantizar, la violación de acceso no se producirá. Responde, si todavía ocurre.
Re: JMP Pro 12.2 Error de violación de acceso (secuencia de comandos incluida)Por lo que vale, no he podido reproducir la infracción de acceso (con o sin la espera). He intentado con varias versiones incluyendo 12.2.
Si estuviera experimentando este problema, buscaría refactorizar el código. En particular, mi opinión es que se debe usar una función de Nueva ventana para representar cuadros de visualización y, si bien JMP puede tolerar la inserción de JSL, es feo, no es necesario y potencialmente problemático. Así, por ejemplo, todos los mensajes enviados al informe biv harían después de la definición de Nueva ventana.