NSLS-II-CSX / profile_collection

BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Convert old-style magics positioners to labels #16

Closed mrakitin closed 5 years ago

mrakitin commented 5 years ago

@wen-hu will finish these efforts (~40% of devices already converted by @mrakitin).

wen-hu commented 5 years ago

This is the output of old magics:

In [67]: %wa                                                                                                                                                                                        
/opt/conda_envs/collection-2019-2.0-csx/lib/python3.6/site-packages/bluesky/magics.py:33: UserWarning: BlueskyMagics.positioners is deprecated. Please use the newer labels feature.
  warnings.warn("BlueskyMagics.positioners is deprecated. "
  Positioner                     Value       Low Limit   High Limit  Offset     
  cryoangle                      24.0        0.0         0.0         AttributeError
  diag2_y                        -0.0001     -100.0      100.0       0.0        
  diag3_y                        -5.3448     -5.3526     -5.3526     -5.3526    
  diag5_y                        -5.0        -4.998      -4.998      -4.998     
  diag6_pid                      0.0         0.0         0.0         AttributeError
  diag6_y                        -11.0       -25.4       -5.4        -5.4       
  epu2_gap                       238.999963  12.0        239.0       AttributeError
  epu2_phase                     3e-05       -24.6       24.6        AttributeError
  es_diag1_y                     -3.8298     -105.0      0.1         0.0        
  eta                            DisconnectedError                                    
  m1a_pit                        6.275034    -20.0       20.0        AttributeError
  m1a_rol                        2.799943    -20.0       20.0        AttributeError
  m1a_x                          -8e-06      -15.0       15.0        AttributeError
  m1a_y                          -2.409544   -10.0       10.0        AttributeError
  m1a_yaw                        5.9e-05     -20.0       20.0        AttributeError
  m1a_z                          -27.619714  -30.0       30.0        AttributeError
  m3a_bdr                        0.25        -10.0       1.0001      0.0        
  m3a_pit                        -0.7198     0.0         0.0         0.0        
  m3a_x                          -0.7499     -10.0       10.0        0.0        
  nanop_bx                       -2.184891   0.0         0.0         0.0        
  nanop_by                       -20.000005  0.0         0.0         -3.26      
  nanop_bz                       -5.739974   0.0         0.0         0.0        
  nanop_tx                       -4.479496   0.0         0.0         0.0        
  nanop_ty                       -20.000001  0.0         0.0         0.0        
  nanop_tz                       4.267627    0.0         0.0         0.0        
  say                            0.0         0.0         0.0         0.0        
  saz                            0.0         0.0         0.0         0.0        
  slt1_xc                        0.0592      -10.0       10.0        -1.0265    
  slt1_xg                        4.0003      -50.0       40.0        22.5996    
  slt1_yc                        0.5717      -100.0      100.0       1.4003     
  slt1_yg                        3.4025      -40.0       60.0        18.0778    
  slt2_xc                        0.0311      -0.069      -0.069      -0.069     
  slt2_xg                        10.1002     14.2938     14.2938     14.2938    
  slt2_yc                        -0.1        0.1515      0.1515      0.1515     
  slt2_yg                        9.0002      14.6062     14.6062     14.6062    
  slt3_x                         -5.6773     -1000.0     1000.0      0.0        
  slt3_y                         -0.2513     0.0         0.0         0.0        
  sx                             3.8         -0.55       14.0        0.0        
  sy                             0.0         0.0         0.0         AttributeError
  sz                             -0.0        0.0         0.0         AttributeError
  tardis_chi                     0.0         0           0           AttributeError
  tardis_delta                   -0.0037     -2.0        178.0       0.0        
  tardis_gamma                   30.0014     -2.9        178.0       0.0        
  tardis_h                       -0.014487   0           0           AttributeError
  tardis_k                       -1.1e-05    0           0           AttributeError
  tardis_l                       0.054064    0           0           AttributeError
  tardis_mu                      0.0         0           0           AttributeError
  tardis_phi                     0.0         0           0           AttributeError
  tardis_theta                   -0.02       -601.0      731.0       0.0        
wen-hu commented 5 years ago

This is the output of new magics:

In [1]: %wa                                                                                                                                  
tardis
  Positioner                     Value       Low Limit   High Limit  Offset     
  tardis_delta                   -0.0037     -2.0        178.0       0.0        
  tardis_gamma                   30.0013     -2.9        178.0       0.0        
  tardis_h                       -0.133986   0           0           AttributeError
  tardis_k                       -0.000102   0           0           AttributeError
  tardis_l                       0.50002     0           0           AttributeError
  tardis_theta                   -0.02       -601.0      731.0       0.0        

  Local variable name                    Ophyd name (to be recorded as metadata)
  delta                                  tardis_delta                          
  gamma                                  tardis_gamma                          
  tardis.delta                           tardis_delta                          
  tardis.gamma                           tardis_gamma                          
  tardis.h                               tardis_h                              
  tardis.k                               tardis_k                              
  tardis.l                               tardis_l                              
  tardis.theta                           tardis_theta                          
  theta                                  tardis_theta                          

source
  Positioner                     Value       Low Limit   High Limit  Offset     
  epu2_gap                       30.000005   12.0        239.0       AttributeError
  epu2_phase                     5e-06       -24.6       24.6        AttributeError

  Local variable name                    Ophyd name (to be recorded as metadata)
  epu2                                   epu2                                  

optics
  Positioner                     Value       Low Limit   High Limit  Offset     
  diag2_y                        -0.0001     -100.0      100.0       0.0        
  diag3_y                        -5.3448     -5.3526     -5.3526     -5.3526    
  diag5_y                        -5.0        -4.998      -4.998      -4.998     
  diag6_pid                      400.0       0.0         0.0         AttributeError
  diag6_y                        -11.0       -25.4       -5.4        -5.4       
  m1a_pit                        6.275034    -20.0       20.0        AttributeError
  m1a_rol                        2.799943    -20.0       20.0        AttributeError
  m1a_x                          -8e-06      -15.0       15.0        AttributeError
  m1a_y                          -2.409544   -10.0       10.0        AttributeError
  m1a_yaw                        5.9e-05     -20.0       20.0        AttributeError
  m1a_z                          -27.619714  -30.0       30.0        AttributeError
  m3a_bdr                        0.25        -10.0       1.0001      0.0        
  m3a_pit                        -0.72       0.0         0.0         0.0        
  m3a_x                          -0.75       -10.0       10.0        0.0        
  slt1_xc                        0.0593      -10.0       10.0        -1.0265    
  slt1_xg                        3.9996      -50.0       40.0        22.5996    
  slt1_yc                        0.5717      -100.0      100.0       1.4003     
  slt1_yg                        3.4025      -40.0       60.0        18.0778    
  slt2_xc                        0.0311      -0.069      -0.069      -0.069     
  slt2_xg                        10.1002     14.2938     14.2938     14.2938    
  slt2_yc                        -0.1        0.1515      0.1515      0.1515     
  slt2_yg                        9.0002      14.6062     14.6062     14.6062    
  slt3_x                         -5.6772     -1000.0     1000.0      0.0        
  slt3_y                         -0.2512     0.0         0.0         0.0        

  Local variable name                    Ophyd name (to be recorded as metadata)
  diag2_y                                diag2_y                               
  diag3_y                                diag3_y                               
  diag5_y                                diag5_y                               
  diag6_pid                              diag6_pid                             
  diag6_y                                diag6_y                               
  m1a                                    m1a                                   
  m3a                                    m3a                                   
  slt1                                   slt1                                  
  slt2                                   slt2                                  
  slt3                                   slt3                                  

motors
  Positioner                     Value       Low Limit   High Limit  Offset     
  cryoangle                      24.0        0.0         0.0         AttributeError
  es_diag1_y                     -3.8298     -105.0      0.1         0.0        
  nanop_bx                       -2.193926   0.0         0.0         0.0        
  nanop_by                       -20.000001  0.0         0.0         -3.26      
  nanop_bz                       -5.739798   0.0         0.0         0.0        
  nanop_tx                       -4.479498   0.0         0.0         0.0        
  nanop_ty                       -20.000008  0.0         0.0         0.0        
  nanop_tz                       4.267594    0.0         0.0         0.0        
  say                            0.0         0.0         0.0         0.0        
  saz                            0.0         0.0         0.0         0.0        
  sx                             3.8         -0.55       14.0        0.0        
  sy                             0.0         0.0         0.0         AttributeError
  sz                             -0.0        0.0         0.0         AttributeError

  Local variable name                    Ophyd name (to be recorded as metadata)
  cryoangle                              cryoangle                             
  es_diag1_y                             es_diag1_y                            
  nanop                                  nanop                                 
  say                                    say                                   
  saz                                    saz                                   
  sx                                     sx                                    
  sy                                     sy                                    
  sz                                     sz  
mrakitin commented 5 years ago

Checked in person with @wen-hu.

mrakitin commented 5 years ago

The latest version is:

In [1]: %wa
tardis
  Positioner                     Value       Low Limit   High Limit  Offset
  tardis_chi                     0.0         0           0           AttributeError
  tardis_delta                   -0.0037     -2.0        178.0       0.0
  tardis_gamma                   30.0013     -2.9        178.0       0.0
  tardis_h                       -0.133986   0           0           AttributeError
  tardis_k                       -0.000102   0           0           AttributeError
  tardis_l                       0.500019    0           0           AttributeError
  tardis_mu                      0.0         0           0           AttributeError
  tardis_phi                     0.0         0           0           AttributeError
  tardis_theta                   -0.02       -601.0      731.0       0.0

  Local variable name                    Ophyd name (to be recorded as metadata)
  delta                                  tardis_delta
  gamma                                  tardis_gamma
  tardis.chi                             tardis_chi
  tardis.delta                           tardis_delta
  tardis.gamma                           tardis_gamma
  tardis.h                               tardis_h
  tardis.k                               tardis_k
  tardis.l                               tardis_l
  tardis.mu                              tardis_mu
  tardis.phi                             tardis_phi
  tardis.theta                           tardis_theta
  theta                                  tardis_theta

source
  Positioner                     Value       Low Limit   High Limit  Offset
  epu2_gap                       29.999982   12.0        239.0       AttributeError
  epu2_phase                     -2.7e-05    -24.6       24.6        AttributeError

  Local variable name                    Ophyd name (to be recorded as metadata)
  epu2                                   epu2

optics
  Positioner                     Value       Low Limit   High Limit  Offset
  diag2_y                        -0.0001     -100.0      100.0       0.0
  diag3_y                        -5.3448     -5.3526     -5.3526     -5.3526
  diag5_y                        -5.0        -4.998      -4.998      -4.998
  diag6_pid                      400.0       0.0         0.0         AttributeError
  diag6_y                        -11.0       -25.4       -5.4        -5.4
  m1a_pit                        6.275034    -20.0       20.0        AttributeError
  m1a_rol                        2.799943    -20.0       20.0        AttributeError
  m1a_x                          -8e-06      -15.0       15.0        AttributeError
  m1a_y                          -2.409544   -10.0       10.0        AttributeError
  m1a_yaw                        5.9e-05     -20.0       20.0        AttributeError
  m1a_z                          -27.619714  -30.0       30.0        AttributeError
  m3a_bdr                        0.25        -10.0       1.0001      0.0
  m3a_pit                        -0.72       0.0         0.0         0.0
  m3a_x                          -0.75       -10.0       10.0        0.0
  slt1_xc                        0.0593      -10.0       10.0        -1.0265
  slt1_xg                        3.9996      -50.0       40.0        22.5996
  slt1_yc                        0.5717      -100.0      100.0       1.4003
  slt1_yg                        3.4025      -40.0       60.0        18.0778
  slt2_xc                        0.0311      -0.069      -0.069      -0.069
  slt2_xg                        10.1002     14.2938     14.2938     14.2938
  slt2_yc                        -0.1        0.1515      0.1515      0.1515
  slt2_yg                        9.0002      14.6062     14.6062     14.6062
  slt3_x                         -5.6772     -1000.0     1000.0      0.0
  slt3_y                         -0.2512     0.0         0.0         0.0

  Local variable name                    Ophyd name (to be recorded as metadata)
  diag2_y                                diag2_y
  diag3_y                                diag3_y
  diag5_y                                diag5_y
  diag6_pid                              diag6_pid
  diag6_y                                diag6_y
  m1a                                    m1a
  m3a                                    m3a
  slt1                                   slt1
  slt2                                   slt2
  slt3                                   slt3

motors
  Positioner                     Value       Low Limit   High Limit  Offset
  cryoangle                      24.0        0.0         0.0         AttributeError
  es_diag1_y                     -3.8298     -105.0      0.1         0.0
  nanop_bx                       -2.193953   0.0         0.0         0.0
  nanop_by                       -20.000001  0.0         0.0         -3.26
  nanop_bz                       -5.739828   0.0         0.0         0.0
  nanop_tx                       -4.479523   0.0         0.0         0.0
  nanop_ty                       -20.000005  0.0         0.0         0.0
  nanop_tz                       4.267621    0.0         0.0         0.0
  say                            0.0         0.0         0.0         0.0
  saz                            0.0         0.0         0.0         0.0
  sx                             3.8         -0.55       14.0        0.0
  sy                             0.0         0.0         0.0         AttributeError
  sz                             -0.0        0.0         0.0         AttributeError

  Local variable name                    Ophyd name (to be recorded as metadata)
  cryoangle                              cryoangle
  es_diag1_y                             es_diag1_y
  nanop                                  nanop
  say                                    say
  saz                                    saz
  sx                                     sx
  sy                                     sy
  sz                                     sz