-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine collection
and ldrd20-31
profiles to use with blop
#12
base: master
Are you sure you want to change the base?
Conversation
I think it worked OK. We'll merge the qserver-related changes from the https://github.com/NSLS-II-XPD/profile_collection/tree/minimal branch via a separate PR. |
I think we should keep this PR branch separate from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to apply black
/isort
formatting to this repo and enforce it via CI on every commit. Let's do it in a separate PR after this PR is merged (assuming we can use it with and without portable equipment).
Some suggestions are below meanwhile.
tiled_client = from_profile("xpd-ldrd20-31") | ||
except (NameError, ModuleNotFoundError): | ||
pass | ||
qepro = QEPro('XF:28ID2-ES{QEPro:Spec-1}:', name='QEPro', ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: make instantiation conditional based on the fact is the equipment is at the beamline or not. try..except
will work.
|
||
try: | ||
from tiled.client import from_profile | ||
tiled_client = from_profile("xpd-ldrd20-31") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheng-hung, do we need it here? Are you using it elsewhere? We probably should move it to 00-startup.py
.
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dds1 = syrng_DDS('XF:28IDC-ES:1{Pump:Syrng-DDS:1', name='DDS1') | ||
|
||
dds1_p1 = syrng_DDS_ax('XF:28IDC-ES:1{Pump:Syrng-DDS:1-Ax:A}', name='DDS1_p1', parent=dds1, | ||
read_attrs=['status', | ||
'read_target_vol', 'read_target_vol_unit', | ||
'read_infused', 'read_infused_unit', | ||
'read_withdrawn', 'read_withdrawn_unit', | ||
'read_infuse_rate', 'read_infuse_rate_unit', | ||
'read_withdraw_rate', 'read_withdraw_rate_unit']) | ||
|
||
dds1_p2 = syrng_DDS_ax('XF:28IDC-ES:1{Pump:Syrng-DDS:1-Ax:B}', name='DDS1_p2', parent=dds1, | ||
read_attrs=['status', | ||
'read_target_vol', 'read_target_vol_unit', | ||
'read_infused', 'read_infused_unit', | ||
'read_withdrawn', 'read_withdrawn_unit', | ||
'read_infuse_rate', 'read_infuse_rate_unit', | ||
'read_withdraw_rate', 'read_withdraw_rate_unit']) | ||
|
||
|
||
|
||
|
||
dds2 = syrng_DDS('XF:28IDC-ES:1{Pump:Syrng-DDS:2', name='DDS2') | ||
|
||
dds2_p1 = syrng_DDS_ax('XF:28IDC-ES:1{Pump:Syrng-DDS:2-Ax:A}', name='DDS2_p1', parent=dds2, | ||
read_attrs=['status', | ||
'read_target_vol', 'read_target_vol_unit', | ||
'read_infused', 'read_infused_unit', | ||
'read_withdrawn', 'read_withdrawn_unit', | ||
'read_infuse_rate', 'read_infuse_rate_unit', | ||
'read_withdraw_rate', 'read_withdraw_rate_unit']) | ||
|
||
dds2_p2 = syrng_DDS_ax('XF:28IDC-ES:1{Pump:Syrng-DDS:2-Ax:B}', name='DDS2_p2', parent=dds2, | ||
read_attrs=['status', | ||
'read_target_vol', 'read_target_vol_unit', | ||
'read_infused', 'read_infused_unit', | ||
'read_withdrawn', 'read_withdrawn_unit', | ||
'read_infuse_rate', 'read_infuse_rate_unit', | ||
'read_withdraw_rate', 'read_withdraw_rate_unit']) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these devices should be instantiated conditionally.
LED = EpicsSignal('XF:28IDC-ES:1{Light:Flu-LED:1}Cmd', name='LED_M365LP1', string=True, kind='hinted') | ||
# 0: 'Low'; 1: 'High' | ||
|
||
deuterium = EpicsSignal('XF:28IDC-ES:1{Light:Abs-Dut:1}Cmd', name='Deuterium', string=True, kind='Config') | ||
# 0: 'Low'; 1: 'High' | ||
|
||
halogen = EpicsSignal('XF:28IDC-ES:1{Light:Abs-Hal:1}Cmd', name='Halogen', string=True, kind='Config') | ||
# 0: 'Low'; 1: 'High' | ||
|
||
UV_shutter = EpicsSignal('XF:28IDC-ES:1{Light:Abs-Sht:1}Cmd', name='UV_shutter', string=True, kind='hinted') | ||
# 0: 'Low' --> shutter close.; 1: 'High' --> Shutter open. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional instantiation, please.
|
||
|
||
|
||
def _exprot_rate_agent(metadata_dic, rate_label_dic, agent_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _exprot_rate_agent(metadata_dic, rate_label_dic, agent_data): | |
def _export_rate_agent(metadata_dic, rate_label_dic, agent_data): |
Check where it's used and fix the name there as well.
plt.figure(num=i) | ||
|
||
|
||
class plot_uvvis(open_figures): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class name should use the PascalCase style.
class plot_uvvis(open_figures): | |
class PlotUvvis(open_figures): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All classes' names in this module should be corrected. See https://peps.python.org/pep-0008/#class-names for guidance.
This is a PR to add the startup files from the https://github.com/NSLS-II-XPD/profile_collection_ldrd20-31 repo to here, with updated numbering.