Closed ken-lauer closed 2 months ago
@ken-lauer Fixed. Notice that the output of plot_lat_layout
has changed.
Thank you for addressing this so quickly, @DavidSagan!
I'm running into an out-of-bounds error now with python floor_plan
. Here's how to reproduce it:
tao -init $ACC_ROOT_DIR/regression_tests/python_test/tao.init_photon -external_plotting -noplot
Tao> python place_buffer
r13;floor_plan
r23;photon_intensity
r33;orbit
layout;lat_layout
Tao> place -no_buffer r13 floor_plan
Tao> python floor_plan r13.g
At line 4272 of file /Users/runner/miniforge3/conda-bld/bmad_1721028304028/work/tao/code/tao_python_cmd.f90
Fortran runtime error: Index '1' of dimension 1 of array 'g%floor_list' below lower bound of 2314885530818453536
Error termination. Backtrace:
...
This also happens in tao.init_wall
if that helps.
I could not reproduce but I put in what should be a fix.
I'm still seeing it with the new release. It appears to be a difference of -noplot
vs plotting mode.
Just -external_plotting
:
$ tao -init $ACC_ROOT_DIR/regression_tests/python_test/tao.init_wall -external_plotting
Tao> place -no_buffer r12 floor_plan
Tao> python floor_plan r12.g
0;0;Beginning_Ele; 0.0000000E+00; 0.0000000E+00; 0.0000000E+00; 0.0000000E+00; 0.0000000E+00; 0.0000000E+00;0;; 0.00E+00; 0.00E+00;;
0;1;SBend; 0.0000000E+00; 0.0000000E+00; 0.0000000E+00; 1.0000000E+00; 0.0000000E+00; 0.0000000E+00;1;box; 0.00E+00; 0.00E+00;black;; 1.0000000E+00; 0.0000000E+00; 0.0000000E+00; 0.0000000E+00
0;2;Marker; 1.0000000E+00; 0.0000000E+00; 0.0000000E+00; 1.0000000E+00; 0.0000000E+00; 0.0000000E+00;0;; 0.00E+00; 0.00E+00;;
-noplot
and -external_plotting
:
$ tao -init $ACC_ROOT_DIR/regression_tests/python_test/tao.init_wall -external_plotting -noplot
Tao> place -no_buffer r12 floor_plan
Tao> python floor_plan r12.g
[ERROR | 2024-JUL-16 08:03:43] tao_python_cmd:
"python floor_plan r12.g": Floor plan drawing not yet setup for this graph.
INVALID
At line 4276 of file /Users/runner/miniforge3/conda-bld/bmad_1721087783820/work/tao/code/tao_python_cmd.f90
Fortran runtime error: Index '1' of dimension 1 of array 'g%floor_list' below lower bound of 2314885530818453536
Error termination. Backtrace:
#0 0x1064b7cf7
(...clipped...)
Certainly it should not crash (looks like it's missing a return
statement in the recent fix).
-> However, "floor plan drawing" should have been initialized even in the -noplot
case, right?
Separately, would you consider allowing a bmad-ecosystem
contribution where pytao runs its test suite on your latest changes? While it may break at times when the python
command output changes, but it might also help in the development/tweaking of all its sub-commands.
Yes it was a missing return statement. The floor_plan drawing info is only initialized when the floor_plan is plotted and with the -noplot option the place command is not enough to cause the plotting calc.
And yes the pytao tests can be run. Currently, the pytao test does is not configured to be compatible with the regression test script. We can zoom to discuss.
And the latest code in the repo does have the return statement.
The floor_plan drawing info is only initialized when the floor_plan is plotted and with the -noplot option the place command is not enough to cause the plotting calc.
Is there a chance you'd consider addressing this on the Tao side? I'm working on a Python plotting backend that doesn't rely on the existence of X forwarding - specifically matplotlib/bokeh with Jupyter notebook integration. Requiring normal tao plotting to be enabled just to make the floor plan wouldn't be great.
I should have said the plotting setup needs to be done. This is independent of X.
I understand now - thanks. Would you like me to open a new issue as a reminder of the request, or is this one sufficient?
Do you have time to zoom?
With
tao -init $ACC_ROOT_DIR/bmad-doc/tao_examples/cbeta_cell/tao.init
, we have a layout that looks like this:python plot_lat_layout
provides information about 4 elements:The lattice:
This appears to be related to the "lord" element skip: https://github.com/bmad-sim/bmad-ecosystem/blob/c8d13b3eccd290d2329cc0305d4092f63ce8f708/tao/code/tao_python_cmd.f90#L5623
Floor plan output skips a number of elements as well: https://github.com/bmad-sim/bmad-ecosystem/blob/c8d13b3eccd290d2329cc0305d4092f63ce8f708/tao/code/tao_python_cmd.f90#L4274-L4278